"general_settings", 'title' => __("Settings", 'afb'), 'page' => "afbia_settings_page", 'description' => __("These settings control some general aspects of the instant article plugin and how your instant articles are shown on facebook.", 'afb'), ); $settings_example_section = new afbia_settings_section($args); $args = array( 'id' => 'afbia_page_id', 'title' => __("Page ID", 'afb'), 'page' => 'afbia_settings_page', 'section' => 'general_settings', 'description' => __("The page ID of the facebook page you want to add Instant Articles to.", 'afb'), 'type' => 'text', // text, textarea, password, checkbox 'option_group' => "settings_page_afbia_settings_page", ); $afbia_page_id = new afbia_settings_field($args); $args = array( 'id' => 'afbia_copyright', 'title' => __("Copyright", 'afb'), 'page' => 'afbia_settings_page', 'section' => 'general_settings', 'description' => __("The standard copyright details for your instant articles.", 'afb'), 'type' => 'textarea', // text, textarea, password, checkbox 'option_group' => "settings_page_afbia_settings_page", ); $afbia_copyright = new afbia_settings_field($args); $args = array( 'id' => 'afbia_tracking', 'title' => __("Tracking", 'afb'), 'page' => 'afbia_settings_page', 'section' => 'general_settings', 'description' => __("The tracking code, that will be embedded in your instant articles. See this link for more information.", 'afb'), 'type' => 'textarea', // text, textarea, password, checkbox 'option_group' => "settings_page_afbia_settings_page", ); $afbia_tracking = new afbia_settings_field($args); $args = array( 'id' => 'afbia_like_media', 'title' => __("Like Media", 'afb'), 'page' => 'afbia_settings_page', 'section' => 'general_settings', 'description' => __("Allow users to like the media you embedded.", 'afb'), 'type' => 'checkbox', // text, textarea, password, checkbox 'option_group' => "settings_page_afbia_settings_page", ); $afbia_tracking = new afbia_settings_field($args); $args = array( 'id' => 'afbia_comment_media', 'title' => __("Comment Media", 'afb'), 'page' => 'afbia_settings_page', 'section' => 'general_settings', 'description' => __("Allow users to comment on the media you embedded.", 'afb'), 'type' => 'checkbox', // text, textarea, password, checkbox 'option_group' => "settings_page_afbia_settings_page", ); $afbia_comment_media = new afbia_settings_field($args); } // // Register the Theme Settings Page // /** * add_theme_settings_page function. * * @access public * @return void */ public function add_theme_settings_page(){ $theme_page = add_options_page( __("Instant Articles", "afb"), __("Instant Articles", "afb"), 'switch_themes', 'afbia_settings_page', array($this, 'lh_settings_page') ); } /** * lh_settings_page function. * * @access public * @return void */ public function lh_settings_page(){ ?>

"instant_articles"), trailingslashit(get_home_url())); ?>" class="button-primary" target="_blank">

NULL, 'title' => NULL, 'page' => NULL, 'description' => NULL, ); $args = wp_parse_args( $args, $defaults ); $this->args = $args; $this->register_section(); } /** * register_section function. * * @access private * @param mixed $args * @return void */ private function register_section(){ add_settings_section( $this->args['id'], $this->args['title'], array($this, 'output_callback'), $this->args['page'] ); } /** * output_callback function. * * @access public * @return void */ public function output_callback(){ ?>

args['description'] ?>

NULL, 'title' => NULL, 'page' => NULL, 'section' => NULL, 'description' => NULL, 'type' => 'text', // text, textarea, password, checkbox 'sanitize_callback' => NULL, 'option_group' => NULL, ); $this->args = wp_parse_args( $args, $defaults ); $this->register_field(); } /** * register_field function. * * @access private * @return void */ private function register_field(){ add_settings_field( $this->args['id'], '', array($this, 'output_callback'), $this->args['page'], $this->args['section'] ); register_setting($this->args['option_group'], $this->args['id'], isset($this->args['sanatize_callback']) ? $this->args['sanatize_callback'] : NULL ); } /** * output_callback function. * * @access public * @return void */ public function output_callback(){ $t = $this->args['type']; if($t == "text"): ?>

args['description']; ?>

args['description']; ?>

args['description']; ?>

$this->args['id'], "id" => $this->args['id'], "selected" => get_option($this->args['id']), "show_option_none" => __("Not selected", 'afb'), ); wp_dropdown_categories( $args ); ?>

args['description']; ?>

args['callback'], $this->args); endif; } }