Esempio n. 1
0
<?php

$options = array('parent_slug' => 'options-general.php', 'page_title' => __('Notab Option Page', 'text_domain'), 'menu_title' => __('Notab Option Page', 'text_domain'), 'capability' => 'manage_options', 'menu_slug' => 'menu_slug_page', 'option_name' => 'notab_options');
$options['fields'][] = ['id' => 'text', 'type' => 'text', 'name' => __('Text Example', 'text_domain'), 'desc' => __('Description for text', 'text_domain'), 'std' => __('Default Value', 'text_domain')];
$options['fields'][] = ['id' => 'email', 'type' => 'email', 'name' => __('Email Example', 'text_domain'), 'desc' => __('Description for email', 'text_domain'), 'std' => get_option('admin_email')];
$options['fields'][] = ['id' => 'url', 'type' => 'url', 'name' => __('URL Example', 'text_domain'), 'desc' => __('Description for url', 'text_domain'), 'std' => site_url()];
$options['fields'][] = ['id' => 'number', 'type' => 'number', 'name' => __('Number Example', 'text_domain'), 'desc' => '', 'std' => 123456789];
$options['fields'][] = ['id' => 'checkbox', 'type' => 'checkbox', 'name' => __('Checkbox Example', 'text_domain'), 'std' => 1];
$options['fields'][] = ['id' => 'multicheck', 'type' => 'multicheck', 'name' => __('Multi Checkbox Example', 'text_domain'), 'std' => array('choice_one', 'choice_two', 'choice_four'), 'options' => array('choice_one' => 'Choice One', 'choice_two' => 'Choice Two', 'choice_three' => 'Choice Three', 'choice_four' => 'Choice Four')];
$options['fields'][] = ['id' => 'color', 'type' => 'color', 'name' => __('Color Picker Example', 'text_domain'), 'std' => '#ffffff'];
$options['fields'][] = ['id' => 'date', 'type' => 'date', 'name' => __('Date Picker Example', 'text_domain'), 'std' => date("m/d/Y", time())];
$options['fields'][] = ['id' => 'radio', 'type' => 'radio', 'name' => __('Radio Example', 'text_domain'), 'std' => 'choice_two', 'options' => array('choice_one' => 'Choice One', 'choice_two' => 'Choice Two', 'choice_three' => 'Choice Three', 'choice_four' => 'Choice Four')];
$options['fields'][] = ['id' => 'select', 'type' => 'select', 'name' => __('Select Example', 'text_domain'), 'std' => 'choice_three', 'options' => array('choice_one' => 'Choice One', 'choice_two' => 'Choice Two', 'choice_three' => 'Choice Three', 'choice_four' => 'Choice Four')];
$options['fields'][] = ['id' => 'textarea', 'type' => 'textarea', 'name' => __('Textarea Example', 'text_domain'), 'desc' => __('This textarea does not declare any validation method. You cannot add any HTML tag here.', 'text_domain'), 'std' => __('Default Value', 'text_domain')];
$options['fields'][] = ['id' => 'textarea2', 'type' => 'textarea', 'name' => __('Textarea Example', 'text_domain'), 'desc' => __('This textarea declare a validation method "inlinehtml". It can content inline HTML tags like a, img, span', 'text_domain'), 'validate' => 'inlinehtml'];
$options['fields'][] = ['id' => 'wp_editor', 'type' => 'wp_editor', 'name' => __('Editor Example', 'text_domain'), 'desc' => __('This textarea declare a validation method "inlinehtml". It can content inline HTML tags like a, img, span', 'text_domain'), 'validate' => 'wp_editor'];
$options['fields'][] = ['id' => 'file', 'type' => 'file', 'name' => __('File Uplode Example', 'text_domain'), 'btn_browse' => __('Browse File', 'text_domain'), 'btn_insert' => __('Insert Into Page', 'text_domain'), 'multiple' => true];
$option_page = new \Generators\OptionPage();
$option_page->create($options);
 public function create_option_page()
 {
     $optionPage = array('parent_slug' => 'options-general.php', 'page_title' => __('Login Form', 'text_domain'), 'menu_title' => __('Login Form', 'text_domain'), 'capability' => 'manage_options', 'menu_slug' => 'wp_login_form', 'option_name' => 'wp_login_form_options', 'fields' => array(array('id' => 'loginPageLogo', 'type' => 'file', 'name' => __('Login Page Logo', 'text_domain'), 'btn_browse' => __('Browse File', 'text_domain'), 'btn_insert' => __('Insert Into Page', 'text_domain')), array('id' => 'logHeight', 'type' => 'text', 'name' => __('Logo Height', 'text_domain'), 'std' => __('80px', 'text_domain')), array('id' => 'logoWidth', 'type' => 'text', 'name' => __('Logo Width', 'text_domain'), 'std' => __('80px', 'text_domain')), array('id' => 'bgImage', 'type' => 'file', 'name' => __('Background Image', 'text_domain'), 'btn_browse' => __('Browse File', 'text_domain'), 'btn_insert' => __('Insert Into Page', 'text_domain')), array('id' => 'bgColor', 'type' => 'color', 'name' => __('Background Color', 'text_domain'), 'std' => '#f1f1f1'), array('id' => 'loginMessage', 'type' => 'textarea', 'name' => __('Login Message', 'text_domain'), 'desc' => __('The message will be displayed on the WordPress Log In page above the Log In form.', 'text_domain')), array('id' => 'linkColor', 'type' => 'color', 'name' => __('Link Color', 'text_domain'), 'std' => '#f1f1f1', 'desc' => __('Choose color for "Back to Plugins" and "Lost your password?" link.', 'text_domain')), array('id' => 'backToPlugins', 'type' => 'checkbox', 'name' => __('Show Back to Plugins link', 'text_domain'), 'std' => 1, 'desc' => __('Check to show "← Back to Plugins" link on login page. Uncheck to hide from login page.', 'text_domain')), array('id' => 'lostPassword', 'type' => 'checkbox', 'name' => __('Show Lost password link', 'text_domain'), 'std' => 1, 'desc' => __('Check to show "Lost your password?" link on login page. Uncheck to hide from login page.', 'text_domain'))));
     $option_page = new \Generators\OptionPage();
     $option_page->create($optionPage);
     $this->get_options = $option_page->get_options();
 }
