wp/wp-content/plugins/option-tree/includes/ot-functions-docs-page.php
author ymh <ymh.work@gmail.com>
Tue, 09 Jun 2015 03:35:32 +0200
changeset 5 5e2f62d02dcd
parent 0 d970ebf37754
child 11 bf1778c34b9a
permissions -rw-r--r--
upgrade wordpress + plugins
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
<?php if ( ! defined( 'OT_VERSION' ) ) exit( 'No direct script access allowed' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
 * OptionTree documentation page functions.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
 * @package   OptionTree
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
 * @author    Derek Herman <derek@valendesigns.com>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
 * @copyright Copyright (c) 2013, Derek Herman
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
 * @since     2.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
 * Creating Options option type.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
 * @return    string
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
 * @access    public
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
 * @since     2.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
if ( ! function_exists( 'ot_type_creating_options' ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
  function ot_type_creating_options() {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
    
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
    /* format setting outer wrapper */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
    echo '<div class="format-setting type-textblock wide-desc">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
      
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
      /* description */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
      echo '<div class="description">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    28
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    29
        echo '<h4>'. __( 'Label', 'option-tree' ) . ':</h4>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    30
        echo '<p>' . __( 'The Label field should be a short but descriptive block of text 100 characters or less with no HTML.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    31
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    32
        echo '<h4>'. __( 'ID', 'option-tree' ) . ':</h4>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    33
        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>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    34
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    35
        echo '<h4>'. __( 'Type', 'option-tree' ) . ':</h4>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    36
        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>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    37
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    38
        echo '<ul class="docs-ul">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    39
        foreach( ot_option_types_array() as $key => $value )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    40
          echo '<li>' . $value . '</li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    41
        echo '</ul>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    42
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    43
        echo '<h4>'. __( 'Description', 'option-tree' ) . ':</h4>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    44
        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>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    45
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    46
        echo '<h4>'. __( 'Choices', 'option-tree' ) . ':</h4>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    47
        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>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    48
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    49
        echo '<h4>'. __( 'Settings', 'option-tree' ) . ':</h4>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    50
        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>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    51
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    52
        echo '<h4>'. __( 'Standard', 'option-tree' ) . ':</h4>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    53
        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>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    54
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    55
        echo '<h4>'. __( 'Rows', 'option-tree' ) . ':</h4>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    56
        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>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    57
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    58
        echo '<h4>'. __( 'Post Type', 'option-tree' ) . ':</h4>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    59
        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>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    60
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    61
        echo '<ul class="docs-ul">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    62
          echo '<li><code>post</code></li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    63
          echo '<li><code>page</code></li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    64
          echo '<li><code>attachment</code></li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    65
        echo '</ul>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    66
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    67
        echo '<h4>'. __( 'Taxonomy', 'option-tree' ) . ':</h4>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    68
        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>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    69
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    70
        echo '<h4>'. __( 'Min, Max, & Step', 'option-tree' ) . ':</h4>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    71
        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>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    72
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    73
        echo '<h4>'. __( 'CSS Class', 'option-tree' ) . ':</h4>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    74
        echo '<p>' . __( 'Add and optional class to any option type.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    75
        
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    76
        echo '<h4>'. __( 'Condition', 'option-tree' ) . ':</h4>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    77
        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>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    78
        
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    79
        echo '<h4>'. __( 'Operator', 'option-tree' ) . ':</h4>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    80
        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>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    81
        
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    82
      echo '</div>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    83
      
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    84
    echo '</div>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    85
    
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    86
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    87
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    88
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    89
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    90
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    91
 * ot_get_option() option type.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    92
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    93
 * This is a callback function to display text about ot_get_option().
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    94
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    95
 * @return    string
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    96
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    97
 * @access    public
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    98
 * @since     2.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    99
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   100
if ( ! function_exists( 'ot_type_option_types' ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   101
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   102
  function ot_type_option_types() {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   103
    
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   104
    /* format setting outer wrapper */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   105
    echo '<div class="format-setting type-textblock wide-desc">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   106
      
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   107
      /* description */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   108
      echo '<div class="description">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   109
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   110
        echo '<h4>'. __( 'Background', 'option-tree' ) . ':</h4>';    
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   111
        echo '<p>' . 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.', 'option-tree' ), '<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', 'option-tree' ) . ' <code>ot_type_background_size_choices</code>' ) . '</p>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   112
        
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   113
        echo '<h4>'. __( 'Border', 'option-tree' ) . ':</h4>';      
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   114
        echo '<p>' . sprintf( __( 'The Border option type is used to set width, unit, style, and color values. The text input excepts a numerical value and the unit 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. The style select lets you choose the border style. The default styles are %s, %s, %s, %s, %s, %s, %s, and %s. However, you can change them with the %s filter. The colorpicker saves a hexadecimal color code.', 'option-tree' ), '<code>px</code>', '<code>%</code>', '<code>em</code>', '<code>pt</code>', '<code>ot_recognized_border_unit_types</code>', '<code>hidden</code>', '<code>dashed</code>', '<code>solid</code>', '<code>double</code>', '<code>groove</code>', '<code>ridge</code>', '<code>inset</code>', '<code>outset</code>', '<code>ot_recognized_border_style_types</code>' ) . '</p>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   115
        
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   116
        echo '<h4>'. __( 'Box Shadow', 'option-tree' ) . ':</h4>';      
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   117
        echo '<p>' . sprintf( __( 'The Box Shadow option type is used to set %s, %s, %s, %s, %s, and %s values.', 'option-tree' ), '<code>inset</code>', '<code>offset-x</code>', '<code>offset-y</code>', '<code>blur-radius</code>', '<code>spread-radius</code>', '<code>color</code>' ) . '</p>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   118
        
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   119
        echo '<h4>'. __( 'Category Checkbox', 'option-tree' ) . ':</h4>';      
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   120
        echo '<p>' . __( '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.', 'option-tree' ) . '</p>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   121
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   122
        echo '<h4>'. __( 'Category Select', 'option-tree' ) . ':</h4>';    
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   123
        echo '<p>' . __( '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.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   124
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   125
        echo '<h4>'. __( 'Checkbox', 'option-tree' ) . ':</h4>';       
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   126
        echo '<p>' . __( '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.', 'option-tree' ) . '</p>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   127
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   128
        echo '<h4>'. __( 'Colorpicker', 'option-tree' ) . ':</h4>'; 
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   129
        echo '<p>' . __( 'The Colorpicker option type saves a hexadecimal color code for use in CSS. Use it to modify the color of something in your theme.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   130
        
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   131
        echo '<h4>'. __( 'Colorpicker Opacity', 'option-tree' ) . ':</h4>'; 
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   132
        echo '<p>' . sprintf( __( 'The Colorpicker Opacity option type saves a hexadecimal color code with an opacity value from %s to %s in increments of %s. Though the value is saved as hexadecimal, if used within the CSS option type the color and opacity values will be converted into a valid RGBA CSS value.', 'option-tree' ), '<code>0</code>', '<code>1</code>', '<code>0.01</code>' ) . '</p>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   133
        
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   134
        echo '<h4>'. __( 'CSS', 'option-tree' ) . ':</h4>'; 
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   135
        echo '<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 Theme Options.', 'option-tree' ), '<code>dynamic.css</code>', '<code>chmod</code>', '<code>0777</code>', '<code>0666</code>' ) . '</p>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   136
        
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   137
        echo '<p class="aside">' . 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 Theme Options are saved.', 'option-tree' ), '<code>demo_background</code>', '<code>dynamic.css</code>' ) . '</p>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   138
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   139
        echo '<p>'. __( 'Input', 'option-tree' ) . ':</p>'; 
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   140
        echo '<pre><code>body {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   141
  {{demo_background}}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   142
  background-color: {{demo_background|background-color}};
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   143
}</code></pre>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   144
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   145
        echo '<p>'. __( 'Output', 'option-tree' ) . ':</p>'; 
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   146
        echo '<pre><code>/* BEGIN demo_background */
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   147
body {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   148
  background: color image repeat attachment position;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   149
  background-color: color;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   150
}
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   151
/* END demo_background */</code></pre>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   152
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   153
        echo '<h4>'. __( 'Custom Post Type Checkbox', 'option-tree' ) . ':</h4>'; 
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   154
        echo '<p>' . 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.', 'option-tree' ), '<code>post_type</code>' ) . '</p>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   155
        
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   156
        echo '<h4>'. __( 'Custom Post Type Select', 'option-tree' ) . ':</h4>'; 
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   157
        echo '<p>' . 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.', 'option-tree' ), '<code>post_type</code>' ) . '</p>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   158
        
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   159
        echo '<h4>'. __( 'Date Picker', 'option-tree' ) . ':</h4>'; 
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   160
        echo '<p>' . __( '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.', 'option-tree' ) . '</p>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   161
        
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   162
        echo '<h4>'. __( 'Date Time Picker', 'option-tree' ) . ':</h4>'; 
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   163
        echo '<p>' . __( '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.', 'option-tree' ) . '</p>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   164
        
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   165
        echo '<h4>'. __( 'Dimension', 'option-tree' ) . ':</h4>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   166
        echo '<p>' . sprintf( __( 'The Dimension option type is used to set width and height values. The text inputs except numerical values 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.', 'option-tree' ), '<code>px</code>', '<code>%</code>', '<code>em</code>', '<code>pt</code>', '<code>ot_recognized_dimension_unit_types</code>' ) . '</p>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   167
        
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   168
        echo '<h4>'. __( 'Gallery', 'option-tree' ) . ':</h4>'; 
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   169
        echo '<p>' . __( '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.', 'option-tree' ) . '</p>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   170
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   171
        echo '<h4>'. __( 'Google Fonts', 'option-tree' ) . ':</h4>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   172
        echo '<p>' . 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.', 'option-tree' ), '<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>' ) . '</p>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   173
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   174
        echo '<h4>'. __( 'JavaScript', 'option-tree' ) . ':</h4>'; 
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   175
        echo '<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.', 'option-tree' ), '<code>ace.js</code>' ) . '</p>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   176
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   177
        echo '<h4>'. __( 'Link Color', 'option-tree' ) . ':</h4>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   178
        echo '<p>' . __( 'The Link Color option type is used to set all link color states.', 'option-tree' ) . '</p>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   179
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   180
        echo '<h4>'. __( 'List Item', 'option-tree' ) . ':</h4>'; 
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   181
        echo '<p>' . __( 'The List Item option type replaced the Slider option type and 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.', 'option-tree' ) . '</p>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   182
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   183
        echo '<h4>'. __( 'Measurement', 'option-tree' ) . ':</h4>'; 
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   184
        echo '<p>' . 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.', 'option-tree' ), '<code>px</code>', '<code>%</code>', '<code>em</code>', '<code>pt</code>', '<code>ot_measurement_unit_types</code>' ) . '</p>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   185
        
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   186
        echo '<p>' . sprintf( __( 'Example filter to add new units to the Measurement option type. Added to %s.', 'option-tree' ), '<code>functions.php</code>' ) . '</p>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   187
        echo '<pre><code>function filter_measurement_unit_types( $array, $field_id ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   188
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   189
  /* only run the filter on measurement with a field ID of my_measurement */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   190
  if ( $field_id == \'my_measurement\' ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   191
    $array[\'in\'] = \'inches\';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   192
    $array[\'ft\'] = \'feet\';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   193
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   194
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   195
  return $array;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   196
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   197
add_filter( \'ot_measurement_unit_types\', \'filter_measurement_unit_types\', 10, 2 );</code></pre>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   198
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   199
        echo '<p>' . __( 'Example filter to completely change the units in the Measurement option type. Added to <code>functions.php</code>.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   200
        echo '<pre><code>function filter_measurement_unit_types( $array, $field_id ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   201
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   202
  /* only run the filter on measurement with a field ID of my_measurement */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   203
  if ( $field_id == \'my_measurement\' ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   204
    $array = array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   205
      \'in\' => \'inches\',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   206
      \'ft\' => \'feet\'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   207
    );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   208
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   209
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   210
  return $array;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   211
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   212
add_filter( \'ot_measurement_unit_types\', \'filter_measurement_unit_types\', 10, 2 );</code></pre>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   213
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   214
        echo '<h4>'. __( 'Numeric Slider', 'option-tree' ) . ':</h4>'; 
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   215
        echo '<p>' . __( '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.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   216
        
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   217
        echo '<h4>'. __( 'On/Off', 'option-tree' ) . ':</h4>'; 
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   218
        echo '<p>' . 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.', 'option-tree' ), '<code>on</code>', '<code>off</code>' ) . '</p>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   219
        
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   220
        echo '<h4>'. __( 'Page Checkbox', 'option-tree' ) . ':</h4>'; 
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   221
        echo '<p>' . __( '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.', 'option-tree' ) . '</p>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   222
        
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   223
        echo '<h4>'. __( 'Page Select', 'option-tree' ) . ':</h4>'; 
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   224
        echo '<p>' . __( '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.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   225
        
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   226
        echo '<h4>'. __( 'Post Checkbox', 'option-tree' ) . ':</h4>'; 
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   227
        echo '<p>' . __( '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.', 'option-tree' ) . '</p>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   228
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   229
        echo '<h4>'. __( 'Post Select', 'option-tree' ) . ':</h4>'; 
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   230
        echo '<p>' . __( '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.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   231
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   232
        echo '<h4>'. __( 'Radio', 'option-tree' ) . ':</h4>'; 
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   233
        echo '<p>' . __( '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.', 'option-tree' ) . '</p>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   234
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   235
        echo '<h4>'. __( 'Radio Image', 'option-tree' ) . ':</h4>'; 
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   236
        echo '<p>' . 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.', 'option-tree' ), '<code>ot_radio_images</code>' ) . '</p>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   237
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   238
        echo '<p>' . __( 'This example executes the <code>ot_radio_images</code> filter on layout images attached to the <code>my_radio_images</code> field. Added to <code>functions.php</code>.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   239
        echo '<pre><code>function filter_radio_images( $array, $field_id ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   240
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   241
  /* only run the filter where the field ID is my_radio_images */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   242
  if ( $field_id == \'my_radio_images\' ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   243
    $array = array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   244
      array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   245
        \'value\'   => \'left-sidebar\',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   246
        \'label\'   => __( \'Left Sidebar\', \'option-tree\' ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   247
        \'src\'     => OT_URL . \'/assets/images/layout/left-sidebar.png\'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   248
      ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   249
      array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   250
        \'value\'   => \'right-sidebar\',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   251
        \'label\'   => __( \'Right Sidebar\', \'option-tree\' ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   252
        \'src\'     => OT_URL . \'/assets/images/layout/right-sidebar.png\'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   253
      )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   254
    );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   255
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   256
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   257
  return $array;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   258
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   259
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   260
add_filter( \'ot_radio_images\', \'filter_radio_images\', 10, 2 );</code></pre>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   261
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   262
        echo '<h4>'. __( 'Select', 'option-tree' ) . ':</h4>'; 
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   263
        echo '<p>' . __( 'The Select option type is used to list anything you want that would be chosen from a select list.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   264
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   265
        echo '<h4>'. __( 'Sidebar Select', 'option-tree' ) . ':</h4>';
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   266
        echo '<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.', 'option-tree' ), '<code>ot_recognized_sidebars</code>', '<code>ot_recognized_sidebars_{$field_id}</code>' ) . '</p>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   267
        echo '<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.', 'option-tree' ), '<code>footer-sidebar-$i</code>' ) . '</p>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   268
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   269
        echo '<h4>'. __( 'Slider', 'option-tree' ) . ':</h4>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   270
        echo '<p>' . __( 'The Slider option type is technically deprecated. Use the List Item option type instead, as it\'s infinitely more customizable. Typical use is for creating sliding image content.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   271
        
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   272
        echo '<h4>'. __( 'Social Links', 'option-tree' ) . ':</h4>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   273
        echo '<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.', 'option-tree' ), '<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>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   274
        
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   275
        echo '<h4>'. __( 'Spacing', 'option-tree' ) . ':</h4>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   276
        echo '<p>' . sprintf( __( 'The Spacing option type is used to set spacing values such as padding or margin in the form of top, right, bottom, and left. The text inputs except numerical values 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.', 'option-tree' ), '<code>px</code>', '<code>%</code>', '<code>em</code>', '<code>pt</code>', '<code>ot_recognized_spacing_unit_types</code>' ) . '</p>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   277
        
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   278
        echo '<h4>'. __( 'Tab', 'option-tree' ) . ':</h4>';      
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   279
        echo '<p>' . __( 'The Tab option type will break a section or metabox into tabbed content.', 'option-tree' ) . '</p>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   280
        
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   281
        echo '<h4>'. __( 'Tag Checkbox', 'option-tree' ) . ':</h4>';      
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   282
        echo '<p>' . __( '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.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   283
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   284
        echo '<h4>'. __( 'Tag Select', 'option-tree' ) . ':</h4>';    
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   285
        echo '<p>' . __( '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.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   286
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   287
        echo '<h4>'. __( 'Taxonomy Checkbox', 'option-tree' ) . ':</h4>';      
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   288
        echo '<p>' . __( '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.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   289
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   290
        echo '<h4>'. __( 'Taxonomy Select', 'option-tree' ) . ':</h4>';    
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   291
        echo '<p>' . __( '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.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   292
        
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   293
        echo '<h4>'. __( 'Text', 'option-tree' ) . ':</h4>'; 
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   294
        echo '<p>' . __( 'The Text option type is used to save string values. For example, any optional or required text that is of reasonably short character length.', 'option-tree' ) . '</p>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   295
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   296
        echo '<h4>'. __( 'Textarea', 'option-tree' ) . ':</h4>'; 
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   297
        echo '<p>' . 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.', 'option-tree' ), '<code>wpautop</code>', '<code>media_buttons</code>', '<code>tinymce</code>', '<code>quicktags</code>' ) . '</p>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   298
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   299
        echo '<p class="aside">' . __( 'Example filters to alter the Textarea option type. Added to <code>functions.php</code>.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   300
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   301
        echo '<p>' . __( 'This example keeps WordPress from executing the <code>wpautop</code> filter on the line breaks. The default is <code>true</code> which means it wraps line breaks with an HTML <code>p</code> tag.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   302
        echo '<pre><code>function filter_textarea_wpautop( $content, $field_id ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   303
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   304
  /* only run the filter on the textarea with a field ID of my_textarea */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   305
  if ( $field_id == \'my_textarea\' ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   306
    return false;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   307
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   308
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   309
  return $content;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   310
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   311
}
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   312
add_filter( \'ot_wpautop\', \'filter_textarea_wpautop\', 10, 2 );</code></pre>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   313
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   314
        echo '<p>' . __( 'This example keeps WordPress from executing the <code>media_buttons</code> filter on the textarea WYSIWYG. The default is <code>true</code> which means show the buttons.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   315
        echo '<pre><code>function filter_textarea_media_buttons( $content, $field_id ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   316
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   317
  /* only run the filter on the textarea with a field ID of my_textarea */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   318
  if ( $field_id == \'my_textarea\' ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   319
    return false;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   320
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   321
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   322
  return $content;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   323
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   324
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   325
add_filter( \'ot_media_buttons\', \'filter_textarea_media_buttons\', 10, 2 );</code></pre>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   326
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   327
        echo '<p>' . __( 'This example keeps WordPress from executing the <code>tinymce</code> filter on the textarea WYSIWYG. The default is <code>true</code> which means show the tinymce.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   328
        echo '<pre><code>function filter_textarea_tinymce( $content, $field_id ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   329
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   330
  /* only run the filter on the textarea with a field ID of my_textarea */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   331
  if ( $field_id == \'my_textarea\' ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   332
    return false;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   333
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   334
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   335
  return $content;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   336
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   337
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   338
add_filter( \'ot_tinymce\', \'filter_textarea_tinymce\', 10, 2 );</code></pre>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   339
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   340
        echo '<p>' . __( 'This example alters the <code>quicktags</code> filter on the textarea WYSIWYG. The default is <code>array( \'buttons\' => \'strong,em,link,block,del,ins,img,ul,ol,li,code,spell,close\' )</code> which means show those quicktags. It also means you can filter in your own custom quicktags.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   341
        echo '<pre><code>function filter_textarea_quicktags( $content, $field_id ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   342
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   343
  /* only run the filter on the textarea with a field ID of my_textarea */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   344
  if ( $field_id == \'my_textarea\' ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   345
    return array( \'buttons\' => \'strong,em,link,block,del,ins,img,ul,ol,li,code,more,spell,close,fullscreen\' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   346
  } else if ( $field_id == \'my_other_textarea\' ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   347
    return false; /* show no quicktags */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   348
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   349
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   350
  return $content;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   351
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   352
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   353
add_filter( \'ot_quicktags\', \'filter_textarea_quicktags\', 10, 1 );</code></pre>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   354
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   355
        echo '<h4>'. __( 'Textarea Simple', 'option-tree' ) . ':</h4>'; 
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   356
        echo '<p>' . __( '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.', 'option-tree' ) . '</p>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   357
        
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   358
        echo '<p class="aside">' . sprintf( __( 'This example tells WordPress to execute the %s filter on the line breaks. The default is %s which means it does not wraps line breaks with an HTML %s tag. Added to %s.', 'option-tree' ), '<code>wpautop</code>', '<code>false</code>', '<code>p</code>', '<code>functions.php</code>' ) . '</p>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   359
        echo '<pre><code>function filter_textarea_simple_wpautop( $content, $field_id ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   360
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   361
  /* only run the filter on the textarea with a field ID of my_textarea */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   362
  if ( $field_id == \'my_textarea\' ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   363
    return true;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   364
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   365
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   366
  return $content;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   367
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   368
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   369
add_filter( \'ot_wpautop\', \'filter_textarea_simple_wpautop\', 10, 2 );</code></pre>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   370
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   371
        echo '<h4>'. __( 'Textblock', 'option-tree' ) . ':</h4>'; 
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   372
        echo '<p>' . __( '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.', 'option-tree' ) . '</p>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   373
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   374
        echo '<h4>'. __( 'Textblock Titled', 'option-tree' ) . ':</h4>'; 
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   375
        echo '<p>' . __( '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.', 'option-tree' ) . '</p>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   376
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   377
        echo '<h4>'. __( 'Typography', 'option-tree' ) . ':</h4>';    
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   378
        echo '<p>' . 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.', 'option-tree' ), '<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', 'option-tree' ) . ' <code>ot_recognized_text_transformations</code>' ) . '</p>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   379
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   380
        echo '<p class="aside">' . __( 'This example would filter <code>ot_recognized_font_families</code> to build your own font stack. Added to <code>functions.php</code>.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   381
        echo '<pre><code>function filter_ot_recognized_font_families( $array, $field_id ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   382
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   383
  /* only run the filter when the field ID is my_google_fonts_headings */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   384
  if ( $field_id == \'my_google_fonts_headings\' ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   385
    $array = array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   386
      \'sans-serif\'    => \'sans-serif\',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   387
      \'open-sans\'     => \'"Open Sans", sans-serif\',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   388
      \'droid-sans\'    => \'"Droid Sans", sans-serif\'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   389
    );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   390
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   391
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   392
  return $array;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   393
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   394
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   395
add_filter( \'ot_recognized_font_families\', \'filter_ot_recognized_font_families\', 10, 2 );</code></pre>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   396
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   397
        echo '<h4>'. __( 'Upload', 'option-tree' ) . ':</h4>'; 
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   398
        echo '<p>' . 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 theme options 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.', 'option-tree' ), apply_filters( 'ot_upload_text', __( 'Send to OptionTree', 'option-tree' ) ), 'FTP' ) . '</p>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   399
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   400
      echo '</div>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   401
      
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   402
    echo '</div>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   403
    
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   404
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   405
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   406
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   407
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   408
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   409
 * ot_get_option() option type.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   410
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   411
 * This is a callback function to display text about ot_get_option().
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   412
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   413
 * @return    string
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   414
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   415
 * @access    public
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   416
 * @since     2.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   417
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   418
if ( ! function_exists( 'ot_type_ot_get_option' ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   419
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   420
  function ot_type_ot_get_option() {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   421
    
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   422
    /* format setting outer wrapper */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   423
    echo '<div class="format-setting type-textblock wide-desc">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   424
      
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   425
      /* description */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   426
      echo '<div class="description">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   427
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   428
        echo '<h4>'. __( 'Description', 'option-tree' ) . ':</h4>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   429
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   430
        echo '<p>' . __( 'This function returns a value from the "option_tree" array of saved values or the default value supplied. The returned value would be mixed. Meaning it could be a string, integer, boolean, or array.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   431
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   432
        echo '<h4>' . __( 'Usage', 'option-tree' ) . ':</h4>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   433
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   434
        echo '<p><code>&lt;?php ot_get_option( $option_id, $default ); ?&gt;</code></p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   435
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   436
        echo '<h4>' . __( 'Parameters', 'option-tree' ) . ':</h4>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   437
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   438
        echo '<code>$option_id</code>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   439
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   440
        echo '<p>(<em>' . __( 'string', 'option-tree' ) . '</em>) (<em>' . __( 'required', 'option-tree' ) . '</em>) ' . __( 'Enter the options unique identifier.', 'option-tree' ) . '<br />' . __( 'Default:', 'option-tree' ) . ' <em>' . __( 'None', 'option-tree' ) . '</em></p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   441
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   442
        echo '<code>$default</code>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   443
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   444
        echo '<p>(<em>' . __( 'string', 'option-tree' ) . '</em>) (<em>' . __( 'optional', 'option-tree' ) . '</em>) ' . __( 'Enter a default return value. This is just incase the request returns null.', 'option-tree' ) . '<br />' . __( 'Default', 'option-tree' ) . ': <em>' . __( 'None', 'option-tree' ) . '</em></p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   445
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   446
      echo '</div>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   447
      
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   448
    echo '</div>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   449
    
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   450
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   451
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   452
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   453
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   454
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   455
 * get_option_tree() option type.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   456
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   457
 * This is a callback function to display text about get_option_tree().
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   458
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   459
 * @return    string
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   460
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   461
 * @access    public
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   462
 * @since     2.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   463
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   464
if ( ! function_exists( 'ot_type_get_option_tree' ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   465
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   466
  function ot_type_get_option_tree() {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   467
    
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   468
    /* format setting outer wrapper */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   469
    echo '<div class="format-setting type-textblock wide-desc">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   470
      
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   471
      /* description */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   472
      echo '<div class="description">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   473
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   474
        echo '<p class="deprecated">' . __( 'This function has been deprecated. That means it has been replaced by a new function or is no longer supported, and may be removed from future versions. All code that uses this function should be converted to use its replacement.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   475
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   476
        echo '<p>' . __( 'Use', 'option-tree' ) . '<code>ot_get_option()</code>' . __( 'instead', 'option-tree' ) . '.</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   477
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   478
        echo '<h4>'. __( 'Description', 'option-tree' ) . ':</h4>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   479
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   480
        echo '<p>' . __( 'This function returns, or echos if asked, a value from the "option_tree" array of saved values.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   481
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   482
        echo '<h4>' . __( 'Usage', 'option-tree' ) . ':</h4>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   483
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   484
        echo '<p><code>&lt;?php get_option_tree( $item_id, $options, $echo, $is_array, $offset ); ?&gt;</code></p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   485
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   486
        echo '<h4>' . __( 'Parameters', 'option-tree' ) . ':</h4>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   487
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   488
        echo '<code>$item_id</code>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   489
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   490
        echo '<p>(<em>' . __( 'string', 'option-tree' ) . '</em>) (<em>' . __( 'required', 'option-tree' ) . '</em>) ' . __( 'Enter a unique Option Key to get a returned value or array.', 'option-tree' ) . '<br />' . __( 'Default:', 'option-tree' ) . ' <em>' . __( 'None', 'option-tree' ) . '</em></p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   491
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   492
        echo '<code>$options</code>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   493
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   494
        echo '<p>(<em>' . __( 'array', 'option-tree' ) . '</em>) (<em>' . __( 'optional', 'option-tree' ) . '</em>) ' . __( 'Used to cut down on database queries in template files.', 'option-tree' ) . '<br />' . __( 'Default', 'option-tree' ) . ': <em>' . __( 'None', 'option-tree' ) . '</em></p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   495
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   496
        echo '<code>$echo</code>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   497
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   498
        echo '<p>(<em>' . __( 'boolean', 'option-tree' ) . '</em>) (<em>' . __( 'optional', 'option-tree' ) . '</em>) ' . __( 'Echo the output.', 'option-tree' ) . '<br />' . __( 'Default', 'option-tree' ) . ': FALSE</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   499
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   500
        echo '<code>$is_array</code>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   501
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   502
        echo '<p>(<em>' . __( 'boolean', 'option-tree' ) . '</em>) (<em>' . __( 'optional', 'option-tree' ) . '</em>) ' . __( 'Used to indicate the $item_id is an array of values.', 'option-tree' ) . '<br />' . __( 'Default', 'option-tree' ) . ': FALSE</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   503
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   504
        echo '<code>$offset</code>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   505
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   506
        echo '<p>(<em>' . __( 'integer', 'option-tree' ) . '</em>) (<em>' . __( 'optional', 'option-tree' ) . '</em>) ' . __( 'Numeric offset key for the $item_id array, -1 will return all values (an array starts at 0).', 'option-tree' ) . '<br />' . __( 'Default', 'option-tree' ) . ': -1</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   507
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   508
      echo '</div>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   509
      
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   510
    echo '</div>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   511
    
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   512
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   513
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   514
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   515
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   516
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   517
 * Examples option type.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   518
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   519
 * @return    string
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   520
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   521
 * @access    public
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   522
 * @since     2.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   523
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   524
if ( ! function_exists( 'ot_type_examples' ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   525
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   526
  function ot_type_examples() {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   527
    
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   528
    /* format setting outer wrapper */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   529
    echo '<div class="format-setting type-textblock wide-desc">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   530
      
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   531
      /* description */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   532
      echo '<div class="description">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   533
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   534
        echo '<p class="aside">' . __( 'If you\'re using the plugin version of OptionTree it is highly recommended to include a <code>function_exists</code> check in your code, as described in the examples below. If you\'ve integrated OptionTree directly into your themes root directory, you will <strong>not</strong> need to wrap your code with <code>function_exists</code>, as you\'re guaranteed to have the <code>ot_get_option()</code> function available.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   535
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   536
        echo '<h4>' . __( 'String Examples', 'option-tree' ) . ':</h4>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   537
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   538
        echo '<p>' . __( 'Returns the value of <code>test_input</code>.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   539
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   540
        echo '<pre><code>if ( function_exists( \'ot_get_option\' ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   541
  $test_input = ot_get_option( \'test_input\' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   542
}</code></pre>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   543
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   544
        echo '<p>' . __( 'Returns the value of <code>test_input</code>, but also has a default value if it returns empty.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   545
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   546
        echo '<pre><code>if ( function_exists( \'ot_get_option\' ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   547
  $test_input = ot_get_option( \'test_input\', \'default input value goes here.\' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   548
}</code></pre>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   549
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   550
        echo '<h4>' . __( 'Array Examples', 'option-tree' ) . ':</h4>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   551
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   552
        echo '<p>' . __( 'Assigns the value of <code>navigation_ids</code> to the variable <code>$ids</code>. It then echos an unordered list of links (navigation) using <code>wp_list_pages()</code>.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   553
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   554
        echo '<pre><code>if ( function_exists( \'ot_get_option\' ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   555
  /* get an array of page id\'s */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   556
  $ids = ot_get_option( \'navigation_ids\', array() );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   557
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   558
  /* echo custom navigation using wp_list_pages() */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   559
  if ( ! empty( $ids ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   560
    echo \'&lt;ul&gt;\';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   561
    wp_list_pages(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   562
      array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   563
        \'include\'   => $ids,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   564
        \'title_li\'  => \'\'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   565
      )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   566
    );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   567
    echo \'&lt;/ul&gt;\';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   568
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   569
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   570
}</code></pre>';   
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   571
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   572
        echo '<p>' . __( 'The next two examples demonstrate how to use the <strong>Measurement</strong> option type. The Measurement option type is an array with two key/value pairs. The first is the value of measurement and the second is the unit of measurement.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   573
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   574
        echo '<pre><code>if ( function_exists( \'ot_get_option\' ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   575
  /* get the array */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   576
  $measurement = ot_get_option( \'measurement_option_type_id\' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   577
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   578
  /* only echo values if they actually exist, else echo some default value */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   579
  if ( isset( measurement[0] ) && $measurement[1] ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   580
    echo $measurement[0].$measurement[1];
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   581
  } else {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   582
    echo \'10px\';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   583
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   584
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   585
}</code></pre>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   586
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   587
        echo '<pre><code>if ( function_exists( \'ot_get_option\' ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   588
  /* get the array, and have a default just incase */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   589
  $measurement = ot_get_option( \'measurement_option_type_id\', array( \'10\', \'px\' ) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   590
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   591
  /* implode array into a string value */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   592
  if ( ! empty( measurement ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   593
    echo implode( \'\', $measurement );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   594
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   595
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   596
}</code></pre>';    
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   597
          
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   598
        echo '<p>' . __( 'This example displays a very basic slider loop.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   599
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   600
        echo '<pre><code>if ( function_exists( \'ot_get_option\' ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   601
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   602
  /* get the slider array */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   603
  $slides = ot_get_option( \'my_slider\', array() );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   604
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   605
  if ( ! empty( $slides ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   606
    foreach( $slides as $slide ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   607
      echo \'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   608
      &lt;li&gt;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   609
        &lt;a href="\' . $slide[\'link\'] . \'"&gt;&lt;img src="\' . $slide[\'image\'] . \'" alt="\' . $slide[\'title\'] . \'" /&gt;&lt;/a&gt;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   610
        &lt;div class="description">\' . $slide[\'description\'] . \'&lt;/div&gt;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   611
      &lt;/li&gt;\';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   612
    }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   613
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   614
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   615
}</code></pre>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   616
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   617
      echo '</div>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   618
      
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   619
    echo '</div>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   620
    
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   621
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   622
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   623
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   624
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   625
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   626
 * Layouts Overview option type.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   627
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   628
 * @return    string
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   629
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   630
 * @access    public
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   631
 * @since     2.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   632
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   633
if ( ! function_exists( 'ot_type_layouts_overview' ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   634
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   635
  function ot_type_layouts_overview() {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   636
    
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   637
    /* format setting outer wrapper */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   638
    echo '<div class="format-setting type-textblock wide-desc">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   639
      
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   640
      /* description */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   641
      echo '<div class="description">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   642
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   643
        echo '<h4>'. __( 'It\'s Super Simple', 'option-tree' ) . '</h4>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   644
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   645
        echo '<p>' . __( 'Layouts make your theme awesome! With theme options data that you can save/import/export you can package themes with different color variations, or make it easy to do A/B testing on text and so much more. Basically, you save a snapshot of your data as a layout.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   646
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   647
        echo '<p>' . __( 'Once you have created all your different layouts, or theme variations, you can save them to a separate text file for repackaging with your theme. Alternatively, you could just make different variations for yourself and change your theme with the click of a button, all without deleting your previous options data.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   648
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   649
        echo '<p class="aside">' . __( ' Adding a layout is ridiculously easy, follow these steps and you\'ll be on your way to having a WordPress super theme.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   650
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   651
        echo '<h4>' . __( 'For Developers', 'option-tree' ) . ':</h4>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   652
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   653
        echo '<h5>' . __( 'Creating a Layout', 'option-tree' ) . ':</h5>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   654
        echo '<ul class="docs-ul">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   655
          echo '<li>'. __( 'Go to the <code>OptionTre->Settings->Layouts</code> tab.', 'option-tree' ) . '</li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   656
          echo '<li>' . __( 'Enter a name for your layout in the text field and hit "Save Layouts", you\'ve created your first layout.', 'option-tree' ) . '</li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   657
          echo '<li>' . __( 'Adding a new layout is as easy as repeating the steps above.', 'option-tree' ) . '</li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   658
        echo '</ul>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   659
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   660
        echo '<h5>' . __( 'Activating a Layout', 'option-tree' ) . ':</h5>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   661
        echo '<ul class="docs-ul">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   662
          echo '<li>'. __( 'Go to the <code>OptionTre->Settings->Layouts</code> tab.', 'option-tree' ) . '</li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   663
          echo '<li>' . __( 'Click on the activate layout button in the actions list.', 'option-tree' ) . '</li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   664
        echo '</ul>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   665
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   666
        echo '<h5>' . __( 'Deleting a Layout', 'option-tree' ) . ':</h5>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   667
        echo '<ul class="docs-ul">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   668
          echo '<li>'. __( 'Go to the <code>OptionTre->Settings->Layouts</code> tab.', 'option-tree' ) . '</li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   669
          echo '<li>' . __( 'Click on the delete layout button in the actions list.', 'option-tree' ) . '</li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   670
        echo '</ul>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   671
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   672
        echo '<h5>' . __( 'Edit Layout Data', 'option-tree' ) . ':</h5>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   673
        echo '<ul class="docs-ul">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   674
          echo '<li>'. __( 'Go to the <code>Appearance->Theme Options</code> page.', 'option-tree' ) . '</li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   675
          echo '<li>' . __( 'Modify and save your theme options and the layout will be updated automatically.', 'option-tree' ) . '</li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   676
          echo '<li>' . __( 'Saving theme options data will update the currently active layout, so before you start saving make sure you want to modify the current layout.', 'option-tree' ) . '</li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   677
          echo '<li>' . __( 'If you want to edit a new layout, first create it then save your theme options.', 'option-tree' ) . '</li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   678
        echo '</ul>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   679
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   680
        echo '<h4>' . __( 'End-Users Mode', 'option-tree' ) . ':</h4>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   681
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   682
        echo '<h5>' . __( 'Creating a Layout', 'option-tree' ) . ':</h5>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   683
        echo '<ul class="docs-ul">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   684
          echo '<li>'. __( 'Go to the <code>Appearance->Theme Options</code> page.', 'option-tree' ) . '</li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   685
          echo '<li>' . __( 'Enter a name for your layout in the text field and hit "New Layout", you\'ve created your first layout.', 'option-tree' ) . '</li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   686
          echo '<li>' . __( 'Adding a new layout is as easy as repeating the steps above.', 'option-tree' ) . '</li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   687
        echo '</ul>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   688
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   689
        echo '<h5>' . __( 'Activating a Layout', 'option-tree' ) . ':</h5>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   690
        echo '<ul class="docs-ul">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   691
          echo '<li>'. __( 'Go to the <code>Appearance->Theme Options</code> page.', 'option-tree' ) . '</li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   692
          echo '<li>' . __( 'Choose a layout from the select list and click the "Activate Layout" button.', 'option-tree' ) . '</li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   693
        echo '</ul>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   694
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   695
        echo '<h5>' . __( 'Deleting a Layout', 'option-tree' ) . ':</h5>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   696
        echo '<ul class="docs-ul">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   697
          echo '<li>'. __( 'End-Users mode does not allow deleting layouts.', 'option-tree' ) . '</li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   698
        echo '</ul>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   699
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   700
        echo '<h5>' . __( 'Edit Layout Data', 'option-tree' ) . ':</h5>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   701
        echo '<ul class="docs-ul">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   702
          echo '<li>'. __( 'Go to the <code>Appearance->Theme Options</code> tab.', 'option-tree' ) . '</li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   703
          echo '<li>' . __( 'Modify and save your theme options and the layout will be updated automatically.', 'option-tree' ) . '</li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   704
          echo '<li>' . __( 'Saving theme options data will update the currently active layout, so before you start saving make sure you want to modify the current layout.', 'option-tree' ) . '</li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   705
        echo '</ul>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   706
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   707
      echo '</div>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   708
      
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   709
    echo '</div>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   710
    
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   711
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   712
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   713
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   714
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   715
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   716
 * Meta Boxes option type.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   717
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   718
 * @return    string
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   719
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   720
 * @access    public
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   721
 * @since     2.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   722
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   723
if ( ! function_exists( 'ot_type_meta_boxes' ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   724
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   725
  function ot_type_meta_boxes() {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   726
    
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   727
    /* format setting outer wrapper */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   728
    echo '<div class="format-setting type-textblock wide-desc">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   729
      
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   730
      /* description */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   731
      echo '<div class="description">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   732
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   733
        echo '<h4>'. __( 'How-to-guide', 'option-tree' ) . '</h4>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   734
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   735
        echo '<p>' . __( 'There are a few simple steps you need to take in order to use OptionTree\'s built in Meta Box API. In the code below I\'ll show you a basic demo of how to create your very own custom meta box using any number of the option types you have at your disposal. If you would like to see some demo code, there is a directory named <code>theme-mode</code> inside the <code>assets</code> directory that contains a file named <code>demo-meta-boxes.php</code> you can reference.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   736
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   737
        echo '<p>' . __( 'It\'s important to note that Meta Boxes do not support WYSIWYG editors at this time and if you set one of your options to Textarea it will automatically revert to a Textarea Simple until a valid solution is found. WordPress released this statement regarding the wp_editor() function:', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   738
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   739
        echo '<blockquote>' . __( 'Once instantiated, the WYSIWYG editor cannot be moved around in the DOM. What this means in practical terms, is that you cannot put it in meta-boxes that can be dragged and placed elsewhere on the page.', 'option-tree' ) . '</blockquote>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   740
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   741
        echo '<h5>' . __( 'Create and include your custom meta boxes file.', 'option-tree' ) . '</h5>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   742
        echo '<ul class="docs-ul">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   743
          echo '<li>'. __( 'Create a file and name it anything you want, maybe <code>meta-boxes.php</code>.', 'option-tree' ) . '</li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   744
          echo '<li>'. __( 'As well, you\'ll probably want to create a directory named <code>includes</code> to put your <code>meta-boxes.php</code> into which will help keep you file structure nice and tidy.', 'option-tree' ) . '</li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   745
          echo '<li>' . __( 'Add the following code to your <code>functions.php</code>.', 'option-tree' ) . '</li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   746
        echo '</ul>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   747
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   748
        echo '<pre><code>/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   749
 * Meta Boxes
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   750
 */
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   751
require( trailingslashit( get_template_directory() ) . \'includes/meta-boxes.php\' );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   752
</code></pre>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   753
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   754
        echo '<ul class="docs-ul">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   755
          echo '<li>' . __( 'Add a variation of the following code to your <code>meta-boxes.php</code>. You\'ll obviously need to fill it in with all your custom array values. It\'s important to note here that we use the <code>admin_init</code> filter because if you were to call the <code>ot_register_meta_box</code> function before OptionTree was loaded the sky would fall on your head.', 'option-tree' ) . '</li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   756
        echo '</ul>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   757
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   758
        echo "<pre><code>/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   759
 * Initialize the meta boxes. 
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   760
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   761
add_action( 'admin_init', 'custom_meta_boxes' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   762
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   763
function custom_meta_boxes() {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   764
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   765
  &#36;my_meta_box = array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   766
    'id'        => 'my_meta_box',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   767
    'title'     => 'My Meta Box',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   768
    'desc'      => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   769
    'pages'     => array( 'post' ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   770
    'context'   => 'normal',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   771
    'priority'  => 'high',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   772
    'fields'    => array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   773
      array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   774
        'id'          => 'background',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   775
        'label'       => 'Background',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   776
        'desc'        => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   777
        'std'         => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   778
        'type'        => 'background',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   779
        'class'       => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   780
        'choices'     => array()
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   781
      )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   782
    )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   783
  );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   784
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   785
  ot_register_meta_box( &#36;my_meta_box );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   786
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   787
}</code></pre>";  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   788
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   789
      echo '</div>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   790
      
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   791
    echo '</div>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   792
    
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   793
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   794
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   795
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   796
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   797
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   798
 * Theme Mode option type.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   799
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   800
 * @return    string
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   801
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   802
 * @access    public
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   803
 * @since     2.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   804
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   805
if ( ! function_exists( 'ot_type_theme_mode' ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   806
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   807
  function ot_type_theme_mode() {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   808
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   809
    /* format setting outer wrapper */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   810
    echo '<div class="format-setting type-textblock wide-desc">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   811
      
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   812
      /* description */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   813
      echo '<div class="description">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   814
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   815
        echo '<h4>'. __( 'How-to-guide', 'option-tree' ) . '</h4>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   816
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   817
        echo '<p>' . __( 'There are a few simple steps you need to take in order to use OptionTree as a theme included module. In the code below I\'ll show you a basic demo of how to include the entire plugin as a module, which will allow you to have the most up-to-date version of OptionTree without ever needing to hack the core of the plugin. If you would like to see some demo code, there is a directory named <code>theme-mode</code> inside the <code>assets</code> directory that contains a file named <code>demo-theme-options.php</code> you can reference.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   818
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   819
        echo '<h5>' . __( 'Step 1: Include the plugin & turn on theme mode.', 'option-tree' ) . '</h5>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   820
        echo '<ul class="docs-ul">';
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   821
          echo '<li>' . sprintf( __( 'Download the latest version of %s and unarchive the %s directory.', 'option-tree' ), '<a href="http://wordpress.org/extend/plugins/option-tree/" rel="nofollow" target="_blank">' . __( 'OptionTree', 'option-tree' ) . '</a>', '<code>.zip</code>' ) . '</li>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   822
          echo '<li>' . sprintf( __( 'Put the %s directory in the root of your theme. For example, the server path would be %s.', 'option-tree' ), '<code>option-tree</code>', '<code>/wp-content/themes/theme-name/option-tree/</code>' ) . '</li>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   823
          echo '<li>' . sprintf( __( 'Add the following code to the beginning of your %s.', 'option-tree' ), '<code>functions.php</code>' ) . '</li>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   824
        echo '</ul>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   825
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   826
        echo '<pre><code>/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   827
 * Required: set \'ot_theme_mode\' filter to true.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   828
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   829
add_filter( \'ot_theme_mode\', \'__return_true\' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   830
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   831
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   832
 * Required: include OptionTree.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   833
 */
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   834
require( trailingslashit( get_template_directory() ) . \'option-tree/ot-loader.php\' );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   835
</code></pre>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   836
        
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   837
        echo '<p>' . sprintf( __( 'For a list of all the OptionTree UI display filters refer to the %s file found in the %s directory of this plugin. This file is the starting point for developing themes with Theme Mode.', 'option-tree' ), '<code>demo-functions.php</code>', '<code>/assets/theme-mode/</code>' ) . '</p>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   838
        
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   839
        echo '<p class="aside">' . __( 'You now have OptionTree built into your theme and anytime an update is available replace the old version with the new one.', 'option-tree' ) . '</p>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   840
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   841
        echo '<h5>' . __( 'Step 2: Create Theme Options without using the UI Builder.', 'option-tree' ) . '</h5>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   842
        echo '<ul class="docs-ul">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   843
          echo '<li>'. __( 'Create a file and name it anything you want, maybe <code>theme-options.php</code>, or use the built in file export to create it for you. Remember, you should always check the file for errors before including it in your theme.', 'option-tree' ) . '</li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   844
          echo '<li>'. __( 'As well, you\'ll probably want to create a directory named <code>includes</code> to put your <code>theme-options.php</code> into which will help keep you file structure nice and tidy.', 'option-tree' ) . '</li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   845
          echo '<li>' . __( 'Add the following code to your <code>functions.php</code>.', 'option-tree' ) . '</li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   846
        echo '</ul>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   847
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   848
        echo '<pre><code>/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   849
 * Theme Options
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   850
 */
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   851
require( trailingslashit( get_template_directory() ) . \'includes/theme-options.php\' );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   852
</code></pre>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   853
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   854
        echo '<ul class="docs-ul">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   855
          echo '<li>' . __( 'Add a variation of the following code to your <code>theme-options.php</code>. You\'ll obviously need to fill it in with all your custom array values for contextual help (optional), sections (required), and settings (required).', 'option-tree' ) . '</li>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   856
        echo '</ul>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   857
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   858
        echo '<p>' . __( 'The code below is a boilerplate to get your started. For a full list of the available option types click the "Option Types" tab above. Also a quick note, you don\'t need to put OptionTree in theme mode to manually create options but you will want to hide the docs and settings as each time you load the admin area the settings be written over with the code below if they\'ve changed in any way. However, this ensures your settings do not get tampered with by the end-user.', 'option-tree' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   859
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   860
        echo "<pre><code>/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   861
 * Initialize the options before anything else. 
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   862
 */
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   863
add_action( 'init', 'custom_theme_options', 1 );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   864
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   865
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   866
 * Build the custom settings & update OptionTree.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   867
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   868
function custom_theme_options() {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   869
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   870
  /* OptionTree is not loaded yet, or this is not an admin request */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   871
  if ( ! function_exists( 'ot_settings_id' ) || ! is_admin() )
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   872
    return false;
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   873
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   874
  /**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   875
   * Get a copy of the saved settings array. 
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   876
   */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   877
  &#36;saved_settings = get_option( 'option_tree_settings', array() );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   878
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   879
  /**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   880
   * Custom settings array that will eventually be 
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   881
   * passes to the OptionTree Settings API Class.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   882
   */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   883
  &#36;custom_settings = array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   884
    'contextual_help' => array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   885
      'content'       => array( 
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   886
        array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   887
          'id'        => 'general_help',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   888
          'title'     => 'General',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   889
          'content'   => '&lt;p&gt;Help content goes here!&lt;/p&gt;'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   890
        )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   891
      ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   892
      'sidebar'       => '&lt;p&gt;Sidebar content goes here!&lt;/p&gt;',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   893
    ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   894
    'sections'        => array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   895
      array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   896
        'id'          => 'general',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   897
        'title'       => 'General'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   898
      )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   899
    ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   900
    'settings'        => array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   901
      array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   902
        'id'          => 'my_checkbox',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   903
        'label'       => 'Checkbox',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   904
        'desc'        => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   905
        'std'         => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   906
        'type'        => 'checkbox',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   907
        'section'     => 'general',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   908
        'class'       => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   909
        'choices'     => array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   910
          array( 
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   911
            'value' => 'yes',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   912
            'label' => 'Yes' 
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   913
          )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   914
        )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   915
      ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   916
      array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   917
        'id'          => 'my_layout',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   918
        'label'       => 'Layout',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   919
        'desc'        => 'Choose a layout for your theme',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   920
        'std'         => 'right-sidebar',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   921
        'type'        => 'radio-image',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   922
        'section'     => 'general',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   923
        'class'       => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   924
        'choices'     => array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   925
          array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   926
            'value'   => 'left-sidebar',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   927
            'label'   => 'Left Sidebar',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   928
            'src'     => OT_URL . '/assets/images/layout/left-sidebar.png'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   929
          ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   930
          array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   931
            'value'   => 'right-sidebar',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   932
            'label'   => 'Right Sidebar',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   933
            'src'     => OT_URL . '/assets/images/layout/right-sidebar.png'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   934
          ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   935
          array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   936
            'value'   => 'full-width',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   937
            'label'   => 'Full Width (no sidebar)',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   938
            'src'     => OT_URL . '/assets/images/layout/full-width.png'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   939
          ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   940
          array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   941
            'value'   => 'dual-sidebar',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   942
            'label'   => __( 'Dual Sidebar', 'option-tree' ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   943
            'src'     => OT_URL . '/assets/images/layout/dual-sidebar.png'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   944
          ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   945
          array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   946
            'value'   => 'left-dual-sidebar',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   947
            'label'   => __( 'Left Dual Sidebar', 'option-tree' ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   948
            'src'     => OT_URL . '/assets/images/layout/left-dual-sidebar.png'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   949
          ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   950
          array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   951
            'value'   => 'right-dual-sidebar',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   952
            'label'   => __( 'Right Dual Sidebar', 'option-tree' ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   953
            'src'     => OT_URL . '/assets/images/layout/right-dual-sidebar.png'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   954
          )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   955
        )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   956
      ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   957
      array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   958
        'id'          => 'my_slider',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   959
        'label'       => 'Images',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   960
        'desc'        => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   961
        'std'         => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   962
        'type'        => 'list-item',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   963
        'section'     => 'general',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   964
        'class'       => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   965
        'choices'     => array(),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   966
        'settings'    => array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   967
          array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   968
            'id'      => 'slider_image',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   969
            'label'   => 'Image',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   970
            'desc'    => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   971
            'std'     => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   972
            'type'    => 'upload',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   973
            'class'   => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   974
            'choices' => array()
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   975
          ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   976
          array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   977
            'id'      => 'slider_link',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   978
            'label'   => 'Link to Post',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   979
            'desc'    => 'Enter the posts url.',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   980
            'std'     => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   981
            'type'    => 'text',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   982
            'class'   => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   983
            'choices' => array()
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   984
          ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   985
          array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   986
            'id'      => 'slider_description',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   987
            'label'   => 'Description',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   988
            'desc'    => 'This text is used to add fancy captions in the slider.',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   989
            'std'     => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   990
            'type'    => 'textarea',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   991
            'class'   => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   992
            'choices' => array()
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   993
          )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   994
        )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   995
      )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   996
    )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   997
  );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   998
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   999
  /* settings are not the same update the DB */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1000
  if ( &#36;saved_settings !== &#36;custom_settings ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1001
    update_option( 'option_tree_settings', &#36;custom_settings ); 
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1002
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1003
  
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1004
  /* Lets OptionTree know the UI Builder is being overridden */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1005
  global &#36;ot_has_custom_theme_options;
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1006
  &#36;ot_has_custom_theme_options = true;
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1007
  
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1008
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1009
</code></pre>";
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1010
        
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1011
      echo '</div>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1012
      
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1013
    echo '</div>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1014
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1015
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1016
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1017
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1018
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1019
/* End of file ot-functions-docs-page.php */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1020
/* Location: ./includes/ot-functions-docs-page.php */