当前位置: 首页>>代码示例>>PHP>>正文


PHP ot_option_types_array函数代码示例

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


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

示例1: ot_type_creating_options

 function ot_type_creating_options()
 {
     /* format setting outer wrapper */
     echo '<div class="format-setting type-textblock wide-desc">';
     /* description */
     echo '<div class="description">';
     echo '<h4>' . __('Label', 'option-tree') . ':</h4>';
     echo '<p>' . __('The Label field should be a short but descriptive block of text 100 characters or less with no HTML.', 'option-tree') . '</p>';
     echo '<h4>' . __('ID', 'option-tree') . ':</h4>';
     echo '<p>' . __('The ID field is a unique alphanumeric key used to differentiate each theme option (underscores are acceptable). Also, the plugin will change all text you write in this field to lowercase and replace spaces and special characters with an underscore automatically.', 'option-tree') . '</p>';
     echo '<h4>' . __('Type', 'option-tree') . ':</h4>';
     echo '<p>' . __('You are required to choose one of the supported option types when creating a new option. Here is a list of the available option types. For more information about each type click the <code>Option Types</code> tab to the left.', 'option-tree') . '</p>';
     echo '<ul class="docs-ul">';
     foreach (ot_option_types_array() as $key => $value) {
         echo '<li>' . $value . '</li>';
     }
     echo '</ul>';
     echo '<h4>' . __('Description', 'option-tree') . ':</h4>';
     echo '<p>' . __('Enter a detailed description for the users to read on the Theme Options page, HTML is allowed. This is also where you enter content for both the Textblock & Textblock Titled option types.', 'option-tree') . '</p>';
     echo '<h4>' . __('Choices', 'option-tree') . ':</h4>';
     echo '<p>' . __('Click the "Add Choice" button to add an item to the choices array. This will only affect the following option types: Checkbox, Radio, Select & Select Image.', 'option-tree') . '</p>';
     echo '<h4>' . __('Settings', 'option-tree') . ':</h4>';
     echo '<p>' . __('Click the "Add Setting" button found inside a newly created setting to add an item to the settings array. This will only affect the List Item type.', 'option-tree') . '</p>';
     echo '<h4>' . __('Standard', 'option-tree') . ':</h4>';
     echo '<p>' . __('Setting the standard value for your option only works for some option types. Those types are one that have a single string value saved to them and not an array of values.', 'option-tree') . '</p>';
     echo '<h4>' . __('Rows', 'option-tree') . ':</h4>';
     echo '<p>' . __('Enter a numeric value for the number of rows in your textarea. This will only affect the following option types: CSS, Textarea, & Textarea Simple.', 'option-tree') . '</p>';
     echo '<h4>' . __('Post Type', 'option-tree') . ':</h4>';
     echo '<p>' . __('Add a comma separated list of post type like <code>post,page</code>. This will only affect the following option types: Custom Post Type Checkbox, & Custom Post Type Select. Below are the default post types available with WordPress and that are also compatible with OptionTree. You can also add your own custom <code>post_type</code>. At this time <code>any</code> does not seem to return results properly and is something I plan on looking into.', 'option-tree') . '</p>';
     echo '<ul class="docs-ul">';
     echo '<li><code>post</code></li>';
     echo '<li><code>page</code></li>';
     echo '<li><code>attachment</code></li>';
     echo '</ul>';
     echo '<h4>' . __('Taxonomy', 'option-tree') . ':</h4>';
     echo '<p>' . __('Add a comma separated list of any registered taxonomy like <code>category,post_tag</code>. This will only affect the following option types: Taxonomy Checkbox, & Taxonomy Select.', 'option-tree') . '</p>';
     echo '<h4>' . __('Min, Max, & Step', 'option-tree') . ':</h4>';
     echo '<p>' . __('Add a comma separated list of options in the following format <code>0,100,1</code> (slide from <code>0-100</code> in intervals of <code>1</code>). The three values represent the minimum, maximum, and step options and will only affect the Numeric Slider option type.', 'option-tree') . '</p>';
     echo '<h4>' . __('CSS Class', 'option-tree') . ':</h4>';
     echo '<p>' . __('Add and optional class to any option type.', 'option-tree') . '</p>';
     echo '<h4>' . __('Condition', 'option-tree') . ':</h4>';
     echo '<p>' . sprintf(__('Add a comma separated list (no spaces) of conditions in which the field will be visible, leave this setting empty to always show the field. In these examples, %s is a placeholder for your condition, which can be in the form of %s.', 'option-tree'), '<code>value</code>', '<code>field_id:is(value)</code>, <code>field_id:not(value)</code>, <code>field_id:contains(value)</code>, <code>field_id:less_than(value)</code>, <code>field_id:less_than_or_equal_to(value)</code>, <code>field_id:greater_than(value)</code>, or <code>field_id:greater_than_or_equal_to(value)</code>') . '</p>';
     echo '<h4>' . __('Operator', 'option-tree') . ':</h4>';
     echo '<p>' . sprintf(__('Choose the logical operator to compute the result of the conditions. Your options are %s and %s.', 'option-tree'), '<code>and</code>', '<code>or</code>') . '</p>';
     echo '</div>';
     echo '</div>';
 }
