开发者 | valendesigns |
---|---|
更新时间 | 2019年5月19日 13:04 |
捐献地址: | 去捐款 |
PHP版本: | 5.3.0 及以上 |
WordPress版本: | 5.2 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
theme-options.php
file for production use that is i18n translation ready, with your custom text domain automatically inserted.
And, in just a few simple lines of code, save settings to the database with a unique array ID so none of your Theme Options conflict with other themes that use OptionTree.
Also, OptionTree now takes full advantage of the new color schemes introduced in WordPress 3.8, it looks and feels built-in.
Theme Integration
If you're like me, you want to know how everything works. Download and activate the OptionTree Theme and see first hand how to integrate OptionTree into your own project. I'll walk you through installing OptionTree and you'll get a chance to see all the various options and filters first hand and in the wild.
Contributing
To contribute or report bugs, please go to the OptionTree Github repository.
Sponsorship
OptionTree is a project partly sponsored by ThemeForest, the largest WordPress theme marketplace on the web.
Option Types
This is a complete list of all the available option types that come shipped with OptionTree.
* Background
* Border
* Box Shadow
* Category Checkbox
* Category Select
* Checkbox
* Colorpicker
* Colorpicker Opacity
* CSS
* Custom Post Type Checkbox
* Custom Post Type Select
* Date Picker
* Date Time Picker
* Dimension
* Gallery
* Google Fonts
* JavaScript
* Link Color
* List Item
* Measurement
* Numeric Slider
* On/Off
* Page Checkbox
* Page Select
* Post Checkbox
* Post Select
* Radio
* Radio Image
* Select
* Sidebar Select
* Slider
* Social Links
* Spacing
* Tab
* Tag Checkbox
* Tag Select
* Taxonomy Checkbox
* Taxonomy Select
* Text
* Textarea
* Textarea Simple
* Textblock
* Textblock Titled
* Typography
* Upload
option-tree
to the /wp-content/plugins/
directoryPlugins
menu in WordPressOptionTree->Documentation
link in the WordPress admin sidebar menu for further setup assistance..zip
directory.option-tree
directory in the root of your theme. For example, the server path would be /wp-content/themes/theme-name/option-tree/
.functions.php
.demo-functions.php
file found in the /assets/theme-mode/
directory of this plugin. This file is the starting point for developing themes with Theme Mode.There sure is, and I'm glad you asked. Download and activate the OptionTree Theme and get some experience setting up OptionTree on your own with detailed directions and tips.
The most likely scenario is your theme already has OptionTree installed in Theme Mode. And since the plugin and theme version can't both be active at the same time without the sky falling on your head, your site has decided to throw in the towel. If that's not your issue, open up a support request and we'll figure it out together. UPDATE: As of OptionTree 2.4.0 the plugin version will not conflict with the Theme Mode version if they are both 2.4.0 or higher.
+
bypass and PHP serialized classes. props @erwanlrunfiltered_html
iframe
capabilities to support additional style
attributes._sanitize_recursive()
. props @shrameeiframe
supports the style
attribute for users with unfiltered_html
capabilities.noscript
is supported for users with unfiltered_html
capabilities.ot_validate_setting_input_safe
which is used to validate the input value of a custom setting type. All values must be validated!create_function
notice in PHP 7.2+. props @modesthatredwordpress-plugin
project type to composer file. props @egiffordadd_list_item
& add_social_links
Ajax requests.global_admin_css
so it's only enqueued when needed.dynamic.css
so that a child theme doesn't load the styles saved to the parent theme.ot_recognized_post_format_meta_boxes
to support additional post formats meta boxes. props @BassemNot_do_settings_fields_before
& ot_do_settings_fields_after
. props @BassemN, @valendesigns0
value to be saved with certain option types. Contributors via github @BassemN.ot_load_dynamic_css
to explicitly turn the feature off if desired.dynamic.css
created with other themes from being loaded elsewhere.add_query_arg
by escaping it.inherit
fallback to the border
option type in dynamic.css.none
fallback to the box-shadow
option type in dynamic.css.inherit
fallback to the colorpicker
option type in dynamic.css.inherit
fallback to the colorpicker-opacity
option type in dynamic.css.ot_insert_css_with_markers_fallback
to filter the dynamic.css
fallback value.ot_type_radio_image_attributes
to filter the image attributes for each radio choice. Contributors via github @BassemN, and @valendesigns.ot_insert_css_with_markers
to remove confusing & unnecessary PHP statements and fix whitespace.ot_insert_css_with_markers
where the $option_type
variable was not being set properly.inherit
fallback to the link-color
option type in dynamic.css.$.browser.msie
JS error caused by function being deprecated.hover
to mouseenter mouseleave
to stop jQuery migrate error message.ot-google-fonts-css
enqueue.not-sortable
class to the List Item option type will remove the sortable feature for that option.ot-colorpicker-opacity
class.esc_url_raw
to filter the Upload option type when it's saving an attachment ID. Contributors via github @RistoNiinemets.dynamic.css
file. Contributors via github @johnh10, and @valendesigns.ot_google_fonts
array to be rebuilt when switching between themes.add_menu_page
in ot-cleanup-api.php
.change
or clear
.register_post_type()
function being used in Theme Mode.sanitize_text_field
to esc_url_raw
for the Upload option type.ot_dequeue_jquery_ui_css_screen_ids
to dequeue jquery-ui-css
by screen ID.ot_on_off_switch_on_value
to filter the value of the On button. Contributors via github @BassemN, and @valendesigns.ot_on_off_switch_on_label
to filter the label of the On button. Contributors via github @BassemN, and @valendesigns.ot_on_off_switch_off_value
to filter the value of the Off button. Contributors via github @BassemN, and @valendesigns.ot_on_off_switch_off_label
to filter the label of the Off button. Contributors via github @BassemN, and @valendesigns.ot_on_off_switch_width
to filter the width of the On/Off switch.ot_type_date_picker_readonly
to filter the addition of the readonly attribute.ot_type_date_time_picker_readonly
to filter the addition of the readonly attribute.ot_admin_menu_priority
to filter the admin_menu
action hook priority.theme-options.php
required a second page load.ot_css_file_paths
is saved when is_multisite
for better dynamic.css
file support.dynamic.css
file path in multisite to be dynamic-{current-blog-id}.css
.wp_option_tree
table.ot_get_media_post_ID()
was never able to set the value of the ot_media_post_ID
option because it was already set to empty. Causing the ot_create_media_post()
function to create multiple media posts.ot_get_media_post_ID()
was setting the value of the ot_media_post_ID
option to null
. Causing the ot_create_media_post()
function to create multiple media posts. A clean up script will be added to 2.5.0
.screen_icon()
function.ot_line_height_range_interval
filter being misnamed as ot_line_height_unit_type
. Contributors via github @youri--.post_title
instead of post_name
in ot_get_media_post_ID()
. Contributors via github @clifgriffin.ot_get_media_post_ID()
in the options table as ot_media_post_ID
.background-size
in the Background option type is undefined.load_template
with require
throught the documentation.ot_override_forced_textarea_simple
to allow the Textarea option type to be moved in the DOM and not replaced with the Textarea Simple option type in meta boxes and list items.social-links
.ot-upload-attachment-id
to the elements class
attribute. Contributors via github @valendesigns and @krisarsov.contains
condition string. Contributors via github @designst.load_theme_textdomain()
$path
variable. Contributors via github @PatrickDelancy and @valendesigns.ot_recognized_font_sizes
to dynamically change the font sizes by field ID.ot_recognized_letter_spacing
to dynamically change the letter spacing by field ID.ot_recognized_line_heights
to dynamically change the line heights by field ID.ot_migrate_settings_id
to migrate themes that used option_tree_settings
and now use a custom settings ID.ot_migrate_options_id
to migrate themes that used option_tree
and now use a custom options ID.ot_migrate_layouts_id
to migrate themes that used option_tree_layouts
and now use a custom layouts ID.ot_create_media_post
function creating multiple option-tree
posts.ot_type_date_picker_date_format
to change the date format of the Date Picker option type.ot_type_date_time_picker_date_format
to change the date format of the Date Time Picker option type.ot-gallery-shortcode
to the elements class
attribute..format-settings
div in addition to the class being added to the element. Each class is now appended with -wrap
.theme-options.php
file.ot_type_background_size_choices
filter.null
.null
if no values are saved to the array.readme.txt
and a new demo OptionTree Theme to parallel OptionTree.field_id:is()
or field_id:not()
would now be valid syntax.init_upload_fix
JavaScript method.url_exists
javaScript method. The code will no longer will check if a URL exists on another domain.