• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP ot_settings_id函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中ot_settings_id函数的典型用法代码示例。如果您正苦于以下问题:PHP ot_settings_id函数的具体用法?PHP ot_settings_id怎么用?PHP ot_settings_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ot_settings_id函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: thb_import_theme_options

function thb_import_theme_options()
{
    $file = get_template_directory_uri() . "/inc/democontent/theme-options.txt";
    $theme_options_txt = wp_remote_get($file);
    $options = unserialize(ot_decode($theme_options_txt['body']));
    /* get settings array */
    $settings = get_option(ot_settings_id());
    /* validate options */
    foreach ($settings['settings'] as $setting) {
        if (isset($options[$setting['id']])) {
            $content = ot_stripslashes($options[$setting['id']]);
            $options[$setting['id']] = ot_validate_setting($content, $setting['type'], $setting['id']);
        }
    }
    /* update the option tree array */
    update_option(ot_options_id(), $options);
    $message = 'success';
}
开发者ID:adampdarcy,项目名称:paola,代码行数:18,代码来源:import.php


示例2: custom_theme_options

/**
 * Build the custom settings & update OptionTree.
 *
 * @return    void
 * @since     2.0
 */
function custom_theme_options()
{
    /* OptionTree is not loaded yet, or this is not an admin request */
    if (!function_exists('ot_settings_id') || !is_admin()) {
        return false;
    }
    /**
     * Get a copy of the saved settings array. 
     */
    $saved_settings = get_option(ot_settings_id(), array());
    /**
     * Custom settings array that will eventually be 
     * passes to the OptionTree Settings API Class.
     */
    $custom_settings = array('contextual_help' => array('content' => array(array('id' => 'option_types_help', 'title' => __('Option Types', 'theme-text-domain'), 'content' => '<p>' . __('Help content goes here!', 'theme-text-domain') . '</p>')), 'sidebar' => '<p>' . __('Sidebar content goes here!', 'theme-text-domain') . '</p>'), 'sections' => array(array('id' => 'option_types', 'title' => __('Option Types', 'theme-text-domain'))), 'settings' => array(array('id' => 'demo_background', 'label' => __('Background', 'theme-text-domain'), 'desc' => sprintf(__('The Background option type is for adding background styles to your theme either dynamically via the CSS option type below or manually with %s. The Background option type has filters that allow you to remove fields or change the defaults. For example, you can filter %s to remove unwanted fields from all Background options or an individual one. You can also filter %s. These filters allow you to fine tune the select lists for your specific needs.', 'theme-text-domain'), '<code>ot_get_option()</code>', '<code>ot_recognized_background_fields</code>', '<code>ot_recognized_background_repeat</code>, <code>ot_recognized_background_attachment</code>, <code>ot_recognized_background_position</code>, ' . __('and', 'theme-text-domain') . ' <code>ot_type_background_size_choices</code>'), 'std' => '', 'type' => 'background', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_border', 'label' => __('Border', 'theme-text-domain'), 'desc' => __('The Border option type is used to set width, unit, style, and color values.', 'theme-text-domain'), 'std' => '', 'type' => 'border', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_box_shadow', 'label' => __('Box Shadow', 'theme-text-domain'), 'desc' => sprintf(__('The Box Shadow option type is used to set %s, %s, %s, %s, %s, and %s values.', 'theme-text-domain'), '<code>inset</code>', '<code>offset-x</code>', '<code>offset-y</code>', '<code>blur-radius</code>', '<code>spread-radius</code>', '<code>color</code>'), 'std' => '', 'type' => 'box-shadow', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_category_checkbox', 'label' => __('Category Checkbox', 'theme-text-domain'), 'desc' => __('The Category Checkbox option type displays a list of category IDs. It allows the user to check multiple category IDs and will return that value as an array for use in a custom function or loop.', 'theme-text-domain'), 'std' => '', 'type' => 'category-checkbox', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_category_select', 'label' => __('Category Select', 'theme-text-domain'), 'desc' => __('The Category Select option type displays a list of category IDs. It allows the user to select only one category ID and will return that value for use in a custom function or loop.', 'theme-text-domain'), 'std' => '', 'type' => 'category-select', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_checkbox', 'label' => __('Checkbox', 'theme-text-domain'), 'desc' => __('The Checkbox option type displays a group of choices. It allows the user to check multiple choices and will return that value as an array for use in a custom function or loop.', 'theme-text-domain'), 'std' => '', 'type' => 'checkbox', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and', 'choices' => array(array('value' => 'no', 'label' => __('No', 'theme-text-domain'), 'src' => ''), array('value' => 'Yes', 'label' => __('Yes', 'theme-text-domain'), 'src' => ''))), array('id' => 'demo_colorpicker', 'label' => __('Colorpicker', 'theme-text-domain'), 'desc' => __('The Colorpicker option type saves a hexadecimal color code for use in CSS. Use it to modify the color of something in your theme.', 'theme-text-domain'), 'std' => '', 'type' => 'colorpicker', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_colorpicker_opacity', 'label' => __('Colorpicker Opacity', 'theme-text-domain'), 'desc' => __('Colorpicker Opacity', 'option-tree-theme'), 'desc' => sprintf(__('The Colorpicker Opacity option type saves an rgba color value for use in CSS. To add opacity to other colorpickers add the %s class to the %s array.', 'option-tree'), '<code>ot-colorpicker-opacity</code>', '<code>$args</code>'), 'std' => '', 'type' => 'colorpicker-opacity', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_css', 'label' => __('CSS', 'theme-text-domain'), 'desc' => '<p>' . sprintf(__('The CSS option type is a textarea that when used properly can add dynamic CSS to your theme from within OptionTree. Unfortunately, due server limitations you will need to create a file named %s at the root level of your theme and change permissions using %s so the server can write to the file. I have had the most success setting this single file to %s but feel free to play around with permissions until everything is working. A good starting point is %s. When the server can save to the file, CSS will automatically be updated when you save your Opções do Tema.', 'theme-text-domain'), '<code>dynamic.css</code>', '<code>chmod</code>', '<code>0777</code>', '<code>0666</code>') . '</p><p>' . sprintf(__('This example assumes you have an option with the ID of %1$s. Which means this option will automatically insert the value of %1$s into the %2$s when the Opções do Tema are saved.', 'theme-text-domain'), '<code>demo_background</code>', '<code>dynamic.css</code>') . '</p>', 'std' => '#custom {
  {{demo_background}}
}', 'type' => 'css', 'section' => 'option_types', 'rows' => '20', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_custom_post_type_checkbox', 'label' => __('Custom Post Type Checkbox', 'theme-text-domain'), 'desc' => sprintf(__('The Custom Post Type Select option type displays a list of IDs from any available WordPress post type or custom post type. It allows the user to check multiple post IDs for use in a custom function or loop. Requires at least one valid %1$s in the %1$s field.', 'theme-text-domain'), '<code>post_type</code>'), 'std' => '', 'type' => 'custom-post-type-checkbox', 'section' => 'option_types', 'rows' => '', 'post_type' => 'post', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_custom_post_type_select', 'label' => __('Custom Post Type Select', 'theme-text-domain'), 'desc' => sprintf(__('The Custom Post Type Select option type displays a list of IDs from any available WordPress post type or custom post type. It will return a single post ID for use in a custom function or loop. Requires at least one valid %1$s in the %1$s field.', 'theme-text-domain'), '<code>post_type</code>'), 'std' => '', 'type' => 'custom-post-type-select', 'section' => 'option_types', 'rows' => '', 'post_type' => 'post', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_date_picker', 'label' => __('Date Picker', 'theme-text-domain'), 'desc' => __('The Date Picker option type is tied to a standard form input field which displays a calendar pop-up that allow the user to pick any date when focus is given to the input field. The returned value is a date formatted string.', 'theme-text-domain'), 'std' => '', 'type' => 'date-picker', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_date_time_picker', 'label' => __('Date Time Picker', 'theme-text-domain'), 'desc' => __('The Date Time Picker option type is tied to a standard form input field which displays a calendar pop-up that allow the user to pick any date and time when focus is given to the input field. The returned value is a date and time formatted string.', 'theme-text-domain'), 'std' => '', 'type' => 'date-time-picker', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_dimension', 'label' => __('Dimension', 'theme-text-domain'), 'desc' => __('The Dimension option type is used to set width and height values.', 'theme-text-domain'), 'std' => '', 'type' => 'dimension', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_gallery', 'label' => __('Gallery', 'theme-text-domain'), 'desc' => __('The Gallery option type saves a comma separated list of image attachment IDs. You will need to create a front-end function to display the images in your theme.', 'theme-text-domain'), 'std' => '', 'type' => 'gallery', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_gallery_shortcode', 'label' => __('Gallery Shortcode', 'theme-text-domain'), 'desc' => sprintf(__('The Gallery option type can also be saved as a shortcode by adding %s to the class attribute. Using the Gallery option type in this manner will result in a better user experience as you\'re able to save the link, column, and order settings.', 'theme-text-domain'), '<code>ot-gallery-shortcode</code>'), 'std' => '', 'type' => 'gallery', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => 'ot-gallery-shortcode', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_google_fonts', 'label' => __('Google Fonts', 'theme-text-domain'), 'desc' => sprintf(__('The Google Fonts option type will dynamically enqueue any number of Google Web Fonts into the document %1$s. As well, once the option has been saved each font family will automatically be inserted into the %2$s array for the Typography option type. You can further modify the font stack by using the %3$s filter, which is passed the %4$s, %5$s, and %6$s parameters. The %6$s parameter is being passed from %7$s, so it will be the ID of a Typography option type. This will allow you to add additional web safe fonts to individual font families on an as-need basis.', 'theme-text-domain'), '<code>HEAD</code>', '<code>font-family</code>', '<code>ot_google_font_stack</code>', '<code>$font_stack</code>', '<code>$family</code>', '<code>$field_id</code>', '<code>ot_recognized_font_families</code>'), 'std' => array(array('family' => 'opensans', 'variants' => array('300', '300italic', 'regular', 'italic', '600', '600italic'), 'subsets' => array('latin'))), 'type' => 'google-fonts', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_javascript', 'label' => __('JavaScript', 'theme-text-domain'), 'desc' => '<p>' . sprintf(__('The JavaScript option type is a textarea that uses the %s code editor to highlight your JavaScript and display errors as you type.', 'theme-text-domain'), '<code>ace.js</code>') . '</p>', 'std' => '', 'type' => 'javascript', 'section' => 'option_types', 'rows' => '20', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_link_color', 'label' => __('Link Color', 'theme-text-domain'), 'desc' => __('The Link Color option type is used to set all link color states.', 'theme-text-domain'), 'std' => '', 'type' => 'link-color', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_list_item', 'label' => __('List Item', 'theme-text-domain'), 'desc' => __('The List Item option type allows for a great deal of customization. You can add settings to the List Item and those settings will be displayed to the user when they add a new List Item. Typical use is for creating sliding content or blocks of code for custom layouts.', 'theme-text-domain'), 'std' => '', 'type' => 'list-item', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and', 'settings' => array(array('id' => 'demo_list_item_content', 'label' => __('Content', 'theme-text-domain'), 'desc' => '', 'std' => '', 'type' => 'textarea-simple', 'rows' => '10', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'))), array('id' => 'demo_measurement', 'label' => __('Measurement', 'theme-text-domain'), 'desc' => sprintf(__('The Measurement option type is a mix of input and select fields. The text input excepts a value and the select lets you choose the unit of measurement to add to that value. Currently the default units are %s, %s, %s, and %s. However, you can change them with the %s filter.', 'theme-text-domain'), '<code>px</code>', '<code>%</code>', '<code>em</code>', '<code>pt</code>', '<code>ot_measurement_unit_types</code>'), 'std' => '', 'type' => 'measurement', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_numeric_slider', 'label' => __('Numeric Slider', 'theme-text-domain'), 'desc' => __('The Numeric Slider option type displays a jQuery UI slider. It will return a single numerical value for use in a custom function or loop.', 'theme-text-domain'), 'std' => '', 'type' => 'numeric-slider', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '-500,5000,100', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_on_off', 'label' => __('On/Off', 'theme-text-domain'), 'desc' => sprintf(__('The On/Off option type displays a simple switch that can be used to turn things on or off. The saved return value is either %s or %s.', 'theme-text-domain'), '<code>on</code>', '<code>off</code>'), 'std' => '', 'type' => 'on-off', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_page_checkbox', 'label' => __('Page Checkbox', 'theme-text-domain'), 'desc' => __('The Page Checkbox option type displays a list of page IDs. It allows the user to check multiple page IDs for use in a custom function or loop.', 'theme-text-domain'), 'std' => '', 'type' => 'page-checkbox', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_page_select', 'label' => __('Page Select', 'theme-text-domain'), 'desc' => __('The Page Select option type displays a list of page IDs. It will return a single page ID for use in a custom function or loop.', 'theme-text-domain'), 'std' => '', 'type' => 'page-select', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_post_checkbox', 'label' => __('Post Checkbox', 'theme-text-domain'), 'desc' => __('The Post Checkbox option type displays a list of post IDs. It allows the user to check multiple post IDs for use in a custom function or loop.', 'theme-text-domain'), 'std' => '', 'type' => 'post-checkbox', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_post_select', 'label' => __('Post Select', 'theme-text-domain'), 'desc' => __('The Post Select option type displays a list of post IDs. It will return a single post ID for use in a custom function or loop.', 'theme-text-domain'), 'std' => '', 'type' => 'post-select', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_radio', 'label' => __('Radio', 'theme-text-domain'), 'desc' => __('The Radio option type displays a group of choices. It allows the user to choose one and will return that value as a string for use in a custom function or loop.', 'theme-text-domain'), 'std' => '', 'type' => 'radio', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and', 'choices' => array(array('value' => 'yes', 'label' => __('Yes', 'theme-text-domain'), 'src' => ''), array('value' => 'no', 'label' => __('No', 'theme-text-domain'), 'src' => ''), array('value' => 'maybe', 'label' => __('Maybe', 'theme-text-domain'), 'src' => ''))), array('id' => 'demo_radio_image', 'label' => __('Radio Image', 'theme-text-domain'), 'desc' => sprintf(__('the Radio Images option type is primarily used for layouts. However, you can filter the image list using %s. As well, you can add your own custom images using the choices array.', 'theme-text-domain'), '<code>ot_radio_images</code>'), 'std' => 'right-sidebar', 'type' => 'radio-image', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_select', 'label' => __('Select', 'theme-text-domain'), 'desc' => __('The Select option type is used to list anything you want that would be chosen from a select list.', 'theme-text-domain'), 'std' => '', 'type' => 'select', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and', 'choices' => array(array('value' => '', 'label' => __('-- Choose One --', 'theme-text-domain'), 'src' => ''), array('value' => 'yes', 'label' => __('Yes', 'theme-text-domain'), 'src' => ''), array('value' => 'no', 'label' => __('No', 'theme-text-domain'), 'src' => ''), array('value' => 'maybe', 'label' => __('Maybe', 'theme-text-domain'), 'src' => ''))), array('id' => 'demo_sidebar_select', 'label' => __('Sidebar Select', 'theme-text-domain'), 'desc' => '<p>' . sprintf(__('This option type makes it possible for users to select a WordPress registered sidebar to use on a specific area. By using the two provided filters, %s, and %s we can be selective about which sidebars are available on a specific content area.', 'theme-text-domain'), '<code>ot_recognized_sidebars</code>', '<code>ot_recognized_sidebars_{$field_id}</code>') . '</p><p>' . sprintf(__('For example, if we create a WordPress theme that provides the ability to change the Blog Sidebar and we don\'t want to have the footer sidebars available on this area, we can unset those sidebars either manually or by using a regular expression if we have a common name like %s.', 'theme-text-domain'), '<code>footer-sidebar-$i</code>') . '</p>', 'std' => '', 'type' => 'sidebar-select', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_social_links', 'label' => __('Social Links', 'theme-text-domain'), 'desc' => '<p>' . sprintf(__('The Social Links option type utilizes a drag & drop interface to create a list of social links. There are a few filters that make extending this option type easy. You can set the %s filter to %s and turn off loading default values. Use the %s filter to change the default values that are loaded. To filter the settings array use the %s filter.', 'theme-text-domain'), '<code>ot_type_social_links_load_defaults</code>', '<code>false</code>', '<code>ot_type_social_links_defaults</code>', '<code>ot_social_links_settings</code>') . '</p>', 'std' => '', 'type' => 'social-links', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_spacing', 'label' => __('Spacing', 'theme-text-domain'), 'desc' => __('The Spacing option type is used to set spacing values such as padding or margin in the form of top, right, bottom, and left.', 'theme-text-domain'), 'std' => '', 'type' => 'spacing', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_tag_checkbox', 'label' => __('Tag Checkbox', 'theme-text-domain'), 'desc' => __('The Tag Checkbox option type displays a list of tag IDs. It allows the user to check multiple tag IDs and will return that value as an array for use in a custom function or loop.', 'theme-text-domain'), 'std' => '', 'type' => 'tag-checkbox', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_tag_select', 'label' => __('Tag Select', 'theme-text-domain'), 'desc' => __('The Tag Select option type displays a list of tag IDs. It allows the user to select only one tag ID and will return that value for use in a custom function or loop.', 'theme-text-domain'), 'std' => '', 'type' => 'tag-select', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_taxonomy_checkbox', 'label' => __('Taxonomy Checkbox', 'theme-text-domain'), 'desc' => __('The Taxonomy Checkbox option type displays a list of taxonomy IDs. It allows the user to check multiple taxonomy IDs and will return that value as an array for use in a custom function or loop.', 'theme-text-domain'), 'std' => '', 'type' => 'taxonomy-checkbox', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => 'category,post_tag', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_taxonomy_select', 'label' => __('Taxonomy Select', 'theme-text-domain'), 'desc' => __('The Taxonomy Select option type displays a list of taxonomy IDs. It allows the user to select only one taxonomy ID and will return that value for use in a custom function or loop.', 'theme-text-domain'), 'std' => '', 'type' => 'taxonomy-select', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => 'category,post_tag', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_text', 'label' => __('Text', 'theme-text-domain'), 'desc' => __('The Text option type is used to save string values. For example, any optional or required text that is of reasonably short character length.', 'theme-text-domain'), 'std' => '', 'type' => 'text', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_textarea', 'label' => __('Textarea', 'theme-text-domain'), 'desc' => sprintf(__('The Textarea option type is a large string value used for custom code or text in the theme and has a WYSIWYG editor that can be filtered to change the how it is displayed. For example, you can filter %s, %s, %s, and %s.', 'theme-text-domain'), '<code>wpautop</code>', '<code>media_buttons</code>', '<code>tinymce</code>', '<code>quicktags</code>'), 'std' => '', 'type' => 'textarea', 'section' => 'option_types', 'rows' => '15', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_textarea_simple', 'label' => __('Textarea Simple', 'theme-text-domain'), 'desc' => __('The Textarea Simple option type is a large string value used for custom code or text in the theme. The Textarea Simple does not have a WYSIWYG editor.', 'theme-text-domain'), 'std' => '', 'type' => 'textarea-simple', 'section' => 'option_types', 'rows' => '10', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_textblock', 'label' => __('Textblock', 'theme-text-domain'), 'desc' => __('The Textblock option type is used only on the Theme Option page. It will allow you to create & display HTML, but has no title above the text block. You can then use the Textblock to add a more detailed set of instruction on how the options are used in your theme. You would never use this in your themes template files as it does not save a value.', 'theme-text-domain'), 'std' => '', 'type' => 'textblock', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_textblock_titled', 'label' => __('Textblock Titled', 'theme-text-domain'), 'desc' => __('The Textblock Titled option type is used only on the Theme Option page. It will allow you to create & display HTML, and has a title above the text block. You can then use the Textblock Titled to add a more detailed set of instruction on how the options are used in your theme. You would never use this in your themes template files as it does not save a value.', 'theme-text-domain'), 'std' => '', 'type' => 'textblock-titled', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_typography', 'label' => __('Typography', 'theme-text-domain'), 'desc' => sprintf(__('The Typography option type is for adding typography styles to your theme either dynamically via the CSS option type above or manually with %s. The Typography option type has filters that allow you to remove fields or change the defaults. For example, you can filter %s to remove unwanted fields from all Background options or an individual one. You can also filter %s. These filters allow you to fine tune the select lists for your specific needs.', 'theme-text-domain'), '<code>ot_get_option()</code>', '<code>ot_recognized_typography_fields</code>', '<code>ot_recognized_font_families</code>, <code>ot_recognized_font_sizes</code>, <code>ot_recognized_font_styles</code>, <code>ot_recognized_font_variants</code>, <code>ot_recognized_font_weights</code>, <code>ot_recognized_letter_spacing</code>, <code>ot_recognized_line_heights</code>, <code>ot_recognized_text_decorations</code> ' . __('and', 'theme-text-domain') . ' <code>ot_recognized_text_transformations</code>'), 'std' => '', 'type' => 'typography', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_upload', 'label' => __('Upload', 'theme-text-domain'), 'desc' => sprintf(__('The Upload option type is used to upload any WordPress supported media. After uploading, users are required to press the "%s" button in order to populate the input with the URI of that media. There is one caveat of this feature. If you import the Opções do Tema and have uploaded media on one site the old URI will not reflect the URI of your new site. You will have to re-upload or %s any media to your new server and change the URIs if necessary.', 'theme-text-domain'), apply_filters('ot_upload_text', __('Send to OptionTree', 'theme-text-domain')), 'FTP'), 'std' => '', 'type' => 'upload', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => '', 'condition' => '', 'operator' => 'and'), array('id' => 'demo_upload_attachment_id', 'label' => __('Upload Attachment ID', 'theme-text-domain'), 'desc' => sprintf(__('The Upload option type can also be saved as an attachment ID by adding %s to the class attribute.', 'theme-text-domain'), '<code>ot-upload-attachment-id</code>'), 'std' => '', 'type' => 'upload', 'section' => 'option_types', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step' => '', 'class' => 'ot-upload-attachment-id', 'condition' => '', 'operator' => 'and')));
    /* allow settings to be filtered before saving */
    $custom_settings = apply_filters(ot_settings_id() . '_args', $custom_settings);
    /* settings are not the same update the DB */
    if ($saved_settings !== $custom_settings) {
        update_option(ot_settings_id(), $custom_settings);
    }
    /* Lets OptionTree know the UI Builder is being overridden */
    global $ot_has_custom_theme_options;
    $ot_has_custom_theme_options = true;
}
开发者ID:ericsoncardosoweb,项目名称:agatha-wp,代码行数:33,代码来源:demo-theme-options.php