开发者ID:sumeetbajra,项目名称:jewelleryshop,代码行数:47,代码来源:ot-functions-docs-page.php

示例2: ot_type_creating_options

 function ot_type_creating_options()
 {
     /* format setting outer wrapper */
     echo '<div class="format-setting type-textblock wide-desc">';
     /* description */
     echo '<div class="description">';
     echo '<h4>' . __('Label', 'option-tree') . ':</h4>';
     echo '<p>' . __('The Label field should be a short but descriptive block of text 100 characters or less with no HTML.', 'option-tree') . '</p>';
     echo '<h4>' . __('ID', 'option-tree') . ':</h4>';
     echo '<p>' . __('The ID field is a unique alphanumeric key used to differentiate each theme option (underscores are acceptable). Also, the plugin will change all text you write in this field to lowercase and replace spaces and special characters with an underscore automatically.', 'option-tree') . '</p>';
     echo '<h4>' . __('Type', 'option-tree') . ':</h4>';
     echo '<p>' . __('You are required to choose one of the supported option types when creating a new option. Here is a list of the available option types. For more information about each type click the <code>Option Types</code> tab to the left.', 'option-tree') . '</p>';
     echo '<ul class="docs-ul">';
     foreach (ot_option_types_array() as $key => $value) {
         echo '<li>' . $value . '</li>';
     }
     echo '</ul>';
     echo '<h4>' . __('Description', 'option-tree') . ':</h4>';
     echo '<p>' . __('Enter a detailed description for the users to read on the Theme Options page, HTML is allowed. This is also where you enter content for both the Textblock & Textblock Titled option types.', 'option-tree') . '</p>';
     echo '<h4>' . __('Choices', 'option-tree') . ':</h4>';
     echo '<p>' . __('Click the "Add Choice" button to add an item to the choices array. This will only affect the following option types: Checkbox, Radio, Select & Select Image.', 'option-tree') . '</p>';
     echo '<h4>' . __('Settings', 'option-tree') . ':</h4>';
     echo '<p>' . __('Click the "Add Setting" button found inside a newly created setting to add an item to the settings array. This will only affect the List Item type.', 'option-tree') . '</p>';
     echo '<h4>' . __('Standard', 'option-tree') . ':</h4>';
     echo '<p>' . __('Setting the standard value for your option only works for some option types. Those types are one that have a single string value saved to them and not an array of values.', 'option-tree') . '</p>';
     echo '<h4>' . __('Rows', 'option-tree') . ':</h4>';
     echo '<p>' . __('Enter a numeric value for the number of rows in your textarea. This will only affect the following option types: CSS, Textarea, & Textarea Simple.', 'option-tree') . '</p>';
     echo '<h4>' . __('Post Type', 'option-tree') . ':</h4>';
     echo '<p>' . __('Add a comma separated list of post type like <code>post,page</code>. This will only affect the following option types: Custom Post Type Checkbox, & Custom Post Type Select. Below are the default post types available with WordPress and that are also compatible with OptionTree. You can also add your own custom <code>post_type</code>. At this time <code>any</code> does not seem to return results properly and is something I plan on looking into.', 'option-tree') . '</p>';
     echo '<ul class="docs-ul">';
     echo '<li><code>post</code></li>';
     echo '<li><code>page</code></li>';
     echo '<li><code>attachment</code></li>';
     echo '</ul>';
     echo '<h4>' . __('Taxonomy', 'option-tree') . ':</h4>';
     echo '<p>' . __('Add a comma separated list of any registered taxonomy like <code>category,post_tag</code>. This will only affect the following option types: Taxonomy Checkbox, & Taxonomy Select.', 'option-tree') . '</p>';
     echo '</div>';
     echo '</div>';
 }
开发者ID:ilke-zilci,项目名称:newcomers-wp,代码行数:39,代码来源:ot-functions-docs-page.php

示例3: ot_loop_through_option_types

 function ot_loop_through_option_types($type = '', $child = false)
 {
     $content = '';
     $types = ot_option_types_array();
     if ($child) {
         unset($types['list-item']);
     }
     foreach ($types as $key => $value) {
         $content .= '<option value="' . $key . '" ' . selected($type, $key, false) . '>' . $value . '</option>';
     }
     return $content;
 }
开发者ID:ElectricEasel,项目名称:reflection,代码行数:12,代码来源:ot-functions-admin.php


注:本文中的ot_option_types_array函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。