"facebook_settings", 'icon' => "facebook-square", 'title' => __("Facebook", 'allfacebook-instant-articles'), 'page' => "afbia_settings_page", 'description' => __("Settings that require input from Facebook.", 'allfacebook-instant-articles'), ); $facebook_settings = new afbia_settings_section($args); $args = array( 'id' => 'afbia_page_id', 'title' => __("Page ID", 'allfacebook-instant-articles'), 'page' => 'afbia_settings_page', 'section' => 'facebook_settings', 'description' => __("The page ID of the facebook page you want to add Instant Articles to.", 'allfacebook-instant-articles'), 'type' => 'text', // text, textarea, password, checkbox 'option_group' => "settings_page_afbia_settings_page", ); $afbia_page_id = new afbia_settings_field($args); // // Feed Settings // $args = array( 'id' => "feed_settings", 'icon' => "feed", 'title' => __("Feed", 'allfacebook-instant-articles'), 'page' => "afbia_settings_page", 'description' => __("Settings that modify parts of the Instant Articles feed.", 'allfacebook-instant-articles'), ); $facebook_settings = new afbia_settings_section($args); $args = array( 'id' => 'afbia_copyright', 'title' => __("Copyright", 'allfacebook-instant-articles'), 'page' => 'afbia_settings_page', 'section' => 'feed_settings', 'description' => __("The standard copyright details for your instant articles.", 'allfacebook-instant-articles'), '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", 'allfacebook-instant-articles'), 'page' => 'afbia_settings_page', 'section' => 'feed_settings', 'description' => __("The tracking code, that will be embedded in your instant articles. See this link for more information.", 'allfacebook-instant-articles'), '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", 'allfacebook-instant-articles'), 'page' => 'afbia_settings_page', 'section' => 'feed_settings', 'description' => __("Allow users to like the media you embedded.", 'allfacebook-instant-articles'), '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", 'allfacebook-instant-articles'), 'page' => 'afbia_settings_page', 'section' => 'feed_settings', 'description' => __("Allow users to comment on the media you embedded.", 'allfacebook-instant-articles'), 'type' => 'checkbox', // text, textarea, password, checkbox 'option_group' => "settings_page_afbia_settings_page", ); $afbia_comment_media = new afbia_settings_field($args); $args = array( 'id' => 'afbia_articles_num', 'title' => __("Number of Articles", 'allfacebook-instant-articles'), 'page' => 'afbia_settings_page', 'section' => 'feed_settings', 'description' => __("The number of articles, that will be rendered on the feed.", 'allfacebook-instant-articles'), 'type' => 'text', // text, textarea, password, checkbox 'option_group' => "settings_page_afbia_settings_page", ); $afbia_comment_media = new afbia_settings_field($args); $args = array( 'id' => 'afbia_articles_style', 'title' => __("Style of Articles", 'allfacebook-instant-articles'), 'page' => 'afbia_settings_page', 'section' => 'feed_settings', 'description' => __("Style for articles if different from default", 'allfacebook-instant-articles'), 'type' => 'text', // text, textarea, password, checkbox 'option_group' => "settings_page_afbia_settings_page", ); $afbia_comment_media = new afbia_settings_field($args); // // Ad Settings // $args = array( 'id' => "afbia_ad_settings", 'icon' => "money", 'title' => __("Ads", 'allfacebook-instant-articles'), 'page' => "afbia_settings_page", 'description' => __("Facebook Audience Network for Instant Articles - BETA - More Information", 'allfacebook-instant-articles'), ); $facebook_settings = new afbia_settings_section($args); $args = array( 'id' => 'afbia_audience_active', 'title' => __("Audience Network", 'allfacebook-instant-articles'), 'page' => 'afbia_settings_page', 'section' => 'afbia_ad_settings', 'description' => __("Activate Audience Network for Instant Articles.", 'allfacebook-instant-articles'), 'type' => 'checkbox', // text, textarea, password, checkbox 'option_group' => "settings_page_afbia_settings_page", ); $afbia_comment_media = new afbia_settings_field($args); $args = array( 'id' => 'afbia_audienceplacement_1', 'title' => __("Placement ID 1", 'allfacebook-instant-articles'), 'page' => 'afbia_settings_page', 'section' => 'afbia_ad_settings', 'description' => __("Audience Network Placement ID 1", 'allfacebook-instant-articles'), 'type' => 'text', // text, textarea, password, checkbox 'option_group' => "settings_page_afbia_settings_page", ); $afbia_comment_media = new afbia_settings_field($args); $args = array( 'id' => 'afbia_audienceplacement_2', 'title' => __("Placement ID 2", 'allfacebook-instant-articles'), 'page' => 'afbia_settings_page', 'section' => 'afbia_ad_settings', 'description' => __("Audience Network Placement ID 2", 'allfacebook-instant-articles'), 'type' => 'text', // text, textarea, password, checkbox 'option_group' => "settings_page_afbia_settings_page", ); $afbia_comment_media = new afbia_settings_field($args); $args = array( 'id' => 'afbia_audienceplacement_3', 'title' => __("Placement ID 3", 'allfacebook-instant-articles'), 'page' => 'afbia_settings_page', 'section' => 'afbia_ad_settings', 'description' => __("Audience Network Placement ID 3", 'allfacebook-instant-articles'), 'type' => 'text', // text, textarea, password, checkbox 'option_group' => "settings_page_afbia_settings_page", ); $afbia_comment_media = new afbia_settings_field($args); // // Help Page // /* $args = array( 'id' => "help_page", 'icon' => "question-circle", 'title' => __("Help", 'allfacebook-instant-articles'), 'page' => "afbia_settings_page", 'description' => __("One day this will be a proper help page.", 'allfacebook-instant-articles'), ); $help_page = new afbia_settings_section($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", 'allfacebook-instant-articles'), __("Instant Articles", 'allfacebook-instant-articles'), 'switch_themes', 'afbia_settings_page', array($this, 'lh_settings_page_v2') ); } /** * lh_settings_page function. * * @access public * @return void */ public function lh_settings_page(){ ?>
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['callback'], $this->args); endif; } }