wp/wp-content/plugins/option-tree/includes/ot-functions-docs-page.php
author ymh <ymh.work@gmail.com>
Mon, 08 Sep 2025 19:44:41 +0200
changeset 23 417f20492bf7
parent 11 bf1778c34b9a
permissions -rwxr-xr-x
Update Docker configuration and plugin versions - Upgrade MariaDB from 10.6 to 11 with auto-upgrade support - Add WordPress debug environment variable to FPM container - Update PHP-FPM Dockerfile base image - Update Include Mastodon Feed plugin with bug fixes and improvements - Update Portfolio plugin (v2.58) with latest translations and demo data enhancements - Remove old README.md from Mastodon Feed plugin 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
     1
<?php
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
/**
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
     3
 * OptionTree Documentation Page Functions.
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
 *
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
     5
 * @package OptionTree
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
     8
if ( ! defined( 'OT_VERSION' ) ) {
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
     9
	exit( 'No direct script access allowed' );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    12
if ( ! function_exists( 'ot_type_creating_options' ) ) {
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    13
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    14
	/**
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    15
	 * Creating Options option type.
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    16
	 *
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    17
	 * @access public
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    18
	 * @since  2.0
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    19
	 */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    20
	function ot_type_creating_options() {
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    21
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    22
		// Format setting outer wrapper.
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    23
		echo '<div class="format-setting type-textblock wide-desc">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    24
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    25
		// Description.
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    26
		echo '<div class="description">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    27
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    28
		echo '<h4>' . esc_html__( 'Label', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    29
		echo '<p>' . esc_html__( 'The Label field should be a short but descriptive block of text 100 characters or less with no HTML.', 'option-tree' ) . '</p>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    30
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    31
		echo '<h4>' . esc_html__( 'ID', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    32
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    33
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    34
		echo '<h4>' . esc_html__( 'Type', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    35
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    36
		/* translators: %s: option type tab */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    37
		$string = esc_html__( '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 %s tab to the left.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    38
		echo '<p>' . sprintf( $string, '<code>' . esc_html__( 'Option Types', 'option-tree' ) . '</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    39
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    40
		echo '<ul class="docs-ul">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    41
		foreach ( ot_option_types_array() as $key => $value ) {
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    42
			echo '<li>' . $value . '</li>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    43
		}
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    44
		echo '</ul>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    45
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    46
		echo '<h4>' . esc_html__( 'Description', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    47
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    48
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    49
		echo '<h4>' . esc_html__( 'Choices', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    50
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    51
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    52
		echo '<h4>' . esc_html__( 'Settings', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    53
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    54
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    55
		echo '<h4>' . esc_html__( 'Standard', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    56
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    57
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    58
		echo '<h4>' . esc_html__( 'Rows', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    59
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    60
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    61
		echo '<h4>' . esc_html__( 'Post Type', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    62
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    63
		/* translators: %1$s: example value, %2$s: post_type, %3$s: using any as a value */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    64
		$string = esc_html__( 'Add a comma separated list of post type like %1$s. 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 %2$s. At this time %3$s does not seem to return results properly and is something I plan on looking into.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    65
		echo '<p>' . sprintf( $string, '<code>post,page</code>', '<code>post_type</code>', '<code>any</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    66
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    67
		echo '<ul class="docs-ul">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    68
		echo '<li><code>post</code></li>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    69
		echo '<li><code>page</code></li>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    70
		echo '<li><code>attachment</code></li>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    71
		echo '</ul>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    72
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    73
		echo '<h4>' . esc_html__( 'Taxonomy', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    74
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    75
		/* translators: %s: example value */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    76
		$string = esc_html__( 'Add a comma separated list of any registered taxonomy like %s. This will only affect the following option types: Taxonomy Checkbox, & Taxonomy Select.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    77
		echo '<p>' . sprintf( $string, '<code>category,post_tag</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    78
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    79
		echo '<h4>' . esc_html__( 'Min, Max, & Step', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    80
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    81
		/* translators: %1$s: format, %2$s: range, %3$s: interval minimum */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    82
		$string = esc_html__( 'Add a comma separated list of options in the following format %1$s (slide from %2$s in intervals of %3$s). The three values represent the minimum, maximum, and step options and will only affect the Numeric Slider option type.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    83
		echo '<p>' . sprintf( $string, '<code>0,100,1</code>', '<code>0-100</code>', '<code>1</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    84
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    85
		echo '<h4>' . esc_html__( 'CSS Class', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    86
		echo '<p>' . esc_html__( 'Add and optional class to any option type.', 'option-tree' ) . '</p>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    87
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    88
		echo '<h4>' . esc_html__( 'Condition', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    89
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    90
		/* translators: %1$s: example (value) placeholder, %2$s: list of condition examples */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    91
		$string = esc_html__( '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, %1$s is a placeholder for your condition, which can be in the form of %2$s.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    92
		echo '<p>' . sprintf( $string, '<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>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    93
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    94
		echo '<h4>' . esc_html__( 'Operator', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    95
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    96
		/* translators: %1$s: and value, %2$s: or value */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    97
		$string = esc_html__( 'Choose the logical operator to compute the result of the conditions. Your options are %1$s and %2$s.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    98
		echo '<p>' . sprintf( $string, '<code>and</code>', '<code>or</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    99
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   100
		echo '</div>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   101
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   102
		echo '</div>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   103
	}
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   104
}
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   105
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   106
if ( ! function_exists( 'ot_type_option_types' ) ) {
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   107
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   108
	/**
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   109
	 * The ot_get_option() option type.
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   110
	 *
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   111
	 * This is a callback function to display text about ot_get_option().
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   112
	 *
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   113
	 * @access public
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   114
	 * @since  2.0
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   115
	 */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   116
	function ot_type_option_types() {
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   117
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   118
		// Format setting outer wrapper.
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   119
		echo '<div class="format-setting type-textblock wide-desc">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   120
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   121
		// Description.
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   122
		echo '<div class="description">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   123
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   124
		echo '<h4>' . esc_html__( 'Background', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   125
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   126
		/* translators: %1$s: function name, %2$s: filter name, %3$s: filter name list */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   127
		$string = esc_html__( 'The Background option type is for adding background styles to your theme either dynamically via the CSS option type below or manually with %1$s. The Background option type has filters that allow you to remove fields or change the defaults. For example, you can filter %2$s to remove unwanted fields from all Background options or an individual one. You can also filter %3$s. These filters allow you to fine tune the select lists for your specific needs.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   128
		echo '<p>' . sprintf( $string, '<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>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   129
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   130
		echo '<h4>' . esc_html__( 'Border', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   131
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   132
		/* translators: %1$s: pixel unit, %2$s: percentage unit, %3$s: em unit, %4$s: point unit, %5$s: filter name, %6$s: hidden, %7$s: dashed, %8$s: solid, %9$s: double, %10$s: groove, %11$s: ridge, %12$s: inset, %13$s: outset, %14$s: filter name */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   133
		$string = esc_html__( '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 %1$s, %2$s, %3$s, and %4$s. However, you can change them with the %5$s filter. The style select lets you choose the border style. The default styles are %6$s, %7$s, %8$s, %9$s, %10$s, %11$s, %12$s, and %13$s. However, you can change them with the %14$s filter. The colorpicker saves a hexadecimal color code.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   134
		echo '<p>' . sprintf( $string, '<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>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   135
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   136
		echo '<h4>' . esc_html__( 'Box Shadow', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   137
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   138
		/* translators: %1$s: inset, %2$s: offset-x, %3$s: offset-y, %4$s: blur-radius, %5$s: spread-radius, %6$s: color */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   139
		$string = esc_html__( 'The Box Shadow option type is used to set %1$s, %2$s, %3$s, %4$s, %5$s, and %6$s values.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   140
		echo '<p>' . sprintf( $string, '<code>inset</code>', '<code>offset-x</code>', '<code>offset-y</code>', '<code>blur-radius</code>', '<code>spread-radius</code>', '<code>color</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   141
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   142
		echo '<h4>' . esc_html__( 'Category Checkbox', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   143
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   144
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   145
		echo '<h4>' . esc_html__( 'Category Select', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   146
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   147
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   148
		echo '<h4>' . esc_html__( 'Checkbox', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   149
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   150
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   151
		echo '<h4>' . esc_html__( 'Colorpicker', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   152
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   153
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   154
		echo '<h4>' . esc_html__( 'Colorpicker Opacity', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   155
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   156
		/* translators: %1$s: range minimum, %2$s: range maximum, %3$s: minimum increment */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   157
		$string = esc_html__( 'The Colorpicker Opacity option type saves a hexadecimal color code with an opacity value from %1$s to %2$s in increments of %3$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' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   158
		echo '<p>' . sprintf( $string, '<code>0</code>', '<code>1</code>', '<code>0.01</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   159
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   160
		echo '<h4>' . esc_html__( 'CSS', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   161
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   162
		/* translators: %1$s: file name, %2$s: command name, %3$s: permission mode, %4$s: permission mode */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   163
		$string = esc_html__( '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 %1$s at the root level of your theme and change permissions using %2$s so the server can write to the file. I have had the most success setting this single file to %3$s but feel free to play around with permissions until everything is working. A good starting point is %4$s. When the server can save to the file, CSS will automatically be updated when you save your Theme Options.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   164
		echo '<p>' . sprintf( $string, '<code>dynamic.css</code>', '<code>chmod</code>', '<code>0777</code>', '<code>0666</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   165
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   166
		/* translators: option ID: pixel unit, %2$s: file name */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   167
		$string = esc_html__( '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' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   168
		echo '<p class="aside">' . sprintf( $string, '<code>demo_background</code>', '<code>dynamic.css</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   169
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   170
		echo '<p>' . esc_html__( 'Input', 'option-tree' ) . ':</p>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   171
		echo '<pre><code>body {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   172
  {{demo_background}}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   173
  background-color: {{demo_background|background-color}};
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   174
}</code></pre>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   175
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   176
		echo '<p>' . esc_html__( 'Output', 'option-tree' ) . ':</p>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   177
		echo '<pre><code>/* BEGIN demo_background */
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   178
body {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   179
  background: color image repeat attachment position;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   180
  background-color: color;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   181
}
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   182
/* END demo_background */</code></pre>';
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   183
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   184
		echo '<h4>' . esc_html__( 'Custom Post Type Checkbox', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   185
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   186
		/* translators: %1$s: post_type */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   187
		$string = esc_html__( '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' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   188
		echo '<p>' . sprintf( $string, '<code>post_type</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   189
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   190
		echo '<h4>' . esc_html__( 'Custom Post Type Select', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   191
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   192
		/* translators: %s: post_type */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   193
		$string = esc_html__( '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' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   194
		echo '<p>' . sprintf( $string, '<code>post_type</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   195
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   196
		echo '<h4>' . esc_html__( 'Date Picker', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   197
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   198
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   199
		echo '<h4>' . esc_html__( 'Date Time Picker', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   200
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   201
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   202
		echo '<h4>' . esc_html__( 'Dimension', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   203
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   204
		/* translators: %1$s: pixel unit, %2$s: percentage unit, %3$s: em unit, %4$s: point unit, %5$s: filter name */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   205
		$string = esc_html__( '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 %1$s, %2$s, %3$s, and %4$s. However, you can change them with the %5$s filter.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   206
		echo '<p>' . sprintf( $string, '<code>px</code>', '<code>%</code>', '<code>em</code>', '<code>pt</code>', '<code>ot_recognized_dimension_unit_types</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   207
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   208
		echo '<h4>' . esc_html__( 'Gallery', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   209
		echo '<p>' . esc_html__( '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>';
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   210
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   211
		echo '<h4>' . esc_html__( 'Google Fonts', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   212
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   213
		/* translators: %1$s: HTML Document HEAD, %2$s: array key, %3$s: filter name, %4$s: parameter name, %5$s: parameter name, %6$s: parameter name, %7$s: function name*/
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   214
		$string = esc_html__( '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' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   215
		echo '<p>' . sprintf( $string, '<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>'; // phpcs:ignore
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   216
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   217
		echo '<h4>' . esc_html__( 'JavaScript', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   218
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   219
		/* translators: %s: file name */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   220
		$string = esc_html__( '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' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   221
		echo '<p>' . sprintf( $string, '<code>ace.js</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   222
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   223
		echo '<h4>' . esc_html__( 'Link Color', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   224
		echo '<p>' . esc_html__( 'The Link Color option type is used to set all link color states.', 'option-tree' ) . '</p>';
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   225
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   226
		echo '<h4>' . esc_html__( 'List Item', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   227
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   228
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   229
		echo '<h4>' . esc_html__( 'Measurement', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   230
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   231
		/* translators: %1$s: pixel unit, %2$s: percentage unit, %3$s: em unit, %4$s: point unit, %5$s: filter name */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   232
		$string = esc_html__( '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 %1$s, %2$s, %3$s, and %4$s. However, you can change them with the %5$s filter.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   233
		echo '<p>' . sprintf( $string, '<code>px</code>', '<code>%</code>', '<code>em</code>', '<code>pt</code>', '<code>ot_measurement_unit_types</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   234
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   235
		/* translators: %s: file name */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   236
		$string = esc_html__( 'Example filter to add new units to the Measurement option type. Added to %s.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   237
		echo '<p>' . sprintf( $string, '<code>functions.php</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   238
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   239
		echo '<pre><code>function filter_measurement_unit_types( $array, $field_id ) {
0
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 on measurement with a field ID of my_measurement */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   242
  if ( $field_id == \'my_measurement\' ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   243
    $array[\'in\'] = \'inches\';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   244
    $array[\'ft\'] = \'feet\';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   245
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   246
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   247
  return $array;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   248
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   249
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
   250
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   251
		/* translators: %s: file name */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   252
		$string = esc_html__( 'Example filter to completely change the units in the Measurement option type. Added to %s.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   253
		echo '<p>' . sprintf( $string, '<code>functions.php</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   254
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   255
		echo '<pre><code>function filter_measurement_unit_types( $array, $field_id ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   256
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   257
  /* only run the filter on measurement with a field ID of my_measurement */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   258
  if ( $field_id == \'my_measurement\' ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   259
    $array = array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   260
      \'in\' => \'inches\',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   261
      \'ft\' => \'feet\'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   262
    );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   263
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   264
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   265
  return $array;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   266
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   267
add_filter( \'ot_measurement_unit_types\', \'filter_measurement_unit_types\', 10, 2 );</code></pre>';
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   268
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   269
		echo '<h4>' . esc_html__( 'Numeric Slider', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   270
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   271
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   272
		echo '<h4>' . esc_html__( 'On/Off', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   273
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   274
		/* translators: %1$s: on value, %2$s: off value */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   275
		$string = esc_html__( '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 %1$s or %2$s.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   276
		echo '<p>' . sprintf( $string, '<code>on</code>', '<code>off</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   277
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   278
		echo '<h4>' . esc_html__( 'Page Checkbox', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   279
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   280
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   281
		echo '<h4>' . esc_html__( 'Page Select', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   282
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   283
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   284
		echo '<h4>' . esc_html__( 'Post Checkbox', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   285
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   286
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   287
		echo '<h4>' . esc_html__( 'Post Select', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   288
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   289
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   290
		echo '<h4>' . esc_html__( 'Radio', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   291
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   292
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   293
		echo '<h4>' . esc_html__( 'Radio Image', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   294
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   295
		/* translators: %s: filter name */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   296
		$string = esc_html__( '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' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   297
		echo '<p>' . sprintf( $string, '<code>ot_radio_images</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   298
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   299
		/* translators: %1$s: filter name, %2$s: field name, %3$s: file name */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   300
		$string = esc_html__( 'This example executes the %1$s filter on layout images attached to the %2$s field. Added to %3$s.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   301
		echo '<p>' . sprintf( $string, '<code>ot_radio_images</code>', '<code>my_radio_images</code>', '<code>functions.php</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   302
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   303
		echo '<pre><code>function filter_radio_images( $array, $field_id ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   304
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   305
  /* only run the filter where the field ID is my_radio_images */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   306
  if ( $field_id == \'my_radio_images\' ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   307
    $array = array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   308
      array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   309
        \'value\'   => \'left-sidebar\',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   310
        \'label\'   => __( \'Left Sidebar\', \'option-tree\' ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   311
        \'src\'     => OT_URL . \'/assets/images/layout/left-sidebar.png\'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   312
      ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   313
      array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   314
        \'value\'   => \'right-sidebar\',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   315
        \'label\'   => __( \'Right Sidebar\', \'option-tree\' ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   316
        \'src\'     => OT_URL . \'/assets/images/layout/right-sidebar.png\'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   317
      )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   318
    );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   319
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   320
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   321
  return $array;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   322
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   323
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   324
add_filter( \'ot_radio_images\', \'filter_radio_images\', 10, 2 );</code></pre>';
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   325
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   326
		echo '<h4>' . esc_html__( 'Select', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   327
		echo '<p>' . esc_html__( 'The Select option type is used to list anything you want that would be chosen from a select list.', 'option-tree' ) . '</p>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   328
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   329
		echo '<h4>' . esc_html__( 'Sidebar Select', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   330
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   331
		/* translators: %1$s: filter name, %2$s: dynamic filter name with field_id */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   332
		$string = esc_html__( '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, %1$s, and %2$s we can be selective about which sidebars are available on a specific content area.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   333
		echo '<p>' . sprintf( $string, '<code>ot_recognized_sidebars</code>', '<code>ot_recognized_sidebars_{$field_id}</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   334
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   335
		/* translators: %s: dynamic sidebar name */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   336
		$string = esc_html__( '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' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   337
		echo '<p>' . sprintf( $string, '<code>footer-sidebar-$i</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   338
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   339
		echo '<h4>' . esc_html__( 'Slider', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   340
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   341
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   342
		echo '<h4>' . esc_html__( 'Social Links', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   343
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   344
		/* translators: %1$s: filter name, %2$s: boolean value, %3$s: filter name, %4$s: filter name */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   345
		$string = esc_html__( '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 %1$s filter to %2$s and turn off loading default values. Use the %3$s filter to change the default values that are loaded. To filter the settings array use the %4$s filter.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   346
		echo '<p>' . sprintf( $string, '<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>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   347
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   348
		echo '<h4>' . esc_html__( 'Spacing', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   349
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   350
		/* translators: %1$s: pixel unit, %2$s: percentage unit, %3$s: em unit, %4$s: point unit, %5$s: filter name */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   351
		$string = esc_html__( '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 %1$s, %2$s, %3$s, and %4$s. However, you can change them with the %5$s filter.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   352
		echo '<p>' . sprintf( $string, '<code>px</code>', '<code>%</code>', '<code>em</code>', '<code>pt</code>', '<code>ot_recognized_spacing_unit_types</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   353
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   354
		echo '<h4>' . esc_html__( 'Tab', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   355
		echo '<p>' . esc_html__( 'The Tab option type will break a section or metabox into tabbed content.', 'option-tree' ) . '</p>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   356
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   357
		echo '<h4>' . esc_html__( 'Tag Checkbox', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   358
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   359
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   360
		echo '<h4>' . esc_html__( 'Tag Select', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   361
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   362
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   363
		echo '<h4>' . esc_html__( 'Taxonomy Checkbox', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   364
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   365
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   366
		echo '<h4>' . esc_html__( 'Taxonomy Select', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   367
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   368
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   369
		echo '<h4>' . esc_html__( 'Text', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   370
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   371
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   372
		echo '<h4>' . esc_html__( 'Textarea', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   373
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   374
		/* translators: %1$s: filter name, %2$s: filter name, %3$s: filter name, %4$s: filter name */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   375
		$string = esc_html__( '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 %1$s, %2$s, %3$s, and %4$s.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   376
		echo '<p>' . sprintf( $string, '<code>wpautop</code>', '<code>media_buttons</code>', '<code>tinymce</code>', '<code>quicktags</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   377
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   378
		/* translators: %s: file name */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   379
		$string = esc_html__( 'Example filters to alter the Textarea option type. Added to %s.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   380
		echo '<p class="aside">' . sprintf( $string, '<code>functions.php</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   381
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   382
		/* translators: %1$s: filter name, %2$s: boolean value, %3$s: paragraph tag */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   383
		$string = esc_html__( 'This example keeps WordPress from executing the %1$s filter on the line breaks. The default is %2$s which means it wraps line breaks with an HTML %3$s tag.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   384
		echo '<p>' . sprintf( $string, '<code>wpautop</code>', '<code>true</code>', '<code>p</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   385
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   386
		echo '<pre><code>function filter_textarea_wpautop( $content, $field_id ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   387
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   388
  /* 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
   389
  if ( $field_id == \'my_textarea\' ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   390
    return false;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   391
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   392
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   393
  return $content;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   394
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   395
}
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   396
add_filter( \'ot_wpautop\', \'filter_textarea_wpautop\', 10, 2 );</code></pre>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   397
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   398
		/* translators: %1$s: filter name, %2$s: boolean value */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   399
		$string = esc_html__( 'This example keeps WordPress from executing the %1$s filter on the textarea WYSIWYG. The default is %2$s which means show the buttons.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   400
		echo '<p>' . sprintf( $string, '<code>media_buttons</code>', '<code>true</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   401
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   402
		echo '<pre><code>function filter_textarea_media_buttons( $content, $field_id ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   403
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   404
  /* 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
   405
  if ( $field_id == \'my_textarea\' ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   406
    return false;
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
  return $content;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   410
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   411
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   412
add_filter( \'ot_media_buttons\', \'filter_textarea_media_buttons\', 10, 2 );</code></pre>';
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   413
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   414
		/* translators: %1$s: filter name, %2$s: boolean value */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   415
		$string = esc_html__( 'This example keeps WordPress from executing the %1$s filter on the textarea WYSIWYG. The default is %2$s which means show the tinymce.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   416
		echo '<p>' . sprintf( $string, '<code>tinymce</code>', '<code>true</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   417
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   418
		echo '<pre><code>function filter_textarea_tinymce( $content, $field_id ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   419
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   420
  /* 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
   421
  if ( $field_id == \'my_textarea\' ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   422
    return false;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   423
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   424
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   425
  return $content;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   426
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   427
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   428
add_filter( \'ot_tinymce\', \'filter_textarea_tinymce\', 10, 2 );</code></pre>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   429
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   430
		/* translators: %1$s: filter name, %2$s: tags list */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   431
		$string = esc_html__( 'This example alters the %1$s filter on the textarea WYSIWYG. The default is %2$s which means show those quicktags. It also means you can filter in your own custom quicktags.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   432
		echo '<p>' . sprintf( $string, '<code>quicktags</code>', '<code>array( \'buttons\' => \'strong,em,link,block,del,ins,img,ul,ol,li,code,spell,close\' )</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   433
		echo '<pre><code>function filter_textarea_quicktags( $content, $field_id ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   434
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   435
  /* 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
   436
  if ( $field_id == \'my_textarea\' ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   437
    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
   438
  } else if ( $field_id == \'my_other_textarea\' ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   439
    return false; /* show no quicktags */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   440
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   441
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   442
  return $content;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   443
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   444
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   445
add_filter( \'ot_quicktags\', \'filter_textarea_quicktags\', 10, 1 );</code></pre>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   446
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   447
		echo '<h4>' . esc_html__( 'Textarea Simple', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   448
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   449
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   450
		/* translators: %1$s: function name, %2$s: boolean value, %3$s: paragraph tag, %4$s: file name */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   451
		$string = esc_html__( 'This example tells WordPress to execute the %1$s filter on the line breaks. The default is %2$s which means it does not wraps line breaks with an HTML %3$s tag. Added to %4$s.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   452
		echo '<p class="aside">' . sprintf( $string, '<code>wpautop</code>', '<code>false</code>', '<code>p</code>', '<code>functions.php</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   453
		echo '<pre><code>function filter_textarea_simple_wpautop( $content, $field_id ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   454
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   455
  /* 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
   456
  if ( $field_id == \'my_textarea\' ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   457
    return true;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   458
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   459
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   460
  return $content;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   461
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   462
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   463
add_filter( \'ot_wpautop\', \'filter_textarea_simple_wpautop\', 10, 2 );</code></pre>';
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   464
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   465
		echo '<h4>' . esc_html__( 'Textblock', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   466
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   467
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   468
		echo '<h4>' . esc_html__( 'Textblock Titled', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   469
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   470
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   471
		echo '<h4>' . esc_html__( 'Typography', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   472
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   473
		/* translators: %1$s: function name, %2$s: filter name, %3$s: filter name list */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   474
		$string = esc_html__( 'The Typography option type is for adding typography styles to your theme either dynamically via the CSS option type above or manually with %1$s. The Typography option type has filters that allow you to remove fields or change the defaults. For example, you can filter %2$s to remove unwanted fields from all Background options or an individual one. You can also filter %3$s. These filters allow you to fine tune the select lists for your specific needs.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   475
		echo '<p>' . sprintf( $string, '<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> ' . esc_html__( 'and', 'option-tree' ) . ' <code>ot_recognized_text_transformations</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   476
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   477
		echo '<p class="aside">' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   478
		echo '<pre><code>function filter_ot_recognized_font_families( $array, $field_id ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   479
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   480
  /* only run the filter when the field ID is my_google_fonts_headings */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   481
  if ( $field_id == \'my_google_fonts_headings\' ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   482
    $array = array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   483
      \'sans-serif\'    => \'sans-serif\',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   484
      \'open-sans\'     => \'"Open Sans", sans-serif\',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   485
      \'droid-sans\'    => \'"Droid Sans", sans-serif\'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   486
    );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   487
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   488
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   489
  return $array;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   490
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   491
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   492
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
   493
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   494
		echo '<h4>' . esc_html__( 'Upload', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   495
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   496
		/* translators: %1$s: button text, %2$s: the FTP protocol */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   497
		$string = esc_html__( 'The Upload option type is used to upload any WordPress supported media. After uploading, users are required to press the "%1$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 %2$s any media to your new server and change the URIs if necessary.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   498
		echo '<p>' . sprintf( $string, esc_html( apply_filters( 'ot_upload_text', __( 'Send to OptionTree', 'option-tree' ) ) ), 'FTP' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   499
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   500
		echo '</div>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   501
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   502
		echo '</div>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   503
	}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   504
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   505
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   506
if ( ! function_exists( 'ot_type_ot_get_option' ) ) {
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   507
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   508
	/**
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   509
	 * The ot_get_option() option type.
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   510
	 *
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   511
	 * This is a callback function to display text about ot_get_option().
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   512
	 *
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   513
	 * @access public
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   514
	 * @since  2.0
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   515
	 */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   516
	function ot_type_ot_get_option() {
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   517
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   518
		// Format setting outer wrapper.
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   519
		echo '<div class="format-setting type-textblock wide-desc">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   520
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   521
		// Description.
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   522
		echo '<div class="description">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   523
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   524
		echo '<h4>' . esc_html__( 'Description', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   525
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   526
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   527
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   528
		echo '<h4>' . esc_html__( 'Usage', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   529
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   530
		echo '<p><code>&lt;?php ot_get_option( $option_id, $default ); ?&gt;</code></p>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   531
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   532
		echo '<h4>' . esc_html__( 'Parameters', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   533
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   534
		echo '<code>$option_id</code>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   535
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   536
		echo '<p>(<em>' . esc_html__( 'string', 'option-tree' ) . '</em>) (<em>' . esc_html__( 'required', 'option-tree' ) . '</em>) ' . esc_html__( 'Enter the options unique identifier.', 'option-tree' ) . '<br />' . esc_html__( 'Default:', 'option-tree' ) . ' <em>' . esc_html__( 'None', 'option-tree' ) . '</em></p>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   537
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   538
		echo '<code>$default</code>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   539
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   540
		echo '<p>(<em>' . esc_html__( 'string', 'option-tree' ) . '</em>) (<em>' . esc_html__( 'optional', 'option-tree' ) . '</em>) ' . esc_html__( 'Enter a default return value. This is just incase the request returns null.', 'option-tree' ) . '<br />' . esc_html__( 'Default', 'option-tree' ) . ': <em>' . esc_html__( 'None', 'option-tree' ) . '</em></p>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   541
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   542
		echo '</div>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   543
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   544
		echo '</div>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   545
	}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   546
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   547
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   548
if ( ! function_exists( 'ot_type_get_option_tree' ) ) {
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   549
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   550
	/**
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   551
	 * The get_option_tree() option type.
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   552
	 *
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   553
	 * This is a callback function to display text about get_option_tree().
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   554
	 *
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   555
	 * @access public
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   556
	 * @since  2.0
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   557
	 */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   558
	function ot_type_get_option_tree() {
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   559
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   560
		// Format setting outer wrapper.
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   561
		echo '<div class="format-setting type-textblock wide-desc">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   562
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   563
		// Description.
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   564
		echo '<div class="description">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   565
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   566
		echo '<p class="deprecated">' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   567
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   568
		echo '<p>' . esc_html__( 'Use', 'option-tree' ) . '<code>ot_get_option()</code>' . esc_html__( 'instead', 'option-tree' ) . '.</p>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   569
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   570
		echo '<h4>' . esc_html__( 'Description', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   571
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   572
		echo '<p>' . esc_html__( 'This function returns, or echos if asked, a value from the "option_tree" array of saved values.', 'option-tree' ) . '</p>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   573
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   574
		echo '<h4>' . esc_html__( 'Usage', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   575
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   576
		echo '<p><code>&lt;?php get_option_tree( $item_id, $options, $echo, $is_array, $offset ); ?&gt;</code></p>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   577
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   578
		echo '<h4>' . esc_html__( 'Parameters', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   579
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   580
		echo '<code>$item_id</code>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   581
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   582
		echo '<p>(<em>' . esc_html__( 'string', 'option-tree' ) . '</em>) (<em>' . esc_html__( 'required', 'option-tree' ) . '</em>) ' . esc_html__( 'Enter a unique Option Key to get a returned value or array.', 'option-tree' ) . '<br />' . esc_html__( 'Default:', 'option-tree' ) . ' <em>' . esc_html__( 'None', 'option-tree' ) . '</em></p>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   583
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   584
		echo '<code>$options</code>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   585
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   586
		echo '<p>(<em>' . esc_html__( 'array', 'option-tree' ) . '</em>) (<em>' . esc_html__( 'optional', 'option-tree' ) . '</em>) ' . esc_html__( 'Used to cut down on database queries in template files.', 'option-tree' ) . '<br />' . esc_html__( 'Default', 'option-tree' ) . ': <em>' . esc_html__( 'None', 'option-tree' ) . '</em></p>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   587
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   588
		echo '<code>$echo</code>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   589
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   590
		echo '<p>(<em>' . esc_html__( 'boolean', 'option-tree' ) . '</em>) (<em>' . esc_html__( 'optional', 'option-tree' ) . '</em>) ' . esc_html__( 'Echo the output.', 'option-tree' ) . '<br />' . esc_html__( 'Default', 'option-tree' ) . ': FALSE</p>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   591
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   592
		echo '<code>$is_array</code>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   593
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   594
		echo '<p>(<em>' . esc_html__( 'boolean', 'option-tree' ) . '</em>) (<em>' . esc_html__( 'optional', 'option-tree' ) . '</em>) ' . esc_html__( 'Used to indicate the $item_id is an array of values.', 'option-tree' ) . '<br />' . esc_html__( 'Default', 'option-tree' ) . ': FALSE</p>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   595
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   596
		echo '<code>$offset</code>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   597
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   598
		echo '<p>(<em>' . esc_html__( 'integer', 'option-tree' ) . '</em>) (<em>' . esc_html__( 'optional', 'option-tree' ) . '</em>) ' . esc_html__( 'Numeric offset key for the $item_id array, -1 will return all values (an array starts at 0).', 'option-tree' ) . '<br />' . esc_html__( 'Default', 'option-tree' ) . ': -1</p>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   599
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   600
		echo '</div>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   601
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   602
		echo '</div>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   603
	}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   604
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   605
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   606
if ( ! function_exists( 'ot_type_examples' ) ) {
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   607
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   608
	/**
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   609
	 * Examples option type.
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   610
	 *
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   611
	 * @access public
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   612
	 * @since  2.0
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   613
	 */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   614
	function ot_type_examples() {
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   615
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   616
		// Format setting outer wrapper.
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   617
		echo '<div class="format-setting type-textblock wide-desc">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   618
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   619
		// Description.
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   620
		echo '<div class="description">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   621
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   622
		/* translators: %1$s: function name, %2$s: emphasis on not, %3$s: function name, %4$s: function name */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   623
		$string = esc_html__( 'If you\'re using the plugin version of OptionTree it is highly recommended to include a %1$s check in your code, as described in the examples below. If you\'ve integrated OptionTree directly into your themes root directory, you will %2$s need to wrap your code with %3$s, as you\'re guaranteed to have the %4$s function available.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   624
		echo '<p class="aside">' . sprintf( $string, '<code>function_exists</code>', '<strong>' . esc_html__( 'not', 'option-tree' ) . '</strong>', '<code>function_exists</code>', '<code>ot_get_option()</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   625
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   626
		echo '<h4>' . esc_html__( 'String Examples', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   627
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   628
		/* translators: %s: option id */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   629
		$string = esc_html__( 'Returns the value of %s.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   630
		echo '<p>' . sprintf( $string, '<code>test_input</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   631
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   632
		echo '<pre><code>if ( function_exists( \'ot_get_option\' ) ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   633
  $test_input = ot_get_option( \'test_input\' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   634
}</code></pre>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   635
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   636
		/* translators: %s: option id */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   637
		$string = esc_html__( 'Returns the value of %s, but also has a default value if it returns empty.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   638
		echo '<p>' . sprintf( $string, '<code>test_input</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   639
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   640
		echo '<pre><code>if ( function_exists( \'ot_get_option\' ) ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   641
  $test_input = ot_get_option( \'test_input\', \'default input value goes here.\' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   642
}</code></pre>';
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   643
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   644
		echo '<h4>' . esc_html__( 'Array Examples', 'option-tree' ) . ':</h4>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   645
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   646
		/* translators: %1$s: option id, %2$s: variable name, %3$s: function name */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   647
		$string = esc_html__( 'Assigns the value of %1$s to the variable %2$s. It then echos an unordered list of links (navigation) using %3$s.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   648
		echo '<p>' . sprintf( $string, '<code>navigation_ids</code>', '<code>$ids</code>', '<code>wp_list_pages()</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   649
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   650
		echo '<pre><code>if ( function_exists( \'ot_get_option\' ) ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   651
  /* get an array of page id\'s */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   652
  $ids = ot_get_option( \'navigation_ids\', array() );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   653
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   654
  /* echo custom navigation using wp_list_pages() */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   655
  if ( ! empty( $ids ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   656
    echo \'&lt;ul&gt;\';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   657
    wp_list_pages(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   658
      array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   659
        \'include\'   => $ids,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   660
        \'title_li\'  => \'\'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   661
      )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   662
    );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   663
    echo \'&lt;/ul&gt;\';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   664
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   665
  
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   666
}</code></pre>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   667
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   668
		/* translators: %s: option type name */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   669
		$string = esc_html__( 'The next two examples demonstrate how to use the %s 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' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   670
		echo '<p>' . sprintf( $string, '<strong>' . esc_html__( 'Measurement', 'option-tree' ) . '</strong>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   671
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   672
		echo '<pre><code>if ( function_exists( \'ot_get_option\' ) ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   673
  /* get the array */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   674
  $measurement = ot_get_option( \'measurement_option_type_id\' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   675
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   676
  /* only echo values if they actually exist, else echo some default value */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   677
  if ( isset( measurement[0] ) && $measurement[1] ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   678
    echo $measurement[0].$measurement[1];
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   679
  } else {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   680
    echo \'10px\';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   681
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   682
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   683
}</code></pre>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   684
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   685
		echo '<pre><code>if ( function_exists( \'ot_get_option\' ) ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   686
  /* get the array, and have a default just incase */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   687
  $measurement = ot_get_option( \'measurement_option_type_id\', array( \'10\', \'px\' ) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   688
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   689
  /* implode array into a string value */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   690
  if ( ! empty( measurement ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   691
    echo implode( \'\', $measurement );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   692
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   693
  
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   694
}</code></pre>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   695
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   696
		echo '<p>' . esc_html__( 'This example displays a very basic slider loop.', 'option-tree' ) . '</p>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   697
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   698
		echo '<pre><code>if ( function_exists( \'ot_get_option\' ) ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   699
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   700
  /* get the slider array */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   701
  $slides = ot_get_option( \'my_slider\', array() );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   702
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   703
  if ( ! empty( $slides ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   704
    foreach( $slides as $slide ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   705
      echo \'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   706
      &lt;li&gt;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   707
        &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
   708
        &lt;div class="description">\' . $slide[\'description\'] . \'&lt;/div&gt;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   709
      &lt;/li&gt;\';
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
}</code></pre>';
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   714
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   715
		echo '</div>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   716
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   717
		echo '</div>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   718
	}
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   719
}
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   720
if ( ! function_exists( 'ot_type_layouts_overview' ) ) {
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   721
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   722
	/**
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   723
	 * Layouts Overview option type.
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   724
	 *
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   725
	 * @access public
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   726
	 * @since  2.0
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   727
	 */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   728
	function ot_type_layouts_overview() {
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   729
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   730
		// Format setting outer wrapper.
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   731
		echo '<div class="format-setting type-textblock wide-desc">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   732
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   733
		// Description.
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   734
		echo '<div class="description">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   735
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   736
		echo '<h4>' . esc_html__( 'It\'s Super Simple', 'option-tree' ) . '</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   737
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   738
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   739
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   740
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   741
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   742
		echo '<p class="aside">' . esc_html__( ' 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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   743
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   744
		echo '<h4>' . esc_html__( 'For Developers', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   745
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   746
		echo '<h5>' . esc_html__( 'Creating a Layout', 'option-tree' ) . ':</h5>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   747
		echo '<ul class="docs-ul">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   748
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   749
		/* translators: %s: visual path to the page */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   750
		$string = esc_html__( 'Go to the %s tab.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   751
		echo '<li>' . sprintf( $string, '<code>' . esc_html__( 'OptionTree->Settings->Layouts', 'option-tree' ) . '</code>' ) . '</li>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   752
		echo '<li>' . esc_html__( 'Enter a name for your layout in the text field and hit "Save Layouts", you\'ve created your first layout.', 'option-tree' ) . '</li>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   753
		echo '<li>' . esc_html__( 'Adding a new layout is as easy as repeating the steps above.', 'option-tree' ) . '</li>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   754
		echo '</ul>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   755
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   756
		echo '<h5>' . esc_html__( 'Activating a Layout', 'option-tree' ) . ':</h5>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   757
		echo '<ul class="docs-ul">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   758
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   759
		/* translators: %s: visual path to the page */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   760
		$string = esc_html__( 'Go to the %s tab.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   761
		echo '<li>' . sprintf( $string, '<code>' . esc_html__( 'OptionTree->Settings->Layouts', 'option-tree' ) . '</code>' ) . '</li>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   762
		echo '<li>' . esc_html__( 'Click on the activate layout button in the actions list.', 'option-tree' ) . '</li>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   763
		echo '</ul>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   764
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   765
		echo '<h5>' . esc_html__( 'Deleting a Layout', 'option-tree' ) . ':</h5>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   766
		echo '<ul class="docs-ul">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   767
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   768
		/* translators: %s: visual path to the page */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   769
		$string = esc_html__( 'Go to the %s tab.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   770
		echo '<li>' . sprintf( $string, '<code>' . esc_html__( 'OptionTree->Settings->Layouts', 'option-tree' ) . '</code>' ) . '</li>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   771
		echo '<li>' . esc_html__( 'Click on the delete layout button in the actions list.', 'option-tree' ) . '</li>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   772
		echo '</ul>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   773
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   774
		echo '<h5>' . esc_html__( 'Edit Layout Data', 'option-tree' ) . ':</h5>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   775
		echo '<ul class="docs-ul">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   776
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   777
		/* translators: %s: visual path to the page */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   778
		$string = esc_html__( 'Go to the %s page.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   779
		echo '<li>' . sprintf( $string, '<code>' . esc_html__( 'Appearance->Theme Options', 'option-tree' ) . '</code>' ) . '</li>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   780
		echo '<li>' . esc_html__( 'Modify and save your theme options and the layout will be updated automatically.', 'option-tree' ) . '</li>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   781
		echo '<li>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   782
		echo '<li>' . esc_html__( 'If you want to edit a new layout, first create it then save your theme options.', 'option-tree' ) . '</li>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   783
		echo '</ul>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   784
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   785
		echo '<h4>' . esc_html__( 'End-Users Mode', 'option-tree' ) . ':</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   786
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   787
		echo '<h5>' . esc_html__( 'Creating a Layout', 'option-tree' ) . ':</h5>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   788
		echo '<ul class="docs-ul">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   789
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   790
		/* translators: %s: visual path to the page */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   791
		$string = esc_html__( 'Go to the %s page.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   792
		echo '<li>' . sprintf( $string, '<code>' . esc_html__( 'Appearance->Theme Options', 'option-tree' ) . '</code>' ) . '</li>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   793
		echo '<li>' . esc_html__( 'Enter a name for your layout in the text field and hit "New Layout", you\'ve created your first layout.', 'option-tree' ) . '</li>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   794
		echo '<li>' . esc_html__( 'Adding a new layout is as easy as repeating the steps above.', 'option-tree' ) . '</li>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   795
		echo '</ul>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   796
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   797
		echo '<h5>' . esc_html__( 'Activating a Layout', 'option-tree' ) . ':</h5>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   798
		echo '<ul class="docs-ul">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   799
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   800
		/* translators: %s: visual path to the page */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   801
		$string = esc_html__( 'Go to the %s page.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   802
		echo '<li>' . sprintf( $string, '<code>' . esc_html__( 'Appearance->Theme Options', 'option-tree' ) . '</code>' ) . '</li>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   803
		echo '<li>' . esc_html__( 'Choose a layout from the select list and click the "Activate Layout" button.', 'option-tree' ) . '</li>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   804
		echo '</ul>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   805
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   806
		echo '<h5>' . esc_html__( 'Deleting a Layout', 'option-tree' ) . ':</h5>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   807
		echo '<ul class="docs-ul">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   808
		echo '<li>' . esc_html__( 'End-Users mode does not allow deleting layouts.', 'option-tree' ) . '</li>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   809
		echo '</ul>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   810
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   811
		echo '<h5>' . esc_html__( 'Edit Layout Data', 'option-tree' ) . ':</h5>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   812
		echo '<ul class="docs-ul">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   813
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   814
		/* translators: %s: visual path to the page */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   815
		$string = esc_html__( 'Go to the %s page.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   816
		echo '<li>' . sprintf( $string, '<code>' . esc_html__( 'Appearance->Theme Options', 'option-tree' ) . '</code>' ) . '</li>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   817
		echo '<li>' . esc_html__( 'Modify and save your theme options and the layout will be updated automatically.', 'option-tree' ) . '</li>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   818
		echo '<li>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   819
		echo '</ul>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   820
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   821
		echo '</div>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   822
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   823
		echo '</div>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   824
	}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   825
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   826
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   827
if ( ! function_exists( 'ot_type_meta_boxes' ) ) {
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   828
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   829
	/**
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   830
	 * Meta Boxes option type.
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   831
	 *
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   832
	 * @access public
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   833
	 * @since  2.0
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   834
	 */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   835
	function ot_type_meta_boxes() {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   836
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   837
		// Format setting outer wrapper.
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   838
		echo '<div class="format-setting type-textblock wide-desc">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   839
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   840
		// Description.
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   841
		echo '<div class="description">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   842
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   843
		echo '<h4>' . esc_html__( 'How-to-guide', 'option-tree' ) . '</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   844
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   845
		/* translators: %1$s: directory name, %2$s: directory name, %3$s: file type */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   846
		$string = esc_html__( '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 %1$s inside the %2$s directory that contains a file named %3$s you can reference.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   847
		echo '<p>' . sprintf( $string, '<code>theme-mode</code>', '<code>assets</code>', '<code>demo-meta-boxes.php</code>' ) . '</p>'; // phpcs:ignore
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   848
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   849
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   850
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   851
		echo '<blockquote>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   852
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   853
		echo '<h5>' . esc_html__( 'Create and include your custom meta boxes file.', 'option-tree' ) . '</h5>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   854
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   855
		echo '<ul class="docs-ul">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   856
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   857
		/* translators: %s: file name */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   858
		$string = esc_html__( 'Create a file and name it anything you want, maybe %s.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   859
		echo '<li>' . sprintf( $string, '<code>meta-boxes.php</code>' ) . '</li>'; // phpcs:ignore
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   860
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   861
		/* translators: %1$s: directory name, %2$s: file name */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   862
		$string = esc_html__( 'As well, you\'ll probably want to create a directory named %1$s to put your %2$s into which will help keep you file structure nice and tidy.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   863
		echo '<li>' . sprintf( $string, '<code>includes</code>', '<code>meta-boxes.php</code>' ) . '</li>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   864
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   865
		/* translators: %s: file name */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   866
		$string = esc_html__( 'Add the following code to your %s.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   867
		echo '<li>' . sprintf( $string, '<code>functions.php</code>' ) . '</li>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   868
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   869
		echo '</ul>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   870
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   871
		echo '<pre><code>/**
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   872
 * Meta Boxes
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   873
 */
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   874
require( trailingslashit( get_template_directory() ) . \'includes/meta-boxes.php\' );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   875
</code></pre>';
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   876
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   877
		echo '<ul class="docs-ul">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   878
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   879
		/* translators: %1$s: file name, %2$s: hook type, %3$s: function name */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   880
		$string = esc_html__( 'Add a variation of the following code to your %1$s. You\'ll obviously need to fill it in with all your custom array values. It\'s important to note here that we use the %2$s filter because if you were to call the %3$s function before OptionTree was loaded the sky would fall on your head.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   881
		echo '<li>' . sprintf( $string, '<code>meta-boxes.php</code>', '<code>admin_init</code>', '<code>ot_register_meta_box</code>' ) . '</li>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   882
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   883
		echo '</ul>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   884
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   885
		echo "<pre><code>/**
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   886
 * Initialize the meta boxes. 
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   887
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   888
add_action( 'admin_init', 'custom_meta_boxes' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   889
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   890
function custom_meta_boxes() {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   891
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   892
  &#36;my_meta_box = array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   893
    'id'        => 'my_meta_box',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   894
    'title'     => 'My Meta Box',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   895
    'desc'      => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   896
    'pages'     => array( 'post' ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   897
    'context'   => 'normal',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   898
    'priority'  => 'high',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   899
    'fields'    => array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   900
      array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   901
        'id'          => 'background',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   902
        'label'       => 'Background',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   903
        'desc'        => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   904
        'std'         => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   905
        'type'        => 'background',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   906
        'class'       => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   907
        'choices'     => array()
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   908
      )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   909
    )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   910
  );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   911
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   912
  ot_register_meta_box( &#36;my_meta_box );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   913
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   914
}</code></pre>";
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   915
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   916
		echo '</div>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   917
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   918
		echo '</div>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   919
	}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   920
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   921
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   922
if ( ! function_exists( 'ot_type_theme_mode' ) ) {
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   923
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   924
	/**
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   925
	 * Theme Mode option type.
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   926
	 *
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   927
	 * @access public
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   928
	 * @since  2.0
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   929
	 */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   930
	function ot_type_theme_mode() {
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   931
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   932
		// Format setting outer wrapper.
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   933
		echo '<div class="format-setting type-textblock wide-desc">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   934
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   935
		// Description.
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   936
		echo '<div class="description">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   937
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   938
		echo '<h4>' . esc_html__( 'How-to-guide', 'option-tree' ) . '</h4>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   939
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   940
		/* translators: %1$s: directory name, %2$s: directory name, %3$s: file type */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   941
		$string = esc_html__( '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 %1$s inside the %2$s directory that contains a file named %3$s you can reference.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   942
		echo '<p>' . sprintf( $string, '<code>theme-mode</code>', '<code>assets</code>', '<code>demo-theme-options.php</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   943
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   944
		echo '<h5>' . esc_html__( 'Step 1: Include the plugin & turn on theme mode.', 'option-tree' ) . '</h5>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   945
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   946
		echo '<ul class="docs-ul">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   947
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   948
		/* translators: %1$s: directory name, %2$s: file type */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   949
		$string = esc_html__( 'Download the latest version of %1$s and unarchive the %2$s directory.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   950
		echo '<li>' . sprintf( $string, '<a href="https://wordpress.org/plugins/option-tree/" rel="nofollow" target="_blank">' . esc_html__( 'OptionTree', 'option-tree' ) . '</a>', '<code>.zip</code>' ) . '</li>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   951
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   952
		/* translators: %1$s: directory name, %2$s: directory path */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   953
		$string = esc_html__( 'Put the %1$s directory in the root of your theme. For example, the server path would be %2$s.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   954
		echo '<li>' . sprintf( $string, '<code>option-tree</code>', '<code>/wp-content/themes/theme-name/option-tree/</code>' ) . '</li>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   955
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   956
		/* translators: %s: file name */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   957
		$string = esc_html__( 'Add the following code to the beginning of your %s.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   958
		echo '<li>' . sprintf( $string, '<code>functions.php</code>' ) . '</li>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   959
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   960
		echo '</ul>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   961
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   962
		echo '<pre><code>/**
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   963
 * Required: set \'ot_theme_mode\' filter to true.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   964
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   965
add_filter( \'ot_theme_mode\', \'__return_true\' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   966
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   967
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   968
 * Required: include OptionTree.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   969
 */
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   970
require( trailingslashit( get_template_directory() ) . \'option-tree/ot-loader.php\' );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   971
</code></pre>';
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   972
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   973
		/* translators: %1$s: file name, %2$s: directory path */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   974
		$string = esc_html__( 'For a list of all the OptionTree UI display filters refer to the %1$s file found in the %2$s directory of this plugin. This file is the starting point for developing themes with Theme Mode.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   975
		echo '<p>' . sprintf( $string, '<code>demo-functions.php</code>', '<code>/assets/theme-mode/</code>' ) . '</p>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   976
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   977
		echo '<p class="aside">' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   978
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   979
		echo '<h5>' . esc_html__( 'Step 2: Create Theme Options without using the UI Builder.', 'option-tree' ) . '</h5>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   980
		echo '<ul class="docs-ul">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   981
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   982
		/* translators: %s: file name */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   983
		$string = esc_html__( 'Create a file and name it anything you want, maybe %s, 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' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   984
		echo '<li>' . sprintf( $string, '<code>theme-options.php</code>' ) . '</li>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   985
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   986
		/* translators: %1$s: directory name, %2$s: file name */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   987
		$string = esc_html__( 'As well, you\'ll probably want to create a directory named %1$s to put your %2$s into which will help keep you file structure nice and tidy.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   988
		echo '<li>' . sprintf( $string, '<code>includes</code>', '<code>theme-options.php</code>' ) . '</li>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   989
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   990
		/* translators: %s: file name */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   991
		$string = esc_html__( 'Add the following code to your %s.', 'option-tree' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   992
		echo '<li>' . sprintf( $string, '<code>functions.php</code>' ) . '</li>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   993
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   994
		echo '</ul>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   995
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   996
		echo '<pre><code>/**
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   997
 * Theme Options
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   998
 */
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   999
require( trailingslashit( get_template_directory() ) . \'includes/theme-options.php\' );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1000
</code></pre>';
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
  1001
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
  1002
		echo '<ul class="docs-ul">';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
  1003
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
  1004
		/* translators: %s: file name */
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
  1005
		$string = esc_html__( 'Add a variation of the following code to your %s. 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' );
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
  1006
		echo '<li>' . sprintf( $string, '<code>theme-options.php</code>' ) . '</li>'; // phpcs:ignore
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
  1007
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
  1008
		echo '</ul>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
  1009
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
  1010
		echo '<p>' . esc_html__( '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>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
  1011
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
  1012
		echo "<pre><code>/**
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1013
 * Initialize the options before anything else. 
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1014
 */
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1015
add_action( 'init', 'custom_theme_options', 1 );
0
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
 * Build the custom settings & update OptionTree.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1019
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1020
function custom_theme_options() {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1021
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1022
  /* 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
  1023
  if ( ! function_exists( 'ot_settings_id' ) || ! is_admin() )
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1024
    return false;
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1025
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1026
  /**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1027
   * Get a copy of the saved settings array. 
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1028
   */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1029
  &#36;saved_settings = get_option( 'option_tree_settings', array() );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1030
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1031
  /**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1032
   * Custom settings array that will eventually be 
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1033
   * passes to the OptionTree Settings API Class.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1034
   */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1035
  &#36;custom_settings = array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1036
    'contextual_help' => array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1037
      'content'       => array( 
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1038
        array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1039
          'id'        => 'general_help',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1040
          'title'     => 'General',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1041
          'content'   => '&lt;p&gt;Help content goes here!&lt;/p&gt;'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1042
        )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1043
      ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1044
      'sidebar'       => '&lt;p&gt;Sidebar content goes here!&lt;/p&gt;',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1045
    ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1046
    'sections'        => array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1047
      array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1048
        'id'          => 'general',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1049
        'title'       => 'General'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1050
      )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1051
    ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1052
    'settings'        => array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1053
      array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1054
        'id'          => 'my_checkbox',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1055
        'label'       => 'Checkbox',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1056
        'desc'        => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1057
        'std'         => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1058
        'type'        => 'checkbox',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1059
        'section'     => 'general',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1060
        'class'       => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1061
        'choices'     => array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1062
          array( 
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1063
            'value' => 'yes',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1064
            'label' => 'Yes' 
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1065
          )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1066
        )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1067
      ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1068
      array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1069
        'id'          => 'my_layout',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1070
        'label'       => 'Layout',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1071
        'desc'        => 'Choose a layout for your theme',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1072
        'std'         => 'right-sidebar',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1073
        'type'        => 'radio-image',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1074
        'section'     => 'general',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1075
        'class'       => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1076
        'choices'     => array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1077
          array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1078
            'value'   => 'left-sidebar',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1079
            'label'   => 'Left Sidebar',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1080
            'src'     => OT_URL . '/assets/images/layout/left-sidebar.png'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1081
          ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1082
          array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1083
            'value'   => 'right-sidebar',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1084
            'label'   => 'Right Sidebar',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1085
            'src'     => OT_URL . '/assets/images/layout/right-sidebar.png'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1086
          ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1087
          array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1088
            'value'   => 'full-width',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1089
            'label'   => 'Full Width (no sidebar)',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1090
            'src'     => OT_URL . '/assets/images/layout/full-width.png'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1091
          ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1092
          array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1093
            'value'   => 'dual-sidebar',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1094
            'label'   => __( 'Dual Sidebar', 'option-tree' ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1095
            'src'     => OT_URL . '/assets/images/layout/dual-sidebar.png'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1096
          ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1097
          array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1098
            'value'   => 'left-dual-sidebar',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1099
            'label'   => __( 'Left Dual Sidebar', 'option-tree' ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1100
            'src'     => OT_URL . '/assets/images/layout/left-dual-sidebar.png'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1101
          ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1102
          array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1103
            'value'   => 'right-dual-sidebar',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1104
            'label'   => __( 'Right Dual Sidebar', 'option-tree' ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1105
            'src'     => OT_URL . '/assets/images/layout/right-dual-sidebar.png'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1106
          )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1107
        )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1108
      ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1109
      array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1110
        'id'          => 'my_slider',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1111
        'label'       => 'Images',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1112
        'desc'        => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1113
        'std'         => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1114
        'type'        => 'list-item',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1115
        'section'     => 'general',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1116
        'class'       => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1117
        'choices'     => array(),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1118
        'settings'    => array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1119
          array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1120
            'id'      => 'slider_image',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1121
            'label'   => 'Image',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1122
            'desc'    => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1123
            'std'     => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1124
            'type'    => 'upload',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1125
            'class'   => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1126
            'choices' => array()
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1127
          ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1128
          array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1129
            'id'      => 'slider_link',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1130
            'label'   => 'Link to Post',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1131
            'desc'    => 'Enter the posts url.',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1132
            'std'     => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1133
            'type'    => 'text',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1134
            'class'   => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1135
            'choices' => array()
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1136
          ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1137
          array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1138
            'id'      => 'slider_description',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1139
            'label'   => 'Description',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1140
            'desc'    => 'This text is used to add fancy captions in the slider.',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1141
            'std'     => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1142
            'type'    => 'textarea',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1143
            'class'   => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1144
            'choices' => array()
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1145
          )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1146
        )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1147
      )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1148
    )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1149
  );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1150
  
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1151
  /* settings are not the same update the DB */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1152
  if ( &#36;saved_settings !== &#36;custom_settings ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1153
    update_option( 'option_tree_settings', &#36;custom_settings ); 
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1154
  }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1155
  
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1156
  /* Lets OptionTree know the UI Builder is being overridden */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1157
  global &#36;ot_has_custom_theme_options;
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1158
  &#36;ot_has_custom_theme_options = true;
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1159
  
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1160
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1161
</code></pre>";
11
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
  1162
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
  1163
		echo '</div>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
  1164
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
  1165
		echo '</div>';
bf1778c34b9a upgrade optiontree
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
  1166
	}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1167
}