Esempio n. 3
0
<?php

$create_notab_option_page = array('parent_slug' => 'options-general.php', 'page_title' => __('Notab Option Page', 'text_domain'), 'menu_title' => __('Notab Option Page', 'text_domain'), 'capability' => 'manage_options', 'menu_slug' => 'menu_slug_page', 'option_name' => 'notab_options', 'fields' => array(array('id' => 'text', 'type' => 'text', 'name' => __('Text Example', 'text_domain'), 'desc' => __('Description for text', 'text_domain'), 'std' => __('Default Value', 'text_domain')), array('id' => 'email', 'type' => 'email', 'name' => __('Email Example', 'text_domain'), 'desc' => __('Description for email', 'text_domain'), 'std' => get_option('admin_email')), array('id' => 'url', 'type' => 'url', 'name' => __('URL Example', 'text_domain'), 'desc' => __('Description for url', 'text_domain'), 'std' => site_url()), array('id' => 'number', 'type' => 'number', 'name' => __('Number Example', 'text_domain'), 'desc' => '', 'std' => 123456789), array('id' => 'checkbox', 'type' => 'checkbox', 'name' => __('Checkbox Example', 'text_domain'), 'std' => 1), array('id' => 'multicheck', 'type' => 'multicheck', 'name' => __('Multi Checkbox Example', 'text_domain'), 'std' => array('choice_one', 'choice_two', 'choice_four'), 'options' => array('choice_one' => 'Choice One', 'choice_two' => 'Choice Two', 'choice_three' => 'Choice Three', 'choice_four' => 'Choice Four')), array('id' => 'color', 'type' => 'color', 'name' => __('Color Picker Example', 'text_domain'), 'std' => '#ffffff'), array('id' => 'date', 'type' => 'date', 'name' => __('Date Picker Example', 'text_domain'), 'std' => date("m/d/Y", time())), array('id' => 'radio', 'type' => 'radio', 'name' => __('Radio Example', 'text_domain'), 'std' => 'choice_two', 'options' => array('choice_one' => 'Choice One', 'choice_two' => 'Choice Two', 'choice_three' => 'Choice Three', 'choice_four' => 'Choice Four')), array('id' => 'select', 'type' => 'select', 'name' => __('Select Example', 'text_domain'), 'std' => 'choice_three', 'options' => array('choice_one' => 'Choice One', 'choice_two' => 'Choice Two', 'choice_three' => 'Choice Three', 'choice_four' => 'Choice Four')), array('id' => 'textarea', 'type' => 'textarea', 'name' => __('Textarea Example', 'text_domain'), 'desc' => __('This textarea does not declare any validation method. You cannot add any HTML tag here.', 'text_domain'), 'std' => __('Default Value', 'text_domain')), array('id' => 'textarea2', 'type' => 'textarea', 'name' => __('Textarea Example', 'text_domain'), 'desc' => __('This textarea declare a validation method "inlinehtml". It can content inline HTML tags like a, img, span', 'text_domain'), 'validate' => 'inlinehtml'), array('id' => 'wp_editor', 'type' => 'wp_editor', 'name' => __('Editor Example', 'text_domain'), 'desc' => __('This textarea declare a validation method "inlinehtml". It can content inline HTML tags like a, img, span', 'text_domain'), 'validate' => 'wp_editor'), array('id' => 'file', 'type' => 'file', 'name' => __('File Uplode Example', 'text_domain'), 'btn_browse' => __('Browse File', 'text_domain'), 'btn_insert' => __('Insert Into Page', 'text_domain'), 'multiple' => true)));
$option_page = new \Generators\OptionPage();
$option_page->create($create_notab_option_page);
Esempio n. 4
0
<?php

