options = new ABB_Options(); // Grab an instance of the ABB_Options class $this->set_description(); // Set the description $this->set_faq_sections(); // Set the FAQ sections $this->set_faq_questions(); // Set the FAQ questions } /** * Add the Read Me tab to the plugin settings page */ public function do_readme_tab(){ ?> Read Me FAQ plugin_text_domain)); $faq_section_title = sprintf('== %1$s =='."\n\n", __('Frequently Asked Questions', $this->plugin_text_domain)); ?>
description; } /** * Set the plugin description * * @since 4.1 */ private function set_description(){ $this->description = array( 'id' => 'admin_bar_button', 'page' => 'settings_page_' . $this->settings_page, 'callback' => array(&$this, '_description') ); } /** * Return the plugin FAQ sections * * @since 4.1 * @return array */ public function get_faq_sections(){ return $this->faq_sections; } /** * Set the plugin FAQ sections * * @since 4.1 */ private function set_faq_sections(){ $this->faq_sections = array( 'admin_bar_button' => array( 'page' => 'settings_page_' . $this->settings_page, 'callback' => array(&$this, '_faq_section') ) ); } /** * Return the plugin FAQ questions * * @since 4.1 * @return array */ public function get_faq_questions(){ return $this->faq_questions; } /** * Set the plugin FAQ questions * * @since 4.1 */ private function set_faq_questions(){ $this->faq_questions = array( 'question_options' => array( 'section' => 'admin_bar_button', 'callback' => array(&$this, '_question_options'), 'args' => array( 'title' => __('What options are available?', $this->plugin_text_domain) ) ), 'question_defaults' => array( 'section' => 'admin_bar_button', 'callback' => array(&$this, '_question_defaults'), 'args' => array( 'title' => __('What are the default settings?', $this->plugin_text_domain) ) ), 'question_animation' => array( 'section' => 'admin_bar_button', 'callback' => array(&$this, '_question_animation'), 'args' => array( 'title' => __('Can I prevent the WordPress admin bar show/hide action from being animated?', $this->plugin_text_domain) ) ), 'question_reset' => array( 'section' => 'admin_bar_button', 'callback' => array(&$this, '_question_reset'), 'args' => array( 'title' => __('Can I restore the default settings?', $this->plugin_text_domain) ) ) ); } /** * Callback to output the description * * @since 4.1 * @param required string $id The description ID * @param required array $args Any description arguments */ public function _description($id, $args){ $defaults = array( 'for_readme' => false ); $args = wp_parse_args($args, $defaults); $this->for_readme = $args['for_readme']; // Set whether or not the questions are to be output for the readme file $parts = array( '', __('Admin Bar Button is a plugin that will create a simple button to replace the WordPress admin bar on the front end.', $this->plugin_text_domain), __('Clicking the button (or hovering over it) will then show the WordPress admin bar.', $this->plugin_text_domain), __('When using this plugin, the full height of the page is used by your site, which is particularly handy if you have fixed headers.', $this->plugin_text_domain), __('Please see the [Screenshots tab](http://wordpress.org/plugins/admin-bar-button/screenshots/ "Admin Bar Button » Screenshots") to see how the Admin Bar Button looks.', $this->plugin_text_domain), '
', '', __('After activating the plugin, you can change how the Admin Bar Button looks and works by visiting the ', $this->plugin_text_domain), $this->get_settings_link(), __('page', $this->plugin_text_domain), '(' . __('Settings » Admin Bar Button', $this->plugin_text_domain) . ').', __('However, **no user interaction is required** by the plugin; if you wish, you can simply install and activate Admin Bar Button and it\'ll work right away.', $this->plugin_text_domain), '
', '', __('This plugin has been tested with the Twenty Sixteen, Twenty Fifteen, and Twenty Fourteen themes that are shipped with WordPress 4.5.', $this->plugin_text_domain), __('Should you find a theme with which it does not work, please open a new topic on the [Support tab](https://wordpress.org/support/plugin/admin-bar-button "Admin Bar Button » Support").', $this->plugin_text_domain), '
', ); $description = $this->compile_content($parts); echo $this->maybe_wrap($description, '%1$s
'; } /** * Return the appropriate format to use when outputting a settings option * * @return string */ private function get_option_format(){ return ($this->for_readme) ? '* **%1$s:** > %2$s' : '