示例3: custom_theme_options

/**
 * Build the custom settings & update OptionTree.
 *
 * @return    void
 * @since     2.3.0
 */
function custom_theme_options()
{
    /* OptionTree is not loaded yet */
    if (!function_exists('ot_settings_id')) {
        return false;
    }
    /**
     * Get a copy of the saved settings array. 
     */
    $saved_settings = get_option(ot_settings_id(), array());
    /**
     * Custom settings array that will eventually be 
     * passes to the OptionTree Settings API Class.
     */
    $custom_settings = array('contextual_help' => array('content' => array(array('id' => 'option_types_help', 'title' => __('Option Types', 'themecountry'), 'content' => '<p>' . __('Help content goes here!', 'themecountry') . '</p>')), 'sidebar' => '<p>' . __('Sidebar content goes here!', 'themecountry') . '</p>'), 'sections' => array(array('id' => 'option_general', 'title' => __('General', 'themecountry')), array('id' => 'option_style', 'title' => __('Styles', 'themecountry')), array('id' => 'option_header', 'title' => __('Header', 'themecountry')), array('id' => 'option_footer', 'title' => __('Footer', 'themecountry')), array('id' => 'option_blog', 'title' => __('Home Page', 'themecountry')), array('id' => 'option_home_slider', 'title' => __('Feature Slider', 'themecountry')), array('id' => 'option_single', 'title' => __('Single Post', 'themecountry')), array('id' => 'option_sidebar', 'title' => __('Sidebar', 'themecountry')), array('id' => 'option_social_button', 'title' => __('Social Buttons', 'themecountry')), array('id' => 'option_typography', 'title' => __('Typography', 'themecountry')), array('id' => 'option_ad_mangment', 'title' => __('Ad Managment', 'themecountry')), array('id' => 'option_import_export', 'title' => __('Import/Export', 'themecountry'))), 'settings' => array(array('id' => 'responsive', 'label' => __('Responsiveness', 'themecountry'), 'desc' => __('Wimple pro is responsive witch mean that the layout is adapt to Mobile and table screen. Using This option to enable or disable responsiveness.', 'themecountry'), 'std' => 'on', 'type' => 'on-off', 'section' => 'option_general'), array('id' => 'header-code', 'label' => __('Header Code', 'themecountry'), 'desc' => __('If you have any code you want to appear between and , Pastes it here. For example: Google Web Master Cool Code or Pinterest Verify Code.', 'themecountry'), 'type' => 'textarea-simple', 'section' => 'option_general', 'rows' => '3'), array('id' => 'tracking-code', 'label' => __('Footer Code (Tracing, JavaScript Code)', 'themecountry'), 'desc' => __('If you have tracking code (Google Analytic or other ), Pastes Your Code here which be inserted before the closing body tag of your theme.', 'themecountry'), 'type' => 'textarea-simple', 'section' => 'option_general', 'rows' => '3'), array('id' => 'page-comments', 'label' => __('Comment on Page', 'themecountry'), 'desc' => __('Use this option to to enable or completely Hide Comment and Comment form on Page', 'themecountry'), 'std' => 'off', 'type' => 'on-off', 'section' => 'option_general'), array('id' => 'back_to_top', 'label' => __('Back To Top Button', 'themecountry'), 'desc' => __('Use this option to hide or show "Back To Top" button.', 'themecountry'), 'std' => 'on', 'type' => 'on-off', 'section' => 'option_general'), array('id' => 'logo', 'label' => __('Custom Logo Image', 'themecountry'), 'desc' => __('Upload your custom logo image here.', 'themecountry'), 'type' => 'upload', 'section' => 'option_header'), array('id' => 'header_layout', 'label' => __('Header Layout', 'themecountry'), 'desc' => __('Use this option to Choose Header Design Style for your website.', 'themecountry'), 'std' => 'left', 'type' => 'radio-image', 'section' => 'option_header', 'class' => '', 'choices' => array(array('value' => 'left', 'label' => __('Header Content With Navigation', 'themecountry'), 'src' => get_template_directory_uri() . '/images/header-layout/header-menu.png'), array('value' => 'right', 'label' => __('Header Suppurate From Navigation', 'themecountry'), 'src' => get_template_directory_uri() . '/images/header-layout/menu-out-of-header.png'))), array('id' => 'fixed_menu', 'label' => __('Floating Navigation Menu', 'themecountry'), 'desc' => __('Use this option to enable Floating Navigation Menu.', 'themecountry'), 'std' => 'off', 'type' => 'on-off', 'section' => 'option_header'), array('id' => 'footer-widgets', 'label' => __('Footer Widget Columns', 'themecountry'), 'desc' => __('Select Number of Columns for your Footer area or Disable it.', 'themecountry'), 'std' => '3', 'type' => 'radio-image', 'section' => 'option_footer', 'class' => '', 'choices' => array(array('value' => '0', 'label' => __('Disable', 'themecountry'), 'src' => get_template_directory_uri() . '/images/layout/layout-off.png'), array('value' => '1', 'label' => __('1 Column', 'themecountry'), 'src' => get_template_directory_uri() . '/images/layout/footer-widgets-1.png'), array('value' => '2', 'label' => __('2 Columns', 'themecountry'), 'src' => get_template_directory_uri() . '/images/layout/footer-widgets-2.png'), array('value' => '3', 'label' => __('3 Columns', 'themecountry'), 'src' => get_template_directory_uri() . '/images/layout/footer-widgets-3.png'))), array('id' => 'copyright', 'label' => __('Footer Copyright Text', 'themecountry'), 'desc' => __('Add Text you want to show in "Copyright Sction" at Bottom Left of your Website.', 'themecountry'), 'type' => 'textarea-simple', 'rows' => '3', 'section' => 'option_footer'), array('id' => 'post-text', 'label' => __('Home Page Entry Text', 'themecountry'), 'desc' => __('Use this option to show Expert or Full Content from your each post show on Homepage and Archive Page.', 'themecountry'), 'std' => 'excerpt', 'type' => 'radio', 'section' => 'option_blog', 'choices' => array(array('value' => 'excerpt', 'label' => __('Show Excerpt', 'themecountry')), array('value' => 'content', 'label' => __('Show Content', 'themecountry')))), array('id' => 'home-post-read-more', 'label' => __('Read More Button', 'themecountry'), 'desc' => __('Enable or Disable Read More Button on Homepage for Each Post.', 'themecountry'), 'std' => 'on', 'type' => 'on-off', 'section' => 'option_blog'), array('id' => 'excerpt-length', 'label' => 'Excerpt Length', 'desc' => __('Number of word as Expert Length To be Shown in Homepage when you choose to show entry text as Excerpt.', 'themecountry'), 'std' => '34', 'type' => 'numeric-slider', 'section' => 'option_blog', 'min_max_step' => '0,100,1'), array('id' => 'home-post-meta', 'label' => __('HomePage & Single Post Meta Info', 'themecountry'), 'desc' => __('Use this button to Show or Hide Post Meta Info on HomePage. (Author name, Date etc.).', 'themecountry'), 'std' => 'on', 'type' => 'on-off', 'section' => 'option_blog'), array('id' => 'home-post-meta-show', 'label' => __('What To Hide in Meta Info', 'themecountry'), 'desc' => __('Choose What Meta Info to Hide.', 'themecountry'), 'type' => 'checkbox', 'section' => 'option_blog', 'choices' => array(array('value' => 'autho_name', 'label' => __('Author Name', 'themecountry')), array('value' => 'date', 'label' => __('Date', 'themecountry')), array('value' => 'category', 'label' => __('Category', 'themecountry')), array('value' => 'tag', 'label' => __('Tag', 'themecountry')), array('value' => 'comment_count', 'label' => __('Comment Count', 'themecountry')))), array('id' => 'pagination', 'label' => __('Pagination', 'themecountry', 'themecountry'), 'desc' => __('Choose your Preferred Pagination Style.', 'themecountry'), 'std' => 'default', 'type' => 'radio', 'section' => 'option_blog', 'choices' => array(array('value' => 'default', 'label' => __('Default (Older Posts/Newer Posts)', 'themecountry')), array('value' => 'numberal', 'label' => __('Numberal (1 2 3 ...)', 'themecountry')), array('value' => 'loading', 'label' => __('Load More...', 'themecountry')), array('value' => 'infinite', 'label' => __('Auto Infinite Scroll', 'themecountry')))), array('id' => 'enable-home-slider', 'label' => __('Featured Content Slider', 'themecountry'), 'desc' => __('use this option to enable or Disable Featured Content Slider.', 'themecountry'), 'std' => 'on', 'type' => 'on-off', 'section' => 'option_home_slider'), array('id' => 'number-of-post', 'label' => __('Number of Slides', 'themecountry'), 'desc' => __('Enter the number of Slides', 'themecountry'), 'std' => '5', 'type' => 'text', 'section' => 'option_home_slider'), array('id' => 'type-of-slider', 'label' => __('Use Categories Slider', 'themecountry'), 'desc' => __('Use Post from Category As Featured Content Sliders', 'themecountry'), 'std' => 'on', 'type' => 'on-off', 'section' => 'option_home_slider'), array('id' => 'category-slide-option', 'label' => __('Choose Categories', 'themecountry'), 'desc' => '', 'std' => '', 'type' => 'category-checkbox', 'section' => 'option_home_slider', 'operator' => 'and'), array('id' => 'customize_slider_option', 'label' => __('Custom Sliders', 'themecountry'), 'desc' => __('With this option you can set up a Sliders with custom image and text instead of the default slidshow automatically generated from your posts.', 'themecountry'), 'std' => '', 'type' => 'list-item', 'section' => 'option_home_slider', 'operator' => 'and', 'settings' => array(array('id' => 'slide_image', 'label' => __('Image', 'themecountry'), 'desc' => __('Upload or select an image for this slide', 'themecountry'), 'type' => 'upload'), array('id' => 'slide_url', 'label' => __('Link', 'themecountry'), 'desc' => __('URL of the slide', 'themecountry'), 'std' => '#', 'type' => 'text', 'operator' => 'and'))), array('id' => 'author-bio', 'label' => __('Author Bio', 'themecountry'), 'desc' => __('Display Author Bio below each Post.', 'themecountry'), 'std' => 'on', 'type' => 'on-off', 'section' => 'option_single'), array('id' => 'author-highlight', 'label' => __('Highlight Author Comment', 'themecountry'), 'desc' => __('Use this Option to highlight author comments.', 'themecountry'), 'std' => 'on', 'type' => 'on-off', 'section' => 'option_single'), array('id' => 'breadcrumb', 'label' => __('Breadcrumbs', 'themecountry'), 'desc' => __('Use This Option to enable or Disable breadcrumbs.', 'themecountry'), 'std' => 'off', 'type' => 'on-off', 'section' => 'option_single'), array('id' => 'yoast_breadcrumb', 'desc' => __('Check it if you install WordPress SEO by Yoast', 'themecountry'), 'type' => 'checkbox', 'section' => 'option_single', 'choices' => array(array('value' => 'yoast_breadcrumb_yes', 'label' => __('Use Yoast Breadcrumb', 'option-tree-theme')))), array('id' => 'post-nav', 'label' => __('Post Navigation', 'themecountry'), 'desc' => __('Shows links to the next and previous post', 'themecountry'), 'std' => 'on', 'type' => 'on-off', 'section' => 'option_single'), array('id' => 'post-related', 'label' => __('Related Posts', 'themecountry'), 'desc' => __('Use This Option to enable or Disable related Posts below your Post.', 'themecountry'), 'std' => 'on', 'type' => 'on-off', 'section' => 'option_single'), array('id' => 'related-posts-taxonomy', 'label' => __('Related Posts Taxonomy', 'themecountry'), 'desc' => __('Choose the Way Related Post Work.', 'themecountry'), 'std' => 'tag', 'type' => 'radio', 'section' => 'option_single', 'choices' => array(array('value' => 'tag', 'label' => 'Tags'), array('value' => 'category', 'label' => 'Categories'))), array('id' => 'number-related', 'std' => '3', 'label' => __('Number Related Posts', 'themecountry'), 'desc' => __('Enter the number of posts to show in the related posts section.', 'themecountry'), 'type' => 'text', 'section' => 'option_single'), array('id' => 'display-related-posts', 'label' => __('Display Related Posts', 'themecountry'), 'desc' => __('Related Posts type to display.'), 'std' => 'thumbnail', 'type' => 'radio', 'section' => 'option_single', 'choices' => array(array('value' => 'thumbnail', 'label' => __('Thumbnail and Title', 'themecountry')), array('value' => 'list', 'label' => __('Only Tittle, In List style.', 'themecountry')))), array('id' => 'pinterest', 'label' => __('Pinterest Pin In Button', 'themecountry'), 'desc' => __('Use This Option to enable or Disable Pinterest "Pin In" button which will be shown when visitor add mouse hover images in your post.', 'themecountry'), 'std' => 'on', 'type' => 'on-off', 'section' => 'option_single'), array('id' => 'sidebar-areas', 'label' => __('Create Sidebars', 'themecountry'), 'desc' => __('Create Custom Sidebars Here if you want to Have Different Sidebar for Homepage and Single Post and So on.', 'themecountry'), 'type' => 'list-item', 'section' => 'option_sidebar', 'choices' => array(), 'settings' => array(array('id' => 'id', 'label' => __('Sidebar ID', 'themecountry'), 'desc' => __('This ID must be unique, for example "sidebar-about"', 'themecountry'), 'std' => 'sidebar-select', 'type' => 'text', 'choices' => array()))), array('id' => 's1-home', 'label' => __('Home', 'themecountry'), 'desc' => __('Choose Sidebar to Show On Hompage.', 'themecountry'), 'type' => 'sidebar-select', 'section' => 'option_sidebar'), array('id' => 's1-single', 'label' => __('Single', 'themecountry'), 'desc' => __('Choose Sidebar to Show On Single Post.', 'themecountry'), 'type' => 'sidebar-select', 'section' => 'option_sidebar'), array('id' => 's1-archive', 'label' => __('Archive (Date Based)', 'themecountry'), 'desc' => __('Choose Sidebar to Show On Archive Page (Date Based Archive)', 'themecountry'), 'type' => 'sidebar-select', 'section' => 'option_sidebar'), array('id' => 's1-archive-category', 'label' => __('Archive Category', 'themecountry'), 'desc' => __('Choose Sidebar to Show On Category Page.', 'themecountry'), 'type' => 'sidebar-select', 'section' => 'option_sidebar'), array('id' => 's1-search', 'label' => __('Search', 'themecountry'), 'desc' => __('Choose Sidebar to Show On Search Page', 'themecountry'), 'type' => 'sidebar-select', 'section' => 'option_sidebar'), array('id' => 's1-404', 'label' => __('Error 404', 'themecountry'), 'desc' => __('Choose Sidebar to Show On "Error 404, Page Not Found" Page.', 'themecountry'), 'type' => 'sidebar-select', 'section' => 'option_sidebar'), array('id' => 's1-page', 'label' => __('Page', 'themecountry'), 'desc' => __('Choose Sidebar to Show On "Page".', 'themecountry'), 'type' => 'sidebar-select', 'section' => 'option_sidebar'), array('id' => 'tc-google-typography', 'label' => '', 'desc' => '', 'type' => 'typography-google', 'section' => 'option_typography'), array('id' => 'social-button-enable', 'label' => __('Social Sharing Button', 'themecountry'), 'desc' => __('Use This Option to Show Social Sharing Button.', 'themecountry'), 'std' => 'on', 'type' => 'on-off', 'section' => 'option_social_button'), array('id' => 'twitter-username', 'label' => __('Twitter Username', 'themecountry'), 'desc' => __('Your @username will be added to share-tweets of your posts (optional)', 'themecountry'), 'type' => 'text', 'section' => 'option_social_button'), array('id' => 'social-sharing-pos', 'label' => __('Social Sharing Buttons Position', 'themecountry'), 'desc' => __('Choose position for Social Sharing Buttons.', 'themecountry'), 'type' => 'checkbox', 'section' => 'option_social_button', 'std' => 'top', 'choices' => array(array('value' => 'top', 'label' => __('After Title', 'themecountry')), array('value' => 'bottom', 'label' => __('After Post', 'themecountry')), array('value' => 'float', 'label' => __('Float Social To Left', 'themecountry')))), array('id' => 'social-twitter', 'label' => __('Twitter', 'themecountry'), 'std' => 'on', 'type' => 'on-off', 'section' => 'option_social_button'), array('id' => 'social-facebook', 'label' => __('Facebook', 'themecountry'), 'std' => 'on', 'type' => 'on-off', 'section' => 'option_social_button'), array('id' => 'social-google-plus', 'label' => __('Google Plus', 'themecountry'), 'std' => 'on', 'type' => 'on-off', 'section' => 'option_social_button'), array('id' => 'social-linkedin', 'label' => __('Linkedin', 'themecountry'), 'std' => 'off', 'type' => 'on-off', 'section' => 'option_social_button'), array('id' => 'social-pinterest', 'label' => __('Pinterest', 'themecountry'), 'std' => 'off', 'type' => 'on-off', 'section' => 'option_social_button'), array('id' => 'ad-header-banner', 'label' => __('Header Banner Ads', 'themecountry'), 'desc' => __('Paste Your Ads Code Here ( Adsense, Buy Sell Ads ). It will be shown on the top of Header ( Note: This Ads won`t be shown If you choose the 1st design in Header Option )', 'themecountry'), 'type' => 'textarea-simple', 'section' => 'option_ad_mangment', 'rows' => '3'), array('id' => 'ad-after-post-title', 'label' => __('Below Post Title', 'themecountry'), 'desc' => __('Paste Your Ads Code Here ( Adsense, Buy Sell Ads ). It will be shown Below Each Post title.', 'themecountry'), 'type' => 'textarea-simple', 'section' => 'option_ad_mangment', 'rows' => '3'), array('id' => 'top-ads-position', 'label' => '', 'desc' => __('Choose Alignment Of your Ads.', 'themecountry'), 'type' => 'select', 'section' => 'option_ad_mangment', 'choices' => array(array('value' => 'ad-none', 'label' => __('None', 'themecountry')), array('value' => 'ad-left', 'label' => __('Left', 'themecountry')), array('value' => 'ad-center', 'label' => __('Center', 'themecountry')), array('value' => 'ad-right', 'label' => __('Right', 'themecountry')))), array('id' => 'ad-middle-post', 'label' => __('Middle Post Content', 'themecountry'), 'desc' => __('Paste Your Ads Code Here ( Adsense, Buy Sell Ads ). It will be shown right middle of your post.', 'themecountry'), 'type' => 'textarea-simple', 'section' => 'option_ad_mangment', 'rows' => '3'), array('id' => 'middle-ads-position', 'label' => '', 'desc' => __('Choose Alignment Of your Ads.', 'themecountry'), 'type' => 'select', 'section' => 'option_ad_mangment', 'choices' => array(array('value' => 'ad-none', 'label' => __('None', 'themecountry')), array('value' => 'ad-left', 'label' => __('Left', 'themecountry')), array('value' => 'ad-center', 'label' => __('Center', 'themecountry')), array('value' => 'ad-right', 'label' => __('Right', 'themecountry')))), array('id' => 'ad-below-post', 'label' => __('Below Post content', 'themecountry'), 'desc' => __('Paste Your Ads Code Here ( Adsense, Buy Sell Ads ). It will be shown Below Each Post.', 'themecountry'), 'type' => 'textarea-simple', 'section' => 'option_ad_mangment', 'rows' => '3'), array('id' => 'below-ads-position', 'label' => '', 'desc' => __('Choose Alignment Of your Ads.', 'themecountry'), 'type' => 'select', 'section' => 'option_ad_mangment', 'choices' => array(array('value' => 'ad-none', 'label' => __('None', 'themecountry')), array('value' => 'ad-left', 'label' => __('Left', 'themecountry')), array('value' => 'ad-center', 'label' => __('Center', 'themecountry')), array('value' => 'ad-right', 'label' => __('Right', 'themecountry')))), array('id' => 'duration-ads-top', 'label' => __('Ads and Post Age', 'themecountry'), 'desc' => __('Only Show Ads on Post Which is Older than number of days you choose.', 'themecountry'), 'type' => 'numeric-slider', 'std' => '100', 'section' => 'option_ad_mangment'), array('id' => 'layout-width-sidebar', 'label' => __('Layout', 'themecountry'), 'desc' => __('Choose To Show Sidebar On Left Or Right or No-Sidebar', 'themecountry'), 'std' => 'right', 'type' => 'radio-image', 'section' => 'option_style', 'class' => '', 'choices' => array(array('value' => 'left', 'label' => __('Sidebare Left', 'themecountry'), 'src' => get_template_directory_uri() . '/images/layout/col-2cr.png'), array('value' => 'right', 'label' => __('Sidebar Right', 'themecountry'), 'src' => get_template_directory_uri() . '/images/layout/col-2cl.png'), array('value' => 'no-sidebar', 'label' => __('No Sidebar', 'themecountry'), 'src' => get_template_directory_uri() . '/images/layout/col-1cl.png'))), array('id' => 'on-off-option-style', 'label' => __('Custom Header Color', 'themecountry'), 'desc' => __('Enable Custom Header Color Setting Or Use Our Ready Made Color Scheme.', 'themecountry'), 'std' => 'off', 'type' => 'on-off', 'section' => 'option_style'), array('id' => 'header_style', 'label' => __('Ready Made Header Color Scheme', 'themecountry'), 'desc' => __('Choose Color You Like.', 'themecountry'), 'std' => 'default', 'type' => 'radio-image', 'section' => 'option_style', 'class' => '', 'choices' => array(array('value' => 'default', 'label' => '', 'src' => get_template_directory_uri() . '/images/default.jpg'), array('value' => 'green-sea', 'label' => '', 'src' => get_template_directory_uri() . '/images/green-sea.jpg'), array('value' => 'belize-hole', 'label' => '', 'src' => get_template_directory_uri() . '/images/belize-hole.jpg'), array('value' => 'wisteria', 'label' => '', 'src' => get_template_directory_uri() . '/images/wisteria.jpg'), array('value' => 'midnight-blue', 'label' => '', 'src' => get_template_directory_uri() . '/images/midnight-blue.jpg'), array('value' => 'orange', 'label' => '', 'src' => get_template_directory_uri() . '/images/orange.jpg'), array('value' => 'pumkin', 'label' => '', 'src' => get_template_directory_uri() . '/images/pumkin.jpg'), array('value' => 'asbestos', 'label' => '', 'src' => get_template_directory_uri() . '/images/asbestos.jpg'), array('value' => 'pomegranate', 'label' => '', 'src' => get_template_directory_uri() . '/images/pomegranate.jpg'))), array('id' => 'primary_header_color', 'label' => __('Custom Primary Header Color', 'themecountry'), 'desc' => __('Pick the primary header color.', 'themecountry'), 'type' => 'colorpicker', 'std' => '', 'section' => 'option_style', 'operator' => 'and'), array('id' => 'secondary_header_color', 'label' => __('Custom Secondary Header Color', 'themecountry'), 'desc' => __('Pick the secondary header color.', 'themecountry'), 'type' => 'colorpicker', 'std' => '', 'section' => 'option_style', 'operator' => 'and'), array('id' => 'custom_style', 'label' => __('Custom CSS', 'themecountry'), 'desc' => __('Add you CSS Custom Code here. (Only For Advance User)', 'themecountry'), 'type' => 'css', 'section' => 'option_style', 'rows' => '3'), array('id' => 'text_desscription_import_export', 'desc' => sprintf(__('<b>Click link to <a href="%s">Import/Export</a></b>', 'themecountry'), admin_url('themes.php?page=tc-theme-backup')), 'std' => '', 'type' => 'textblock', 'section' => 'option_import_export')));
    /* allow settings to be filtered before saving */
    $custom_settings = apply_filters(ot_settings_id() . '_args', $custom_settings);
    /* settings are not the same update the DB */
    if ($saved_settings !== $custom_settings) {
        update_option(ot_settings_id(), $custom_settings);
    }
    /* Lets OptionTree know the UI Builder is being overridden */
    global $ot_has_custom_theme_options;
    $ot_has_custom_theme_options = true;
}
开发者ID:hiroki-tkg,项目名称:bitmaker,代码行数:31,代码来源:theme-options.php


示例4: custom_theme_options

/**
 * Build the custom settings & update OptionTree.
 *
 * @return    void
 * @since     2.0
 */
function custom_theme_options()
{
    /* OptionTree is not loaded yet, or this is not an admin request */
    if (!function_exists('ot_settings_id') || !is_admin()) {
        return false;
    }
    /**
     * Get a copy of the saved settings arra 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ot_settings_view函数代码示例发布时间:2022-05-15
下一篇:
PHP ot_sections_view函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap