/** * Constructor. * * Register an administration breadcrumb settings field. * * @access public * * @param string $id The ID of the field. * @param string $title The title of the field. * @param string $section The name of the section. * @param array $args Additional args. */ public function __construct($id, $title, $section = '', $args = array()) { $this->set_id($id); $this->set_title($title); add_settings_field($id, $title, array($this, 'render'), Carbon_Breadcrumb_Admin_Settings::get_page_name(), $section, $args); register_setting(Carbon_Breadcrumb_Admin_Settings::get_page_name(), $id); }
/** * Customer options for the shop */ public static function declare_options() { if (WPSHOP_DEFINED_SHOP_TYPE == 'sale' && !isset($_POST['wpshop_shop_type']) || isset($_POST['wpshop_shop_type']) && $_POST['wpshop_shop_type'] != 'presentation' && !isset($_POST['old_wpshop_shop_type']) || isset($_POST['old_wpshop_shop_type']) && $_POST['old_wpshop_shop_type'] != 'presentation') { register_setting('wpshop_options', 'wpshop_cart_option', array('wps_customer_ctr', 'wpshop_options_validate_customers_newsleters')); add_settings_field('display_newsletters_subscriptions', __('Display newsletters subscriptions', 'wpshop'), array('wps_customer_ctr', 'display_newsletters_subscriptions'), 'wpshop_cart_info', 'wpshop_cart_info'); } }
/** * Register the form setting for our sunspot_options array. * * This function is attached to the admin_init action hook. * * This call to register_setting() registers a validation callback, sunspot_theme_options_validate(), * which is used when the option is saved, to ensure that our option values are complete, properly * formatted, and safe. * * We also use this function to add our theme option if it doesn't already exist. * * @since Sunspot 1.0 */ function sunspot_theme_options_init() { // If we have no options in the database, let's add them now. if ( false === sunspot_get_theme_options() ) add_option( 'sunspot_theme_options', sunspot_get_default_theme_options() ); register_setting( 'sunspot_options', // Options group, see settings_fields() call in sunspot_theme_options_render_page() 'sunspot_theme_options', // Database option, see sunspot_get_theme_options() 'sunspot_theme_options_validate' // The sanitization callback, see sunspot_theme_options_validate() ); // Register our settings field group add_settings_section( 'general', // Unique identifier for the settings section '', // Section title (we don't want one) '__return_false', // Section callback (we don't want anything) 'theme_options' // Menu slug, used to uniquely identify the page; see sunspot_theme_options_add_page() ); // Register our individual settings fields add_settings_field( 'home_layout', // Unique identifier for the field for this section __( 'How would you like to display posts on the front page?', 'sunspot' ), // Setting field label 'sunspot_settings_home_layout', // Function that renders the settings field 'theme_options', // Menu slug, used to uniquely identify the page; see sunspot_theme_options_add_page() 'general' // Settings section. Same as the first argument in the add_settings_section() above ); }
/** * Register and add settings */ public function page_init() { register_setting('my_option_group', 'my_option_name', array($this, 'sanitize')); add_settings_section('setting_section_id', 'My Custom Settings', array($this, 'print_section_info'), 'my-setting-admin'); add_settings_field('id_number', 'ID Number', array($this, 'id_number_callback'), 'my-setting-admin', 'setting_section_id'); add_settings_field('title', 'Title', array($this, 'title_callback'), 'my-setting-admin', 'setting_section_id'); }
function volcano_custom_settings() { //Sidebar Options register_setting('volcano-settings-group', 'profile_picture'); register_setting('volcano-settings-group', 'first_name'); register_setting('volcano-settings-group', 'last_name'); register_setting('volcano-settings-group', 'user_description'); register_setting('volcano-settings-group', 'twitter_handler', 'volcano_sanitize_twitter_handler'); register_setting('volcano-settings-group', 'facebook_handler'); register_setting('volcano-settings-group', 'gplus_handler'); add_settings_section('volcano-sidebar-options', 'Sidebar Option', 'volcano_sidebar_options', 'testernick_volcano'); add_settings_field('sidebar-profile-picture', 'Profile Picture', 'volcano_sidebar_profile', 'testernick_volcano', 'volcano-sidebar-options'); add_settings_field('sidebar-name', 'Full Name', 'volcano_sidebar_name', 'testernick_volcano', 'volcano-sidebar-options'); add_settings_field('sidebar-description', 'Description', 'volcano_sidebar_description', 'testernick_volcano', 'volcano-sidebar-options'); add_settings_field('sidebar-twitter', 'Twitter handler', 'volcano_sidebar_twitter', 'testernick_volcano', 'volcano-sidebar-options'); add_settings_field('sidebar-facebook', 'Facebook handler', 'volcano_sidebar_facebook', 'testernick_volcano', 'volcano-sidebar-options'); add_settings_field('sidebar-gplus', 'Google+ handler', 'volcano_sidebar_gplus', 'testernick_volcano', 'volcano-sidebar-options'); //Theme Support Options\\ ////////////////////////\\ register_setting('volcano-theme-support', 'post_formats'); register_setting('volcano-theme-support', 'custom_header'); register_setting('volcano-theme-support', 'custom_background'); add_settings_section('volcano-theme-options', 'Theme Options', 'volcano_theme_options', 'testernick_volcano_theme'); add_settings_field('post-formats', 'Post Formats', 'volcano_post_formats', 'testernick_volcano_theme', 'volcano-theme-options'); add_settings_field('custom-header', 'Custom Header', 'volcano_custom_header', 'testernick_volcano_theme', 'volcano-theme-options'); add_settings_field('custom-background', 'Custom Background', 'volcano_custom_background', 'testernick_volcano_theme', 'volcano-theme-options'); //Contact Form Options\\ ///////////////////////\\ register_setting('volcano-contact-options', 'activate_contact'); add_settings_section('volcano-contact-section', 'Contact Form', 'volcano_contact_section', 'testernick_volcano_theme_contact'); add_settings_field('activate-form', 'Activate Contact Form', 'volcano_activate_contact', 'testernick_volcano_theme_contact', 'volcano-contact-section'); }
public function register_import_section() { add_settings_section('import_settings_section', __('Import Options', 'wp-spotim'), array($this, 'import_settings_section_header'), $this->options->slug); add_settings_field('import_token', __('Your Token', 'wp-spotim'), array('SpotIM_Form_Helper', 'text_field'), $this->options->slug, 'import_settings_section', array('id' => 'import_token', 'page' => $this->options->slug, 'description' => 'Don\'t have a token? please send us an email to support@spot.im and get one.', 'value' => $this->options->get('import_token'))); add_settings_field('posts_per_request', __('Posts Per Request', 'wp-spotim'), array('SpotIM_Form_Helper', 'text_field'), $this->options->slug, 'import_settings_section', array('id' => 'posts_per_request', 'page' => $this->options->slug, 'description' => 'Amount of posts to retrieve in each request, depending on your server\'s strength.', 'value' => $this->options->get('posts_per_request'))); add_settings_field('import_button', '', array('SpotIM_Form_Helper', 'import_button'), $this->options->slug, 'import_settings_section', array('import_button' => array('id' => 'import_button', 'text' => __('Import', 'wp-spotim')), 'cancel_import_link' => array('id' => 'cancel_import_link', 'text' => __('Cancel', 'wp-spotim')))); }
/** * Plugin settings form fields. * * @return void. */ public function plugin_settings() { $option = 'wcbcf_settings'; // Set Custom Fields cection. add_settings_section('options_section', __('Checkout Custom Fields:', 'woocommerce-extra-checkout-fields-for-brazil'), array($this, 'section_options_callback'), $option); // Person Type option. add_settings_field('person_type', __('Display Person Type:', 'woocommerce-extra-checkout-fields-for-brazil'), array($this, 'select_element_callback'), $option, 'options_section', array('menu' => $option, 'id' => 'person_type', 'description' => __('Individuals enables CPF field and Legal Person enables CNPJ field.', 'woocommerce-extra-checkout-fields-for-brazil'), 'options' => array(0 => __('None', 'woocommerce-extra-checkout-fields-for-brazil'), 1 => __('Individuals and Legal Person', 'woocommerce-extra-checkout-fields-for-brazil'), 2 => __('Individuals only', 'woocommerce-extra-checkout-fields-for-brazil'), 3 => __('Legal Person only', 'woocommerce-extra-checkout-fields-for-brazil')))); // Person Type is Required option. add_settings_field('only_brazil', __('Person Type is requered only in Brazil?', 'woocommerce-extra-checkout-fields-for-brazil'), array($this, 'checkbox_element_callback'), $option, 'options_section', array('menu' => $option, 'id' => 'only_brazil', 'label' => __('If checked the Individuals and Legal Person options will be mandatory only in Brazil.', 'woocommerce-extra-checkout-fields-for-brazil'))); // RG option. add_settings_field('rg', __('Display RG:', 'woocommerce-extra-checkout-fields-for-brazil'), array($this, 'checkbox_element_callback'), $option, 'options_section', array('menu' => $option, 'id' => 'rg', 'label' => __('If checked show the RG field in billing options.', 'woocommerce-extra-checkout-fields-for-brazil'))); // State Registration option. add_settings_field('ie', __('Display State Registration:', 'woocommerce-extra-checkout-fields-for-brazil'), array($this, 'checkbox_element_callback'), $option, 'options_section', array('menu' => $option, 'id' => 'ie', 'label' => __('If checked show the State Registration field in billing options.', 'woocommerce-extra-checkout-fields-for-brazil'))); // Birthdate and Sex option. add_settings_field('birthdate_sex', __('Display Birthdate and Sex:', 'woocommerce-extra-checkout-fields-for-brazil'), array($this, 'checkbox_element_callback'), $option, 'options_section', array('menu' => $option, 'id' => 'birthdate_sex', 'label' => __('If checked show the Birthdate and Sex field in billing options.', 'woocommerce-extra-checkout-fields-for-brazil'))); // Cell Phone option. add_settings_field('cell_phone', __('Display Cell Phone:', 'woocommerce-extra-checkout-fields-for-brazil'), array($this, 'checkbox_element_callback'), $option, 'options_section', array('menu' => $option, 'id' => 'cell_phone', 'label' => __('If checked show the Cell Phone field in billing options.', 'woocommerce-extra-checkout-fields-for-brazil'))); // Set Custom Fields cection. add_settings_section('jquery_section', __('jQuery Options:', 'woocommerce-extra-checkout-fields-for-brazil'), array($this, 'section_options_callback'), $option); // Mail Check option. add_settings_field('mailcheck', __('Enable Mail Check:', 'woocommerce-extra-checkout-fields-for-brazil'), array($this, 'checkbox_element_callback'), $option, 'jquery_section', array('menu' => $option, 'id' => 'mailcheck', 'label' => __('If checked informs typos in email to users.', 'woocommerce-extra-checkout-fields-for-brazil'))); // Input Mask option. add_settings_field('maskedinput', __('Enable Input Mask:', 'woocommerce-extra-checkout-fields-for-brazil'), array($this, 'checkbox_element_callback'), $option, 'jquery_section', array('menu' => $option, 'id' => 'maskedinput', 'label' => __('If checked create masks fill for in fields of CPF, CNPJ, Birthdate, Phone and Cell Phone.', 'woocommerce-extra-checkout-fields-for-brazil'))); // Address Autocomplete option. add_settings_field('addresscomplete', __('Enable Address Autocomplete:', 'woocommerce-extra-checkout-fields-for-brazil'), array($this, 'checkbox_element_callback'), $option, 'jquery_section', array('menu' => $option, 'id' => 'addresscomplete', 'label' => __('If checked automatically complete the address fields based on the zip code.', 'woocommerce-extra-checkout-fields-for-brazil'))); // Set Custom Fields cection. add_settings_section('validation_section', __('Validation:', 'woocommerce-extra-checkout-fields-for-brazil'), array($this, 'section_options_callback'), $option); // Validate CPF option. add_settings_field('validate_cpf', __('Validate CPF:', 'woocommerce-extra-checkout-fields-for-brazil'), array($this, 'checkbox_element_callback'), $option, 'validation_section', array('menu' => $option, 'id' => 'validate_cpf', 'label' => __('Checks if the CPF is valid.', 'woocommerce-extra-checkout-fields-for-brazil'))); // Validate CPF option. add_settings_field('validate_cnpj', __('Validate CNPJ:', 'woocommerce-extra-checkout-fields-for-brazil'), array($this, 'checkbox_element_callback'), $option, 'validation_section', array('menu' => $option, 'id' => 'validate_cnpj', 'label' => __('Checks if the CNPJ is valid.', 'woocommerce-extra-checkout-fields-for-brazil'))); // Register settings. register_setting($option, $option, array($this, 'validate_options')); }
/** * Register and add settings */ public function page_init() { register_setting('asso1901_settings_group', 'asso1901-settings', array($this, 'sanitize')); add_settings_section('setting_section_id', 'Personnalisation du plugin', array($this, 'print_section_info'), 'asso1901-setting-admin'); add_settings_field('asso1901-name', 'Nom de l\'association', array($this, 'asso1901_name_callback'), 'asso1901-setting-admin', 'setting_section_id'); add_settings_field('asso1901-title', 'Title', array($this, 'asso1901_title_callback'), 'asso1901-setting-admin', 'setting_section_id'); }
function plugin_admin_init() { register_setting('require_login', 'require_login', 'plugin_options_validate'); //register_setting('require_login', 'require_login'); add_settings_section('rl_main', 'Main Options', 'rl_section_text', 'require_login'); add_settings_field('require_login', 'Enabled?', 'rl_setting_string', 'require_login', 'rl_main'); }
/** * register settings for our plugin */ function registerSettings() { //register our settings register_setting('wtb_seo_settings_main_group', 'wtb_seo_main', array($this, 'sanitize')); add_settings_section('wtb_seo_settings_main_section', __('On-Page and Post Options', 'wtb_seo'), null, 'wtb_seo_settings'); // ideal density add_settings_field('ideal_density', __('Ideal keyword density (default: 3%)', 'wtb_seo'), array($this, 'create_an_ideal_density_field'), 'wtb_seo_settings', 'wtb_seo_settings_main_section'); // ideal lenght add_settings_field('ideal_lenght', __('Ideal post lenght (default: 250)', 'wtb_seo'), array($this, 'create_an_ideal_lenght_field'), 'wtb_seo_settings', 'wtb_seo_settings_main_section'); // checkboxes to check add_settings_field('to_check', __('Parameter to check', 'wtb_seo'), array($this, 'create_to_check_fields'), 'wtb_seo_settings', 'wtb_seo_settings_main_section'); // wfd or density add_settings_field('wdf_vs_density', __('Keyword density or WDF to show', 'wtb_seo'), array($this, 'create_an_wdf_vs_density_field'), 'wtb_seo_settings', 'wtb_seo_settings_main_section'); // custom post types add_settings_section('wtb_seo_settings_cpt_section', __('Activate in custom post types', 'wtb_seo'), null, 'wtb_seo_settings'); add_settings_field('cpt', __('Custom post types', 'wtb_seo'), array($this, 'create_an_custom_post_types_fields'), 'wtb_seo_settings', 'wtb_seo_settings_cpt_section'); // woocommerce if (is_plugin_active('woocommerce/woocommerce.php')) { add_settings_section('wtb_seo_settings_woo_section', __('WooCommerce settings', 'wtb_seo'), null, 'wtb_seo_settings'); add_settings_field('check_short_description', __('Check short description', 'wtb_seo'), array($this, 'create_check_short_description'), 'wtb_seo_settings', 'wtb_seo_settings_woo_section'); } // auto refresh add_settings_section('wtb_seo_settings_ar_section', __('Auto refresh settings', 'wtb_seo'), null, 'wtb_seo_settings'); add_settings_field('disable_auto_refresh', __('Disabled', 'wtb_seo'), array($this, 'create_auto_refresh_disable'), 'wtb_seo_settings', 'wtb_seo_settings_ar_section'); add_settings_field('auto_refresh_time', __('Auto refresh after (sec.)', 'wtb_seo'), array($this, 'create_auto_refresh_time'), 'wtb_seo_settings', 'wtb_seo_settings_ar_section'); }
function my_general_section() { add_settings_section('my_settings_section', 'My Options Title', 'my_section_options_callback', 'general'); add_settings_field('address', 'Address', 'my_textbox_callback', 'general', 'my_settings_section', array('address')); add_settings_field('city', 'City', 'my_textbox_callback', 'general', 'my_settings_section', array('city')); add_settings_field('telephone1', 'Telephone1', 'my_textbox_callback', 'general', 'my_settings_section', array('telephone1')); add_settings_field('telephone2', 'Telephone2', 'my_textbox_callback', 'general', 'my_settings_section', array('telephone2')); add_settings_field('fax', 'Fax', 'my_textbox_callback', 'general', 'my_settings_section', array('fax')); add_settings_field('email', 'Email', 'my_textbox_callback', 'general', 'my_settings_section', array('email')); add_settings_field('website', 'Website', 'my_textbox_callback', 'general', 'my_settings_section', array('website')); add_settings_field('facebook', 'Facebook url', 'my_textbox_callback', 'general', 'my_settings_section', array('facebook')); add_settings_field('instagram', 'Instagram url', 'my_textbox_callback', 'general', 'my_settings_section', array('instagram')); add_settings_field('twitter', 'Twitter url', 'my_textbox_callback', 'general', 'my_settings_section', array('twitter')); add_settings_field('pinterest', 'Pinterest url', 'my_textbox_callback', 'general', 'my_settings_section', array('pinterest')); add_settings_field('phone', 'Header phone no', 'my_textbox_callback', 'general', 'my_settings_section', array('phone')); add_settings_field('map-link', 'Map URL', 'my_textbox_callback', 'general', 'my_settings_section', array('map-link')); register_setting('general', 'address', 'esc_attr'); register_setting('general', 'city', 'esc_attr'); register_setting('general', 'telephone1', 'esc_attr'); register_setting('general', 'telephone2', 'esc_attr'); register_setting('general', 'fax', 'esc_attr'); register_setting('general', 'email', 'esc_attr'); register_setting('general', 'website', 'esc_attr'); register_setting('general', 'facebook', 'esc_attr'); register_setting('general', 'instagram', 'esc_attr'); register_setting('general', 'twitter', 'esc_attr'); register_setting('general', 'pinterest', 'esc_attr'); register_setting('general', 'phone', 'esc_attr'); register_setting('general', 'map-link', 'esc_attr'); }
/** * Please consider this projecct as an assigment from new PHP & WordPress student * and forgive me for mistakes in my codes. * * This is initial commit and i am working to get this plugin on track * Contributions to this plugin is much more appreciated * because we togther can make something cool and ofcourse i will get * great things to learn from you. * * I am looking forward for your Contributions * * * *@package annOptions *@version 1.0 *@since 1.0 **/ function annframe_admin_components() { $annframe_options = annframe_opt_arr(); register_setting('ann_sections', 'annframedb_options'); //add_settings_section( 'general_settings', '', null, 'annSettings' ); foreach ($annframe_options['sections'] as $key) { add_settings_section($key['id'], $key['title'], null, 'annSettings'); } foreach ($annframe_options['settings_fields'] as $key) { switch ($key['type']) { case 'text': add_settings_field($key['id'], $key['label'], 'annframe_input_text_callback', 'annSettings', 'general_settings', $key); break; case 'textarea': add_settings_field($key['id'], $key['label'], 'annframe_allinone', $key['menu_slug'], $key['section'], $key); break; case 'upload': add_settings_field($key['id'], $key['label'], 'annframe_allinone', $key['menu_slug'], $key['section'], $key); break; case 'checkbox': add_settings_field($key['id'], $key['label'], 'annframe_allinone', $key['menu_slug'], $key['section'], $key); break; case 'radio': add_settings_field($key['id'], $key['label'], 'annframe_allinone', $key['menu_slug'], $key['section'], $key); break; case 'select': add_settings_field($key['id'], $key['label'], 'annframe_allinone', $key['menu_slug'], $key['section'], $key); break; } } }
function my_more_options() { add_settings_field('phone', 'Телефон', 'display_phone', 'general'); //'general'-где выводить. Cоздаем поле опции register_setting('general', 'my_phone'); //'my_phone' - название опции, которая будет сохраняться в БД. Регистрирует новую опцию и callback функции (функцию обратного вызова) для обработки значения опции при её сохранении в БД }
function options_page_init() { register_setting('credits-coins-options', 'credits-coins-options', array($this, 'sanitize')); add_settings_section('credits-coins-options', __('Credits Coins Options', 'credits-coins'), array($this, 'print_section_info'), 'credits-coins-options'); add_settings_field('new-user-default-credits', __('Default Credits for a new user', 'credits-coins'), array($this, 'new_user_default_credits_callback'), 'credits-coins-options', 'credits-coins-options'); add_settings_field('post-types-values', __('Post Types with Credits', 'credits-coins'), array($this, 'post_types_values_callback'), 'credits-coins-options', 'credits-coins-options'); }
function email_downloads_settings_init() { register_setting('ed', 'email_downloads_settings'); add_settings_section('email_downloads_ed_section', __('Basic Settings', 'email-downloads'), 'email_downloads_settings_section_callback', 'ed'); add_settings_field('ed_sender_email', __('Sender Email', 'email-downloads'), 'email_downloads_sender_email_render', 'ed', 'email_downloads_ed_section'); add_settings_field('ed_sender_name', __('Name of the Sender', 'email-downloads'), 'email_downloads_sender_name_render', 'ed', 'email_downloads_ed_section'); }
function register_form_flg_settings() { register_setting('form-flg-settings', 'form-flg-settings', 'validate_settings'); add_settings_section('section-one', 'FLG Setup', 'addsection_settings', 'form_flg_settings'); //FLG Key add_settings_field('settingsfield_flg_key', 'FLG API Key', 'addsettingsfield_flg_key', 'form_flg_settings', 'section-one'); }
public function setup_settings() { // General add_settings_section('bp-docs-general', __('General', 'bp-docs'), array($this, 'general_section'), 'bp-docs-settings'); // General - Docs slug add_settings_field('bp-docs-slug', __('Slug', 'bp-docs'), array($this, 'slug_setting_markup'), 'bp-docs-settings', 'bp-docs-general'); register_setting('bp-docs-settings', 'bp-docs-slug', 'rawurlencode'); // General - Excerpt length add_settings_field('bp-docs-excerpt-length', __('Directory Excerpt Length', 'bp-docs'), array($this, 'excerpt_length_setting_markup'), 'bp-docs-settings', 'bp-docs-general'); register_setting('bp-docs-settings', 'bp-docs-excerpt-length', 'absint'); // Users add_settings_section('bp-docs-users', __('Users', 'bp-docs'), array($this, 'users_section'), 'bp-docs-settings'); // Users - Tab name add_settings_field('bp-docs-user-tab-name', __('User Tab Name', 'bp-docs'), array($this, 'user_tab_name_setting_markup'), 'bp-docs-settings', 'bp-docs-users'); register_setting('bp-docs-settings', 'bp-docs-user-tab-name'); // Groups if (bp_is_active('groups')) { add_settings_section('bp-docs-groups', __('Groups', 'bp-docs'), array($this, 'groups_section'), 'bp-docs-settings'); // Groups - Tab name add_settings_field('bp-docs-tab-name', __('Group Tab Name', 'bp-docs'), array($this, 'group_tab_name_setting_markup'), 'bp-docs-settings', 'bp-docs-groups'); register_setting('bp-docs-settings', 'bp-docs-tab-name'); } // Attachments add_settings_section('bp-docs-attachments', __('Attachments', 'bp-docs'), array($this, 'attachments_section'), 'bp-docs-settings'); // Users - Tab name add_settings_field('bp-docs-enable-attachments', __('Enable Attachments', 'bp-docs'), array($this, 'enable_attachments_setting_markup'), 'bp-docs-settings', 'bp-docs-attachments'); register_setting('bp-docs-settings', 'bp-docs-enable-attachments'); }
public function register_sections() { $input = new EventList\Inputs(); add_settings_section(self::$event_section_title, self::$event_section_title, null, self::$menu_slug . self::$section_suffix); add_settings_section(self::$date_section_title, self::$date_section_title, null, self::$menu_slug . self::$section_suffix); add_settings_section(self::$price_section_title, self::$price_section_title, null, self::$menu_slug . self::$section_suffix); add_settings_section(self::$hidden_prices_section_title, self::$hidden_prices_section_title, null, self::$menu_slug . self::$section_suffix); // Add the settings fields. // Event Fields add_settings_field(self::$setting_prefix . 'show_full_description', 'Display Full Description by Default', array($input, 'show_full_description'), self::$menu_slug . self::$section_suffix, self::$event_section_title); add_settings_field(self::$setting_prefix . 'show_location_after_description', 'Display Location After Description', array($input, 'show_location_after_description'), self::$menu_slug . self::$section_suffix, self::$event_section_title); add_settings_field(self::$setting_prefix . 'sort_events', 'Sort Events', array($input, 'sort_events'), self::$menu_slug . self::$section_suffix, self::$event_section_title); // Date Fields add_settings_field(self::$setting_prefix . 'show_dates', 'Display Dates', array($input, 'show_dates'), self::$menu_slug . self::$section_suffix, self::$date_section_title); add_settings_field(self::$setting_prefix . 'show_past_dates', 'Display Past Dates', array($input, 'show_past_dates'), self::$menu_slug . self::$section_suffix, self::$date_section_title); add_settings_field(self::$setting_prefix . 'show_end_time', 'Display Event End Time', array($input, 'show_end_time'), self::$menu_slug . self::$section_suffix, self::$date_section_title); add_settings_field(self::$setting_prefix . 'show_sold_out_dates', 'Display Sold Out Dates', array($input, 'show_sold_out_dates'), self::$menu_slug . self::$section_suffix, self::$date_section_title); add_settings_field(self::$setting_prefix . 'date_format', 'Date Format', array($input, 'date_format'), self::$menu_slug . self::$section_suffix, self::$date_section_title); add_settings_field(self::$setting_prefix . 'time_format', 'Time Format', array($input, 'time_format'), self::$menu_slug . self::$section_suffix, self::$date_section_title); // Price Fields add_settings_field(self::$setting_prefix . 'show_prices', 'Display Prices', array($input, 'show_prices'), self::$menu_slug . self::$section_suffix, self::$price_section_title); add_settings_field(self::$setting_prefix . 'show_sold_out_prices', 'Display Sold Out Prices', array($input, 'show_sold_out_prices'), self::$menu_slug . self::$section_suffix, self::$price_section_title); add_settings_field(self::$setting_prefix . 'shipping_methods', 'Shipping Methods', array($input, 'shipping_methods'), self::$menu_slug . self::$section_suffix, self::$price_section_title); add_settings_field(self::$setting_prefix . 'shipping_countries', 'Default Shipping Country', array($input, 'shipping_countries'), self::$menu_slug . self::$section_suffix, self::$price_section_title); add_settings_field(self::$setting_prefix . 'currency', 'Currency', array($input, 'currency'), self::$menu_slug . self::$section_suffix, self::$price_section_title); add_settings_field(self::$setting_prefix . 'price_sort', 'Price Sort', array($input, 'price_sort'), self::$menu_slug . self::$section_suffix, self::$price_section_title); add_settings_field(self::$setting_prefix . 'include_service_fee', 'Include Service Fee', array($input, 'include_service_fee'), self::$menu_slug . self::$section_suffix, self::$price_section_title); add_settings_field(self::$setting_prefix . 'hidden_prices', 'Hidden Prices', array($input, 'hidden_prices'), self::$menu_slug . self::$section_suffix, self::$hidden_prices_section_title); }
/** * Register settings. */ public function register_settings() { add_settings_section('ib_educator_learning_settings', __('Learning', 'ibeducator'), array($this, 'section_description'), 'ib_educator_learning_page'); // Setting: add_settings_field('edu_lesson_comments', __('Enable comments on lessons', 'ibeducator'), array($this, 'setting_checkbox'), 'ib_educator_learning_page', 'ib_educator_learning_settings', array('name' => 'lesson_comments', 'settings_group' => 'ib_educator_learning', 'default' => 0, 'id' => 'edu_lesson_comments')); register_setting('ib_educator_learning_settings', 'ib_educator_learning', array($this, 'validate')); }
function register_settings() { add_settings_section('agm_google_maps_facebook', __('Nearby Facebook Friends', 'agm_google_maps'), create_function('', ''), 'agm_google_maps_options_page'); add_settings_field('agm_google_maps_fbnf_fb', __('Facebook App', 'agm_google_maps'), array($this, 'create_fb_app_box'), 'agm_google_maps_options_page', 'agm_google_maps_facebook'); add_settings_field('agm_google_maps_fbnf_scope', __('Scope', 'agm_google_maps'), array($this, 'create_scope_box'), 'agm_google_maps_options_page', 'agm_google_maps_facebook'); $this->_add_help(); }
function admin_init() { global $pagenow; // error handling if ($pagenow == 'post.php') { // get errors $this->errors = get_option($this->transient_key); // if errors unset the 'published' message if ($this->errors && isset($_GET['message']) && $_GET['message'] == 6) { unset($_GET['message']); } } add_settings_section('required_fields', __('Required fields'), array($this, 'section'), 'writing'); $fields = apply_filters('required_fields', array('post_title' => array('title' => __('Title'), 'setting_cb' => 'intval', 'setting_field' => array('required_fields', 'checkbox_field'), 'message' => '', 'validation_cb' => false, 'post_types' => 'any'), 'post_content' => array('title' => __('Content'), 'setting_cb' => 'intval', 'setting_field' => array('required_fields', 'checkbox_field'), 'message' => '', 'validation_cb' => false, 'post_types' => 'any'), 'post_excerpt' => array('title' => __('Excerpt'), 'setting_cb' => 'intval', 'setting_field' => array('required_fields', 'checkbox_field'), 'message' => '', 'validation_cb' => false, 'post_types' => 'post'), 'category' => array('title' => __('Category'), 'setting_cb' => 'intval', 'setting_field' => array('required_fields', 'checkbox_field'), 'message' => __('You must choose a category other than the default.'), 'validation_cb' => array('required_fields', '_has_category'), 'post_types' => 'post'))); foreach ($fields as $name => $field) { $field_name = "require_{$name}"; $field_value = get_option($field_name); add_settings_field($field_name, $field['title'], $field['setting_field'], 'writing', 'required_fields', array('name' => $field_name, 'value' => $field_value)); register_setting('writing', $field_name, $field['setting_cb']); // if the setting validation returns true register the field as required if (call_user_func($field['setting_cb'], $field_value)) { $this->register($field['title'], $name, $field['message'], $field['validation_cb'], $field['post_types']); } } }
public static function register_mysettings() { register_setting('evaluate_options', self::$allow_anonymous); add_settings_section('evaluate_general', "General", array(__CLASS__, 'render_general'), self::$page_slug); add_settings_field(self::$allow_anonymous, "Allow Anonymous Users to Vote", array(__CLASS__, 'render_general_allow_anonymous'), self::$page_slug, 'evaluate_general'); add_settings_field(self::$disable_stylesheet, "Disable the default stylesheet", array(__CLASS__, 'render_general_disable_stylesheet'), self::$page_slug, 'evaluate_general'); }
public function register_settings() { add_settings_section('pronamic_cookie_options_advanced', __('Cookie Settings', 'pronamic-cookies'), array($this, 'settings_section'), 'pronamic_cookie_options_advanced_page'); add_settings_field('pronamic_cookie_options_advanced_path', __('Path', 'pronamic-cookies'), array($this, 'text'), 'pronamic_cookie_options_advanced_page', 'pronamic_cookie_options_advanced', array('label_for' => 'pronamic_cookie_options_advanced_path')); add_settings_field('pronamic_cookie_options_advanced_expires', __('Expires', 'pronamic-cookies'), array($this, 'text'), 'pronamic_cookie_options_advanced_page', 'pronamic_cookie_options_advanced', array('label_for' => 'pronamic_cookie_options_advanced_expires', 'description' => __('Use a string that would go in <a href="http://php.net/manual/en/function.strtotime.php">strtotime</a>', 'pronamic-cookies'))); register_setting('pronamic_cookie_options_advanced', 'pronamic_cookie_options_advanced_path'); register_setting('pronamic_cookie_options_advanced', 'pronamic_cookie_options_advanced_expires'); // Base Settings add_settings_section('pronamic_cookie_options', __('Bar', 'pronamic-cookies'), array($this, 'settings_section'), 'pronamic_cookie_options_page'); add_settings_field('pronamic_cookie_base_active', __('Active?', 'pronamic-cookies'), array($this, 'select'), 'pronamic_cookie_options_page', 'pronamic_cookie_options', array('label_for' => 'pronamic_cookie_base_active', 'options' => array(array('label_for' => __('Yes', 'pronamic-cookies'), 'value' => 1), array('label_for' => __('No', 'pronamic-cookies'), 'value' => 0)))); add_settings_field('pronamic_cookie_location', __('Location', 'pronamic-cookies'), array($this, 'select'), 'pronamic_cookie_options_page', 'pronamic_cookie_options', array('label_for' => 'pronamic_cookie_location', 'options' => array(array('label_for' => __('Top', 'pronamic-cookies'), 'value' => 'top'), array('label_for' => __('Bottom', 'pronamic-cookies'), 'value' => 'bottom')))); add_settings_field('pronamic_cookie_text', __('Text', 'pronamic-cookies'), array($this, 'text'), 'pronamic_cookie_options_page', 'pronamic_cookie_options', array('label_for' => 'pronamic_cookie_text')); add_settings_field('pronamic_cookie_link', __('Link', 'pronamic-cookies'), array($this, 'text'), 'pronamic_cookie_options_page', 'pronamic_cookie_options', array('label_for' => 'pronamic_cookie_link')); register_setting('pronamic_cookie_options', 'pronamic_cookie_base_active'); register_setting('pronamic_cookie_options', 'pronamic_cookie_location'); register_setting('pronamic_cookie_options', 'pronamic_cookie_text'); register_setting('pronamic_cookie_options', 'pronamic_cookie_link', array($this, 'verifiy_url')); // Blocker Settings add_settings_section('pronamic_cookie_blocker_options', __('Wall', 'pronamic-cookies'), array($this, 'settings_section'), 'pronamic_cookie_options_page'); add_settings_field('pronamic_cookie_blocker_active', __('Active?', 'pronamic-cookies'), array($this, 'select'), 'pronamic_cookie_options_page', 'pronamic_cookie_blocker_options', array('label_for' => 'pronamic_cookie_blocker_active', 'options' => array(array('label_for' => __('Yes', 'pronamic-cookies'), 'value' => 1), array('label_for' => __('No', 'pronamic-cookies'), 'value' => 0)))); add_settings_field('pronamic_cookie_blocker_title', __('Title', 'pronamic-cookies'), array($this, 'text'), 'pronamic_cookie_options_page', 'pronamic_cookie_blocker_options', array('label_for' => 'pronamic_cookie_blocker_title')); add_settings_field('pronamic_cookie_blocker_text', __('Text', 'pronamic-cookies'), array($this, 'editor'), 'pronamic_cookie_options_page', 'pronamic_cookie_blocker_options', array('label_for' => 'pronamic_cookie_blocker_text')); add_settings_field('pronamic_cookie_blocker_show_link', __('Show link?', 'pronamic-cookies'), array($this, 'select'), 'pronamic_cookie_options_page', 'pronamic_cookie_blocker_options', array('label_for' => 'pronamic_cookie_blocker_show_link', 'options' => array(array('label_for' => __('Yes', 'pronamic-cookies'), 'value' => 1), array('label_for' => __('No', 'pronamic-cookies'), 'value' => 0)))); add_settings_field('pronamic_cookie_blocker_image', __('Background Image', 'pronamic-cookies'), array($this, 'uploader'), 'pronamic_cookie_options_page', 'pronamic_cookie_blocker_options', array('label_for' => 'pronamic_cookie_blocker_image')); add_settings_field('pronamic_cookie_blocker_bgcolor', __('Background Color', 'pronamic-cookies'), array($this, 'colorpicker'), 'pronamic_cookie_options_page', 'pronamic_cookie_blocker_options', array('label_for' => 'pronamic_cookie_blocker_bgcolor')); register_setting('pronamic_cookie_options', 'pronamic_cookie_blocker_active'); register_setting('pronamic_cookie_options', 'pronamic_cookie_blocker_title'); register_setting('pronamic_cookie_options', 'pronamic_cookie_blocker_text'); register_setting('pronamic_cookie_options', 'pronamic_cookie_blocker_show_link'); register_setting('pronamic_cookie_options', 'pronamic_cookie_blocker_image'); register_setting('pronamic_cookie_options', 'pronamic_cookie_blocker_bgcolor'); }
function simple_JPEG_quality_register() { register_setting('media', 'simple-JPEG-settings', 'simple_JPEG_validate'); add_settings_section('simple-JPEG-quality-settings', 'JPEG Resizing', 'show_simple_JPEG_quality_settings', 'media'); add_settings_field('simple-JPEG-quality', 'JPEG Quality', 'show_simple_JPEG_quality', 'media', 'simple-JPEG-quality-settings'); add_settings_field('simple-JPEG-override', 'Allow unusual JPEG quality value?', 'show_simple_JPEG_override', 'media', 'simple-JPEG-quality-settings'); }
public function progress_on_scroll_page_init() { register_setting('progress_on_scroll_option_group', 'progress_on_scroll_option_name', array($this, 'progress_on_scroll_sanitize')); add_settings_section('progress_on_scroll_setting_section', 'Settings', array($this, 'progress_on_scroll_section_info'), 'progress-on-scroll-admin'); add_settings_field('fill_0', 'Fill', array($this, 'fill_0_callback'), 'progress-on-scroll-admin', 'progress_on_scroll_setting_section'); add_settings_field('empty_1', 'empty', array($this, 'empty_1_callback'), 'progress-on-scroll-admin', 'progress_on_scroll_setting_section'); }
public function page_init() { global $klikbayi_settings, $klikbayi_sanitize; $this->options = $klikbayi_settings; $this->groups = $this->mb_group(); $this->default_setting = klikbayi_default_setting('reset'); $this->url = klikbayi_url('url'); $this->domain = klikbayi_url('domain'); $this->blog = klikbayi_blog(); $this->validate = $klikbayi_sanitize; $this->type = $this->validate->type_array(); $this->style = $this->validate->style_array(); $this->plugin_data = get_plugin_data(KLIKBAYI_PLUGIN_PATH . '/klikbayi.php'); register_setting('option_klikbayi', 'klikbayi_option', array($this, 'sanitize')); foreach ($this->groups as $t => $arr) { add_settings_section('setting_section_' . $t, '', array($this, 'print_section_info_' . $t), 'klikbayi_option_' . $t); add_meta_box('meta-box-' . $t, __($arr[0], 'klikbayi'), array($this, 'box_' . $t), 'klikbayi_option_' . $t, 'normal', 'high'); foreach ($arr[1] as $k => $v) { if ('shortcode' == $k || 'sidebar' == $k) { continue; } add_settings_field($k, __($v, 'klikbayi'), array($this, $k . '_cb'), 'klikbayi_option_' . $t, 'setting_section_' . $t); } } }
/** * Adds Gravatar Hovercard setting * * @todo - always print HTML, hide via CSS/JS if !show_avatars */ function grofiles_add_settings() { if ( !get_option( 'show_avatars' ) ) return; add_settings_field( 'gravatar_disable_hovercards', __( 'Gravatar Hovercards', 'jetpack' ), 'grofiles_setting_callback', 'discussion', 'avatars' ); register_setting( 'discussion', 'gravatar_disable_hovercards', 'grofiles_hovercard_option_sanitize' ); }
public function settings_init() { register_setting('pluginPage', 'insertagram_settings'); add_settings_section('insertagram_pluginPage_section', __('', 'insertagram'), false, 'pluginPage'); add_settings_field('insertagram_text_instagram_user_id', __('User ID', 'insertagram'), array($this, 'text_instagram_user_id_render'), 'pluginPage', 'insertagram_pluginPage_section'); add_settings_field('insertagram_text_instagram_api_token', __('Access Token', 'insertagram'), array($this, 'text_instagram_api_token_render'), 'pluginPage', 'insertagram_pluginPage_section'); }
function content_page() { // signale à worpdress de créer l'entrée dans la bdd (table options) register_setting('admin-type-settings', 'admin-type-option', 'admin_type_callback'); // ------------------------------ // création d'une section // ------------------------------ add_settings_section('classics-fieds-section', 'Champs types', 'classics_fields_help', 'admin-type'); // création d'un input text add_settings_field('input-text', 'Input type text', 'display_input_text', 'admin-type', 'classics-fieds-section', array('label_for' => 'input-text', 'option-name' => 'admin-type-option')); // création d'un input checkbox add_settings_field('input-checkbox', 'Input type checkbox', 'display_input_checkbox', 'admin-type', 'classics-fieds-section', array('label_for' => 'input-checkbox', 'value' => '1', 'option-name' => 'admin-type-option')); // création d'un select add_settings_field('select', 'Select', 'display_select_element', 'admin-type', 'classics-fieds-section', array('label_for' => 'select', 'values' => array('Option 1' => 'option_1', 'Option 2' => 'option_2', 'Option 3' => 'option_3'), 'option-name' => 'admin-type-option')); // création d'un textarea add_settings_field('textarea-simple', 'Textarea', 'display_textarea_simple', 'admin-type', 'classics-fieds-section', array('label_for' => 'textarea-simple', 'option-name' => 'admin-type-option')); // ------------------------------ // création d'une section // ------------------------------ add_settings_section('other-fields-section', 'Champs spéciaux', 'other_fields_help', 'admin-type'); // création d'un WYSIWYG add_settings_field('wysiwyg', 'WYSIWYG', 'display_wysiwyg', 'admin-type', 'other-fields-section', array('wysiwyg-name' => 'wysiwyg', 'option-name' => 'admin-type-option')); // création d'un input type file add_settings_field('input-file', 'Input type file', 'display_input_file', 'admin-type', 'other-fields-section', array('label_for' => 'input-file', 'option-name' => 'admin-type-option')); }
function register_advanced_settings() { $this->plugin_settings_tabs[$this->advanced_settings_key] = 'Settings'; register_setting($this->advanced_settings_key, $this->advanced_settings_key); add_settings_section('section_advanced', 'Advanced Plugin Settings', array(&$this, 'section_advanced_desc'), $this->advanced_settings_key); add_settings_field('advanced_option', 'An Advanced Option', array(&$this, 'field_advanced_option'), $this->advanced_settings_key, 'section_advanced'); }