Make WordPress Core


Ignore:
Timestamp:
05/19/2017 08:24:58 PM (8 years ago)
Author:
westonruter
Message:

Docs: Improve phpdoc for WP_Customize_Manager, WP_Customize_Control, WP_Customize_Setting, and WP_Customize_Selective_Refresh.

Props 4nickpick, sagarprajapati, ketuchetan, BharatKambariya, mrahmadawais, westonruter.
Fixes #39671.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-setting.php

    r40036 r40804  
    1919class WP_Customize_Setting {
    2020    /**
     21     * Customizer bootstrap instance.
     22     *
     23     * @since 3.4.0
    2124     * @access public
    2225     * @var WP_Customize_Manager
     
    2730     * Unique string identifier for the setting.
    2831     *
     32     * @since 3.4.0
    2933     * @access public
    3034     * @var string
     
    3337
    3438    /**
     39     * Type of customize settings.
     40     *
     41     * @since 3.4.0
    3542     * @access public
    3643     * @var string
     
    4148     * Capability required to edit this setting.
    4249     *
     50     * @since 3.4.0
     51     * @access public
     52     * @var string|array
     53     */
     54    public $capability = 'edit_theme_options';
     55
     56    /**
     57     * Feature a theme is required to support to enable this setting.
     58     *
     59     * @since 3.4.0
     60     * @access public
    4361     * @var string
    4462     */
    45     public $capability = 'edit_theme_options';
    46 
    47     /**
    48      * Feature a theme is required to support to enable this setting.
    49      *
     63    public $theme_supports = '';
     64
     65    /**
     66     * The default value for the setting.
     67     *
     68     * @since 3.4.0
    5069     * @access public
    5170     * @var string
    5271     */
    53     public $theme_supports  = '';
    54     public $default         = '';
    55     public $transport       = 'refresh';
    56 
    57     /**
    58      * Server-side sanitization callback for the setting's value.
    59      *
    60      * @var callback
    61      */
    62     public $validate_callback    = '';
    63     public $sanitize_callback    = '';
     72    public $default = '';
     73
     74    /**
     75     * Options for rendering the live preview of changes in Theme Customizer.
     76     *
     77     * Set this value to 'postMessage' to enable a custom Javascript handler to render changes to this setting
     78     * as opposed to reloading the whole page.
     79     *
     80     * @link https://developer.wordpress.org/themes/customize-api
     81     *
     82     * @since 3.4.0
     83     * @access public
     84     * @var string
     85     */
     86    public $transport = 'refresh';
     87
     88    /**
     89     * Server-side validation callback for the setting's value.
     90     *
     91     * @since 4.6.0
     92     * @access public
     93     * @var callable
     94     */
     95    public $validate_callback = '';
     96
     97    /**
     98     * Callback to filter a Customize setting value in un-slashed form.
     99     *
     100     * @since 3.4.0
     101     * @access public
     102     * @var callable
     103     */
     104    public $sanitize_callback = '';
     105
     106    /**
     107     * Callback to convert a Customize PHP setting value to a value that is JSON serializable.
     108     *
     109     * @since 3.4.0
     110     * @access public
     111     * @var string
     112     */
    64113    public $sanitize_js_callback = '';
    65114
     
    79128
    80129    /**
     130     * ID Data.
     131     *
     132     * @since 3.4.0
     133     * @access protected
    81134     * @var array
    82135     */
     
    96149     *
    97150     * @since 4.4.0
     151     * @static
    98152     * @access protected
    99153     * @var array
    100      * @static
    101154     */
    102155    protected static $aggregated_multidimensionals = array();
     
    169222     *
    170223     * @since 4.4.0
    171      * @access public
    172224     *
    173225     * @return array {
     
    189241     *
    190242     * @since 4.4.0
    191      * @access protected
    192243     */
    193244    protected function aggregate_multidimensional() {
     
    217268     *
    218269     * @since 4.5.0
    219      * @access public
    220270     * @ignore
    221271     */
     
    237287     *
    238288     * @since 4.2.0
    239      * @access public
    240289     *
    241290     * @return bool If preview() has been called.
     
    253302     * @see WP_Customize_Setting::preview()
    254303     * @since 4.1.1
     304     * @access protected
    255305     * @var mixed
    256306     */
     
    266316     * @since 3.4.0
    267317     * @since 4.4.0 Added boolean return value.
    268      * @access public
    269318     *
    270319     * @return bool False when preview short-circuits due no change needing to be previewed.
     
    380429     *
    381430     * @since 4.4.0
    382      * @access private
     431     *
    383432     * @see WP_Customize_Manager::set_post_value()
    384433     * @see WP_Customize_Setting::_multidimensional_preview_filter()
     
    427476     *
    428477     * @since 4.4.0
    429      * @access private
    430478     *
    431479     * @see WP_Customize_Setting::$aggregated_multidimensionals
     
    470518     * @since 3.4.0
    471519     *
    472      * @access public
    473      *
    474520     * @return false|void False if cap check fails or value isn't set or is invalid.
    475521     */
     
    537583     *
    538584     * @since 4.6.0
    539      * @access public
    540585     *
    541586     * @see WP_REST_Request::has_valid_params()
     
    579624     *
    580625     * @since 4.4.0
    581      * @access protected
    582626     *
    583627     * @param mixed $default Value to return if root does not exist.
     
    604648     *
    605649     * @since 4.4.0
    606      * @access protected
    607650     *
    608651     * @param mixed $value Value to set as root of multidimensional setting.
     
    771814     *
    772815     * @since 4.6.0
    773      * @access public
    774816     *
    775817     * @return array Array of parameters passed to JavaScript.
     
    908950}
    909951
    910 /** WP_Customize_Filter_Setting class */
     952/**
     953 * WP_Customize_Filter_Setting class.
     954 */
    911955require_once( ABSPATH . WPINC . '/customize/class-wp-customize-filter-setting.php' );
    912956
    913 /** WP_Customize_Header_Image_Setting class */
     957/**
     958 * WP_Customize_Header_Image_Setting class.
     959 */
    914960require_once( ABSPATH . WPINC . '/customize/class-wp-customize-header-image-setting.php' );
    915961
    916 /** WP_Customize_Background_Image_Setting class */
     962/**
     963 * WP_Customize_Background_Image_Setting class.
     964 */
    917965require_once( ABSPATH . WPINC . '/customize/class-wp-customize-background-image-setting.php' );
    918966
    919 /** WP_Customize_Nav_Menu_Item_Setting class */
     967/**
     968 * WP_Customize_Nav_Menu_Item_Setting class.
     969 */
    920970require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-item-setting.php' );
    921971
    922 /** WP_Customize_Nav_Menu_Setting class */
     972/**
     973 * WP_Customize_Nav_Menu_Setting class.
     974 */
    923975require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-setting.php' );
Note: See TracChangeset for help on using the changeset viewer.