WordPress.org

Make WordPress Core

Changeset 47384


Ignore:
Timestamp:
02/27/2020 08:07:31 PM (19 months ago)
Author:
SergeyBiryukov
Message:

Docs: Add a reference to WP_Customize_Setting::__construct() for information on accepted arguments in WP_Customize_Manager::add_setting().

Synchronize the documentation between two places, use WP_Customize_Setting::__construct() as the canonical source.

Props tmanoilov, marekdedic.
Fixes #48347.

Location:
trunk/src/wp-includes
Files:
3 edited

Legend:

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

    r47364 r47384  
    175175     * @param string               $id      Control ID.
    176176     * @param array                $args    {
    177      *     Optional. Arguments to override class property defaults.
     177     *     Optional. Array of properties for the new Control object. Default empty array.
    178178     *
    179179     *     @type int                  $instance_number Order in which this instance was created in relation
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r47382 r47384  
    31613161     * @param int      $user_id The user ID.
    31623162     * @param array    $args    Adds the context to the cap. Typically the object ID.
    3163      * @return array   Capabilities.
     3163     * @return array Capabilities.
    31643164     */
    31653165    public function grant_edit_post_capability_for_changeset( $caps, $cap, $user_id, $args ) {
     
    33573357     * @param WP_Post $last_revision    The last revision post object.
    33583358     * @param WP_Post $post             The post object.
    3359      *
    33603359     * @return bool Whether a revision should be made.
    33613360     */
     
    36813680     * @since 4.5.0 Return added WP_Customize_Setting instance.
    36823681     *
     3682     * @see WP_Customize_Setting::__construct()
    36833683     * @link https://developer.wordpress.org/themes/customize-api
    36843684     *
    36853685     * @param WP_Customize_Setting|string $id   Customize Setting object, or ID.
    3686      * @param array                       $args {
    3687      *  Optional. Array of properties for the new WP_Customize_Setting. Default empty array.
    3688      *
    3689      *  @type string       $type                  Type of the setting. Default 'theme_mod'.
    3690      *  @type string       $capability            Capability required for the setting. Default 'edit_theme_options'
    3691      *  @type string|array $theme_supports        Theme features required to support the panel. Default is none.
    3692      *  @type string       $default               Default value for the setting. Default is empty string.
    3693      *  @type string       $transport             Options for rendering the live preview of changes in Customizer.
    3694      *                                            Using 'refresh' makes the change visible by reloading the whole preview.
    3695      *                                            Using 'postMessage' allows a custom JavaScript to handle live changes.
    3696      *                                            Default is 'refresh'.
    3697      *  @type callable     $validate_callback     Server-side validation callback for the setting's value.
    3698      *  @type callable     $sanitize_callback     Callback to filter a Customize setting value in un-slashed form.
    3699      *  @type callable     $sanitize_js_callback  Callback to convert a Customize PHP setting value to a value that is
    3700      *                                            JSON serializable.
    3701      *  @type bool         $dirty                 Whether or not the setting is initially dirty when created.
    3702      * }
    3703      * @return WP_Customize_Setting             The instance of the setting that was added.
     3686     * @param array                       $args Optional. Array of properties for the new Setting object.
     3687     *                                          See WP_Customize_Setting::__construct() for information
     3688     *                                          on accepted arguments. Default empty array.
     3689     * @return WP_Customize_Setting The instance of the setting that was added.
    37043690     */
    37053691    public function add_setting( $id, $args = array() ) {
     
    38283814     *  @type callable     $active_callback       Active callback.
    38293815     * }
    3830      * @return WP_Customize_Panel             The instance of the panel that was added.
     3816     * @return WP_Customize_Panel The instance of the panel that was added.
    38313817     */
    38323818    public function add_panel( $id, $args = array() ) {
     
    39263912     *  @type bool         $description_hidden    Hide the description behind a help icon, instead of inline above the first control. Default false.
    39273913     * }
    3928      * @return WP_Customize_Section             The instance of the section that was added.
     3914     * @return WP_Customize_Section The instance of the section that was added.
    39293915     */
    39303916    public function add_section( $id, $args = array() ) {
     
    40053991     *                                          See WP_Customize_Control::__construct() for information
    40063992     *                                          on accepted arguments. Default empty array.
    4007      * @return WP_Customize_Control             The instance of the control that was added.
     3993     * @return WP_Customize_Control The instance of the control that was added.
    40083994     */
    40093995    public function add_control( $id, $args = array() ) {
  • trunk/src/wp-includes/class-wp-customize-setting.php

    r47383 r47384  
    157157     * @param string               $id      A specific ID of the setting.
    158158     *                                      Can be a theme mod or option name.
    159      * @param array                $args    Setting arguments.
     159     * @param array                $args    {
     160     *  Optional. Array of properties for the new Setting object. Default empty array.
     161     *
     162     *  @type string       $type                  Type of the setting. Default 'theme_mod'.
     163     *  @type string       $capability            Capability required for the setting. Default 'edit_theme_options'
     164     *  @type string|array $theme_supports        Theme features required to support the panel. Default is none.
     165     *  @type string       $default               Default value for the setting. Default is empty string.
     166     *  @type string       $transport             Options for rendering the live preview of changes in Customizer.
     167     *                                            Using 'refresh' makes the change visible by reloading the whole preview.
     168     *                                            Using 'postMessage' allows a custom JavaScript to handle live changes.
     169     *                                            Default is 'refresh'.
     170     *  @type callable     $validate_callback     Server-side validation callback for the setting's value.
     171     *  @type callable     $sanitize_callback     Callback to filter a Customize setting value in un-slashed form.
     172     *  @type callable     $sanitize_js_callback  Callback to convert a Customize PHP setting value to a value that is
     173     *                                            JSON serializable.
     174     *  @type bool         $dirty                 Whether or not the setting is initially dirty when created.
     175     * }
    160176     */
    161177    public function __construct( $manager, $id, $args = array() ) {
Note: See TracChangeset for help on using the changeset viewer.