Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function section_callback() {
- echo '<p>Select which areas of content you wish to display.</p>';
- }
- public function field_callback() {
- $html = '<input type="text" id="input_offer" name="questionaire[input_field]" />';
- echo $html;
- }
- public function register_settings() {
- // First, we register a section. This is necessary since all future options must belong to a
- add_settings_section(
- 'my_settings_section', // ID used to identify this section and with which to register options
- 'iPhones', // Title to be displayed on the administration page
- 'section_callback', // Callback used to render the description of the section
- $this->plugin_name // Page on which to add this section of options
- );
- // Next, we'll introduce the fields for toggling the visibility of content elements.
- add_settings_field(
- 'input_field', // ID used to identify the field throughout the theme
- 'Offer', // The label to the left of the option interface element
- 'field_callback', // The name of the function responsible for rendering the option interface
- $this->plugin_name, // The page on which this option will be displayed
- 'my_settings_section' // The name of the section to which this field belongs
- );
- register_setting( $this->plugin_name, 'input_field' );
- }
- private function define_admin_hooks() {
- $plugin_admin = new Questionaire_Admin( $this->get_plugin_name(), $this->get_version() );
- ...
- $this->loader->add_action( 'admin_init', $plugin_admin, 'register_settings' );
- ...
- }
Add Comment
Please, Sign In to add comment