$create_multitabs_option_page = array('parent_slug' => 'options-general.php', 'page_title' => __('Multitab Option Page', 'text_domain'), 'menu_title' => __('Multitab Option Page', 'text_domain'), 'capability' => 'manage_options', 'menu_slug' => 'multitabs_menu', 'option_name' => 'multitabs_options', 'tabs' => array('general' => array('name' => __('General'), 'fields' => array(array('id' => 'text', 'type' => 'text', 'name' => __('Text Example', 'text_domain'), 'desc' => __('Description for text', 'text_domain'), 'std' => __('Default Value', 'text_domain')), array('id' => 'email', 'type' => 'email', 'name' => __('Email Example', 'text_domain'), 'desc' => __('Description for email', 'text_domain'), 'std' => get_option('admin_email')), array('id' => 'url', 'type' => 'url', 'name' => __('URL Example', 'text_domain'), 'desc' => __('Description for url', 'text_domain'), 'std' => site_url()), array('id' => 'number', 'type' => 'number', 'name' => __('Number Example', 'text_domain'), 'desc' => '', 'std' => 123456789))), 'color_date' => array('name' => __('Color & Date'), 'fields' => array(array('id' => 'color', 'type' => 'color', 'name' => __('Color Picker Example', 'text_domain'), 'std' => '#ffffff'), array('id' => 'date', 'type' => 'date', 'name' => __('Date Picker Example', 'text_domain'), 'std' => date("m/d/Y", time())))), 'radio_select' => array('name' => __('Radio & Select'), 'fields' => array(array('id' => 'radio', 'type' => 'radio', 'name' => __('Radio Example', 'text_domain'), 'std' => 'choice_two', 'options' => array('choice_one' => 'Choice One', 'choice_two' => 'Choice Two', 'choice_three' => 'Choice Three', 'choice_four' => 'Choice Four')), array('id' => 'select', 'type' => 'select', 'name' => __('Select Example', 'text_domain'), 'std' => 'choice_three', 'options' => array('choice_one' => 'Choice One', 'choice_two' => 'Choice Two', 'choice_three' => 'Choice Three', 'choice_four' => 'Choice Four')))), 'textarea' => array('name' => __('Textarea'), 'fields' => array(array('id' => 'textarea', 'type' => 'textarea', 'name' => __('Textarea Example', 'text_domain'), 'desc' => __('This textarea does not declare any validation method. You cannot add any HTML tag here.', 'text_domain'), 'std' => __('Default Value', 'text_domain')), array('id' => 'textarea2', 'type' => 'textarea', 'name' => __('Textarea Example', 'text_domain'), 'desc' => __('This textarea declare a validation method "inlinehtml". It can content inline HTML tags like a, img, span', 'text_domain'), 'validate' => 'inlinehtml'))), 'file_uploader' => array('name' => __('File Uploder'), 'fields' => array(array('id' => 'file', 'type' => 'file', 'name' => __('File Uplode Example', 'text_domain'), 'btn_browse' => __('Browse File', 'text_domain'), 'btn_insert' => __('Insert Into Page', 'text_domain'), 'multiple' => true))), 'checkbox' => array('name' => __('Checkbox'), 'fields' => array(array('id' => 'checkbox', 'type' => 'checkbox', 'name' => __('Checkbox Example', 'text_domain'), 'std' => 1), array('id' => 'multicheck', 'type' => 'multicheck', 'name' => __('Multi Checkbox Example', 'text_domain'), 'std' => array('choice_one', 'choice_two', 'choice_four'), 'options' => array('choice_one' => 'Choice One', 'choice_two' => 'Choice Two', 'choice_three' => 'Choice Three', 'choice_four' => 'Choice Four')))), 'wp_editor' => array('name' => __('Editor'), 'fields' => array(array('id' => 'wp_editor', 'type' => 'wp_editor', 'name' => __('Editor Example', 'text_domain'), 'desc' => __('This textarea declare a validation method "inlinehtml". It can content inline HTML tags like a, img, span', 'text_domain'), 'validate' => 'wp_editor')))));
$multitabs_menu = new \Generators\OptionPage();
$multitabs_menu->create($create_multitabs_option_page);