diff -r 346c88efed21 -r 5e2f62d02dcd wp/wp-content/plugins/option-tree/includes/ot-functions-docs-page.php --- a/wp/wp-content/plugins/option-tree/includes/ot-functions-docs-page.php Mon Jun 08 16:11:51 2015 +0000 +++ b/wp/wp-content/plugins/option-tree/includes/ot-functions-docs-page.php Tue Jun 09 03:35:32 2015 +0200 @@ -73,6 +73,12 @@ echo '
' . __( 'Add and optional class to any option type.', 'option-tree' ) . '
'; + echo '' . sprintf( __( 'Add a comma separated list (no spaces) of conditions in which the field will be visible, leave this setting empty to always show the field. In these examples, %s is a placeholder for your condition, which can be in the form of %s.', 'option-tree' ), 'value
', 'field_id:is(value)
, field_id:not(value)
, field_id:contains(value)
, field_id:less_than(value)
, field_id:less_than_or_equal_to(value)
, field_id:greater_than(value)
, or field_id:greater_than_or_equal_to(value)
' ) . '
' . sprintf( __( 'Choose the logical operator to compute the result of the conditions. Your options are %s and %s.', 'option-tree' ), 'and
', 'or
' ) . '
' . __( 'The Background option type is for adding background styles to your theme either dynamically via the CSS option type below or manually with ot_get_option()
. Background has filters that allow you to change the defaults. For example, you can filter on ot_recognized_background_repeat
, ot_recognized_background_attachment
, and ot_recognized_background_position
. These filters allow you to fine tune the select lists for your specific CSS needs.', 'option-tree' ) . '
' . sprintf( __( 'The Background option type is for adding background styles to your theme either dynamically via the CSS option type below or manually with %s. The Background option type has filters that allow you to remove fields or change the defaults. For example, you can filter %s to remove unwanted fields from all Background options or an individual one. You can also filter %s. These filters allow you to fine tune the select lists for your specific needs.', 'option-tree' ), 'ot_get_option()
', 'ot_recognized_background_fields
', 'ot_recognized_background_repeat
, ot_recognized_background_attachment
, ot_recognized_background_position
, ' . __( 'and', 'option-tree' ) . ' ot_type_background_size_choices
' ) . '
' . sprintf( __( 'The Border option type is used to set width, unit, style, and color values. The text input excepts a numerical value and the unit select lets you choose the unit of measurement to add to that value. Currently the default units are %s, %s, %s, and %s. However, you can change them with the %s filter. The style select lets you choose the border style. The default styles are %s, %s, %s, %s, %s, %s, %s, and %s. However, you can change them with the %s filter. The colorpicker saves a hexadecimal color code.', 'option-tree' ), 'px
', '%
', 'em
', 'pt
', 'ot_recognized_border_unit_types
', 'hidden
', 'dashed
', 'solid
', 'double
', 'groove
', 'ridge
', 'inset
', 'outset
', 'ot_recognized_border_style_types
' ) . '
' . sprintf( __( 'The Box Shadow option type is used to set %s, %s, %s, %s, %s, and %s values.', 'option-tree' ), 'inset
', 'offset-x
', 'offset-y
', 'blur-radius
', 'spread-radius
', 'color
' ) . '
' . __( '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' ) . '
'; echo '' . __( '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' ) . '
'; - echo '' . __( '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' ) . '
'; - echo '' . __( 'The Checkbox option type is fairly self explanatory. Typically used to ask questions. For example, "Do you want to activate asynchronous Google analytics?" would be a single checkbox with a value of yes. You could have more complex usages but the idea is that you can easily grab the value of the checkbox and use it in you theme. In this situation you would test if the checkbox has a value and execute a block of code if it does and do nothing if it doesn\'t.', 'option-tree' ) . '
'; + echo '' . __( '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' ) . '
'; echo '' . __( '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' ) . '
'; + echo '' . sprintf( __( 'The Colorpicker Opacity option type saves a hexadecimal color code with an opacity value from %s to %s in increments of %s. Though the value is saved as hexadecimal, if used within the CSS option type the color and opacity values will be converted into a valid RGBA CSS value.', 'option-tree' ), '0
', '1
', '0.01
' ) . '
' . __( '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 dynamic.css
at the root level of your theme and change permissions using chmod so the server can write to the file. I have had the most success setting this single file to 0777 but feel free to play around with permissions until everything is working. A good starting point is 0666. When the server can save to the file CSS will automatically be updated each time you save your theme options.', 'option-tree' ) . '
' . sprintf( __( 'The CSS option type is a textarea that when used properly can add dynamic CSS to your theme from within OptionTree. Unfortunately, due server limitations you will need to create a file named %s at the root level of your theme and change permissions using %s so the server can write to the file. I have had the most success setting this single file to %s but feel free to play around with permissions until everything is working. A good starting point is %s. When the server can save to the file, CSS will automatically be updated when you save your Theme Options.', 'option-tree' ), 'dynamic.css
', 'chmod
', '0777
', '0666
' ) . '
' . __( 'An example of the CSS option type: This assumes you have an option with the ID of custom_background_css
which will display the saved values for that option.', 'option-tree' ) . '
' . sprintf( __( 'This example assumes you have an option with the ID of %1$s. Which means this option will automatically insert the value of %1$s into the %2$s when the Theme Options are saved.', 'option-tree' ), 'demo_background
', 'dynamic.css
' ) . '
'. __( 'Input', 'option-tree' ) . ':
'; echo 'body {
- {{custom_background_css}}
- background-color: {{custom_background_css|background-color}};
+ {{demo_background}}
+ background-color: {{demo_background|background-color}};
}
';
echo ''. __( 'Output', 'option-tree' ) . ':
'; - echo '/* BEGIN custom_background_css */
+ echo '/* BEGIN demo_background */
body {
background: color image repeat attachment position;
background-color: color;
}
-/* END custom_background_css */
';
-
- echo ''. __( 'Custom Post Type Select', 'option-tree' ) . ':
';
- echo '' . __( '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 post_type
when created in the settings. For some reason any
does not work correctly and will looked into in future version.', 'option-tree' ) . '
';
+/* END demo_background */
';
echo '' . __( '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 post_type
when created in the settings. For some reason any
does not work correctly and will looked into in future version.', 'option-tree' ) . '
' . sprintf( __( 'The Custom Post Type Select option type displays a list of IDs from any available WordPress post type or custom post type. It allows the user to check multiple post IDs for use in a custom function or loop. Requires at least one valid %1$s in the %1$s field.', 'option-tree' ), 'post_type
' ) . '
' . sprintf( __( 'The Custom Post Type Select option type displays a list of IDs from any available WordPress post type or custom post type. It will return a single post ID for use in a custom function or loop. Requires at least one valid %1$s in the %1$s field.', 'option-tree' ), 'post_type
' ) . '
' . __( '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' ) . '
'; + + echo '' . __( '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' ) . '
'; + + echo '' . sprintf( __( 'The Dimension option type is used to set width and height values. The text inputs except numerical values and the select lets you choose the unit of measurement to add to that value. Currently the default units are %s, %s, %s, and %s. However, you can change them with the %s filter.', 'option-tree' ), 'px
', '%
', 'em
', 'pt
', 'ot_recognized_dimension_unit_types
' ) . '
' . __( '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' ) . '
'; + + echo '' . sprintf( __( 'The Google Fonts option type will dynamically enqueue any number of Google Web Fonts into the document %1$s. As well, once the option has been saved each font family will automatically be inserted into the %2$s array for the Typography option type. You can further modify the font stack by using the %3$s filter, which is passed the %4$s, %5$s, and %6$s parameters. The %6$s parameter is being passed from %7$s, so it will be the ID of a Typography option type. This will allow you to add additional web safe fonts to individual font families on an as-need basis.', 'option-tree' ), 'HEAD
', 'font-family
', 'ot_google_font_stack
', '$font_stack
', '$family
', '$field_id
', 'ot_recognized_font_families
' ) . '
' . sprintf( __( 'The JavaScript option type is a textarea that uses the %s code editor to highlight your JavaScript and display errors as you type.', 'option-tree' ), 'ace.js
' ) . '
' . __( 'The Link Color option type is used to set all link color states.', 'option-tree' ) . '
'; echo '' . __( 'The list Item replaced the old Slider option type. It 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' ) . '
'; + echo '' . __( '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' ) . '
'; echo '' . __( '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 px
, %
, em
, pt
. However, you can change them with the ot_measurement_unit_types
filter.', 'option-tree' ) . '
' . sprintf( __( 'The Measurement option type is a mix of input and select fields. The text input excepts a value and the select lets you choose the unit of measurement to add to that value. Currently the default units are %s, %s, %s, and %s. However, you can change them with the %s filter.', 'option-tree' ), 'px
', '%
', 'em
', 'pt
', 'ot_measurement_unit_types
' ) . '
' . __( 'Example filter to add new units to the Measurement option type. Added to functions.php
.', 'option-tree' ) . '
' . sprintf( __( 'Example filter to add new units to the Measurement option type. Added to %s.', 'option-tree' ), 'functions.php
' ) . '
function filter_measurement_unit_types( $array, $field_id ) {
/* only run the filter on measurement with a field ID of my_measurement */
@@ -178,23 +214,26 @@
echo ''. __( 'Numeric Slider', 'option-tree' ) . ':
';
echo '' . __( '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' ) . '
';
+ echo ''. __( 'On/Off', 'option-tree' ) . ':
';
+ echo '' . sprintf( __( 'The On/Off option type displays a simple switch that can be used to turn things on or off. The saved return value is either %s or %s.', 'option-tree' ), 'on
', 'off
' ) . '
';
+
+ echo ''. __( 'Page Checkbox', 'option-tree' ) . ':
';
+ echo '' . __( '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' ) . '
';
+
echo ''. __( 'Page Select', 'option-tree' ) . ':
';
echo '' . __( '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' ) . '
';
- echo ''. __( 'Page Checkbox', 'option-tree' ) . ':
';
- echo '' . __( 'The Page Select 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' ) . '
';
+ echo ''. __( 'Post Checkbox', 'option-tree' ) . ':
';
+ echo '' . __( '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' ) . '
';
echo ''. __( 'Post Select', 'option-tree' ) . ':
';
echo '' . __( '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' ) . '
';
- echo ''. __( 'Post Checkbox', 'option-tree' ) . ':
';
- echo '' . __( 'The Post Select 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' ) . '
';
-
echo ''. __( 'Radio', 'option-tree' ) . ':
';
- echo '' . __( 'The Radio option type could ask a question. For example, "Do you want to activate the custom navigation?" could require a yes or no answer with a radio option. In this situation you would test if the radio has a value of \'yes\' and execute a block of code, or if it\'s \'no\' execute a different block of code.', 'option-tree' ) . '
';
+ echo '' . __( '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' ) . '
';
echo ''. __( 'Radio Image', 'option-tree' ) . ':
';
- echo '' . __( 'the Radio Images option type is primarily used for layouts. However, you can filter the image list using ot_radio_images
. As well, you can add your own custom images using the choices array.', 'option-tree' ) . '
';
+ echo '' . sprintf( __( 'the Radio Images option type is primarily used for layouts. However, you can filter the image list using %s. As well, you can add your own custom images using the choices array.', 'option-tree' ), 'ot_radio_images
' ) . '
';
echo '' . __( 'This example executes the ot_radio_images
filter on layout images attached to the my_radio_images
field. Added to functions.php
.', 'option-tree' ) . '
';
echo 'function filter_radio_images( $array, $field_id ) {
@@ -224,12 +263,21 @@
echo '' . __( 'The Select option type is used to list anything you want that would be chosen from a select list.', 'option-tree' ) . '
';
echo ''. __( 'Sidebar Select', 'option-tree' ) . ':
';
- echo '' . __( '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, ot_recognized_sidebars
, and ot_recognized_sidebars_{$field_id}
we can be selective about which sidebars are available on a specific content area.', 'option-tree' ) . '
';
- echo '' . __( '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 footer-sidebar-$i
.', 'option-tree' ) . '
';
+ echo '' . sprintf( __( 'This option type makes it possible for users to select a WordPress registered sidebar to use on a specific area. By using the two provided filters, %s, and %s we can be selective about which sidebars are available on a specific content area.', 'option-tree' ), 'ot_recognized_sidebars
', 'ot_recognized_sidebars_{$field_id}
' ) . '
';
+ echo '' . sprintf( __( 'For example, if we create a WordPress theme that provides the ability to change the Blog Sidebar and we don\'t want to have the footer sidebars available on this area, we can unset those sidebars either manually or by using a regular expression if we have a common name like %s.', 'option-tree' ), 'footer-sidebar-$i
' ) . '
';
echo ''. __( 'Slider', 'option-tree' ) . ':
';
echo '' . __( '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' ) . '
';
+ echo ''. __( 'Social Links', 'option-tree' ) . ':
';
+ echo '' . sprintf( __( 'The Social Links option type utilizes a drag & drop interface to create a list of social links. There are a few filters that make extending this option type easy. You can set the %s filter to %s and turn off loading default values. Use the %s filter to change the default values that are loaded. To filter the settings array use the %s filter.', 'option-tree' ), 'ot_type_social_links_load_defaults
', 'false
', 'ot_type_social_links_defaults
', 'ot_social_links_settings
' ) . '
';
+
+ echo ''. __( 'Spacing', 'option-tree' ) . ':
';
+ echo '' . sprintf( __( 'The Spacing option type is used to set spacing values such as padding or margin in the form of top, right, bottom, and left. The text inputs except numerical values and the select lets you choose the unit of measurement to add to that value. Currently the default units are %s, %s, %s, and %s. However, you can change them with the %s filter.', 'option-tree' ), 'px
', '%
', 'em
', 'pt
', 'ot_recognized_spacing_unit_types
' ) . '
';
+
+ echo ''. __( 'Tab', 'option-tree' ) . ':
';
+ echo '' . __( 'The Tab option type will break a section or metabox into tabbed content.', 'option-tree' ) . '
';
+
echo ''. __( 'Tag Checkbox', 'option-tree' ) . ':
';
echo '' . __( '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' ) . '
';
@@ -242,11 +290,11 @@
echo ''. __( 'Taxonomy Select', 'option-tree' ) . ':
';
echo '' . __( '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' ) . '
';
- echo ''. __( 'Text (Input)', 'option-tree' ) . ':
';
- echo '' . __( 'The Text option type would be used to save a string value. For example, a link to feedburner, your Twitter username, or Google Analytics ID are all good candidates. Any optional or required text that is of reasonably short character length.', 'option-tree' ) . '
';
+ echo ''. __( 'Text', 'option-tree' ) . ':
';
+ echo '' . __( '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' ) . '
';
echo ''. __( 'Textarea', 'option-tree' ) . ':
';
- echo '' . __( 'The Textarea option type is a large string value used for custom code or text in the theme. The new Textarea has a WYSIWYG editor that can be filtered to change the buttons shown. For example, you can filter on wpautop
, media_buttons
, tinymce
, and quicktags
.', 'option-tree' ) . '
';
+ echo '' . sprintf( __( 'The Textarea option type is a large string value used for custom code or text in the theme and has a WYSIWYG editor that can be filtered to change the how it is displayed. For example, you can filter %s, %s, %s, and %s.', 'option-tree' ), 'wpautop
', 'media_buttons
', 'tinymce
', 'quicktags
' ) . '
';
echo '' . __( 'Example filters to alter the Textarea option type. Added to functions.php
.', 'option-tree' ) . '
';
@@ -261,7 +309,7 @@
return $content;
}
-add_filter( \'ot_wpautop\', \'filter_textarea_wpautop\', 10, 1 );
';
+add_filter( \'ot_wpautop\', \'filter_textarea_wpautop\', 10, 2 );
';
echo '' . __( 'This example keeps WordPress from executing the media_buttons
filter on the textarea WYSIWYG. The default is true
which means show the buttons.', 'option-tree' ) . '
function filter_textarea_media_buttons( $content, $field_id ) {
@@ -305,9 +353,9 @@
add_filter( \'ot_quicktags\', \'filter_textarea_quicktags\', 10, 1 );
';
echo '' . __( 'The Textarea Simple option type is a large string value used for custom code or text in the theme. The new Textarea Simple does not have a WYSIWYG editor. But you can still filter on wpautop
.', 'option-tree' ) . '
' . __( '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' ) . '
'; - echo '' . __( 'This example tells WordPress to execute the wpautop
filter on the line breaks. The default is false
which means it does not wraps line breaks with an HTML p
tag. Added to functions.php
.', 'option-tree' ) . '
' . sprintf( __( 'This example tells WordPress to execute the %s filter on the line breaks. The default is %s which means it does not wraps line breaks with an HTML %s tag. Added to %s.', 'option-tree' ), 'wpautop
', 'false
', 'p
', 'functions.php
' ) . '
function filter_textarea_simple_wpautop( $content, $field_id ) {
/* only run the filter on the textarea with a field ID of my_textarea */
@@ -321,13 +369,13 @@
add_filter( \'ot_wpautop\', \'filter_textarea_simple_wpautop\', 10, 2 );
';
echo '' . __( 'The Textblock option type is used only on the Theme Option page. It will allow you to create & display HTML on your Theme Options page 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' ) . '
'; + echo '' . __( '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' ) . '
'; echo '' . __( 'The Textblock Titled option type is used only on the Theme Option page. It will allow you to create & display HTML on your Theme Options page 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' ) . '
'; + echo '' . __( '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' ) . '
'; echo '' . __( 'The Typography option type is for adding typographic styles to your theme either dynamically via the CSS option type below or manually with ot_get_option()
. Typography has filters that allow you to change the defaults. For example, you can filter on ot_recognized_font_styles
, ot_recognized_font_weights
, ot_recognized_font_variants
, and ot_recognized_font_families
. These filters allow you to fine tune the select lists for your specific CSS needs. The most important one though is ot_recognized_font_families
as you can add your Google Fonts to create custom font stacks.', 'option-tree' ) . '
' . sprintf( __( 'The Typography option type is for adding typography styles to your theme either dynamically via the CSS option type above or manually with %s. The Typography option type has filters that allow you to remove fields or change the defaults. For example, you can filter %s to remove unwanted fields from all Background options or an individual one. You can also filter %s. These filters allow you to fine tune the select lists for your specific needs.', 'option-tree' ), 'ot_get_option()
', 'ot_recognized_typography_fields
', 'ot_recognized_font_families
, ot_recognized_font_sizes
, ot_recognized_font_styles
, ot_recognized_font_variants
, ot_recognized_font_weights
, ot_recognized_letter_spacing
, ot_recognized_line_heights
, ot_recognized_text_decorations
' . __( 'and', 'option-tree' ) . ' ot_recognized_text_transformations
' ) . '
' . __( 'This example would filter ot_recognized_font_families
to build your own font stack. Added to functions.php
.', 'option-tree' ) . '
function filter_ot_recognized_font_families( $array, $field_id ) {
@@ -347,7 +395,7 @@
add_filter( \'ot_recognized_font_families\', \'filter_ot_recognized_font_families\', 10, 2 );
';
echo '' . __( 'The Upload option type is used to upload any WordPress supported media. After uploading, users are required to press the "Send to OptionTree" 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\'ll have to re-upload or FTP any media to your new server and change the URIs if necessary.', 'option-tree' ) . '
'; + echo '' . sprintf( __( 'The Upload option type is used to upload any WordPress supported media. After uploading, users are required to press the "%s" button in order to populate the input with the URI of that media. There is one caveat of this feature. If you import the theme options and have uploaded media on one site the old URI will not reflect the URI of your new site. You will have to re-upload or %s any media to your new server and change the URIs if necessary.', 'option-tree' ), apply_filters( 'ot_upload_text', __( 'Send to OptionTree', 'option-tree' ) ), 'FTP' ) . '
'; echo '' . __( ' Adding a layout is ridiculously easy, follow these steps and you\'ll be on your way to having a WordPress super theme.', 'option-tree' ) . '
'; echo '' . __( '', 'option-tree' ) . '
'; echo '' . __( '', 'option-tree' ) . '
'; echo '/**
* Meta Boxes
*/
-load_template( trailingslashit( get_template_directory() ) . \'includes/meta-boxes.php\' );
+require( trailingslashit( get_template_directory() ) . \'includes/meta-boxes.php\' );
';
echo 'option-tree
directory in the root of your theme. For example, the server path would be /wp-content/themes/theme-name/option-tree/
.', 'option-tree' ) . 'functions.php
.', 'option-tree' ) . '.zip
' ) . 'option-tree
', '/wp-content/themes/theme-name/option-tree/
' ) . 'functions.php
' ) . '/**
- * Optional: set \'ot_show_pages\' filter to false.
- * This will hide the settings & documentation pages.
- */
-add_filter( \'ot_show_pages\', \'__return_false\' );
-
-/**
- * Optional: set \'ot_show_new_layout\' filter to false.
- * This will hide the "New Layout" section on the Theme Options page.
- */
-add_filter( \'ot_show_new_layout\', \'__return_false\' );
-
-/**
* Required: set \'ot_theme_mode\' filter to true.
*/
add_filter( \'ot_theme_mode\', \'__return_true\' );
@@ -798,10 +831,12 @@
/**
* Required: include OptionTree.
*/
-load_template( trailingslashit( get_template_directory() ) . \'option-tree/ot-loader.php\' );
+require( trailingslashit( get_template_directory() ) . \'option-tree/ot-loader.php\' );
';
- echo '' . __( 'It\'s that simple! You now have OptionTree built into your theme and anytime there\'s an update to the plugin you just replace the old version and you\'re good to go..', 'option-tree' ) . '
'; + echo '' . sprintf( __( 'For a list of all the OptionTree UI display filters refer to the %s file found in the %s directory of this plugin. This file is the starting point for developing themes with Theme Mode.', 'option-tree' ), 'demo-functions.php
', '/assets/theme-mode/
' ) . '
' . __( 'You now have OptionTree built into your theme and anytime an update is available replace the old version with the new one.', 'option-tree' ) . '
'; echo '/**
* Theme Options
*/
-load_template( trailingslashit( get_template_directory() ) . \'includes/theme-options.php\' );
+require( trailingslashit( get_template_directory() ) . \'includes/theme-options.php\' );
';
echo '/**
* Initialize the options before anything else.
*/
-add_action( 'admin_init', 'custom_theme_options', 1 );
+add_action( 'init', 'custom_theme_options', 1 );
/**
* Build the custom settings & update OptionTree.
*/
function custom_theme_options() {
+
+ /* OptionTree is not loaded yet, or this is not an admin request */
+ if ( ! function_exists( 'ot_settings_id' ) || ! is_admin() )
+ return false;
+
/**
* Get a copy of the saved settings array.
*/
@@ -961,6 +1001,10 @@
update_option( 'option_tree_settings', $custom_settings );
}
+ /* Lets OptionTree know the UI Builder is being overridden */
+ global $ot_has_custom_theme_options;
+ $ot_has_custom_theme_options = true;
+
}
";