WordPress.org

Make WordPress Core

Changeset 48617


Ignore:
Timestamp:
07/25/2020 07:38:34 PM (2 months ago)
Author:
SergeyBiryukov
Message:

Docs: Add a reference to WP_Customize_Partial::__construct() for information on accepted arguments in WP_Customize_Selective_Refresh::add_partial().

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

Props marekdedic.
See #49572.

Location:
trunk/src/wp-includes/customize
Files:
2 edited

Legend:

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

    r48067 r48617  
    6969     *
    7070     * @since 4.5.0
    71      * @var array
     71     * @var string[]
    7272     */
    7373    public $settings;
     
    135135     * @param WP_Customize_Selective_Refresh $component Customize Partial Refresh plugin instance.
    136136     * @param string                         $id        Control ID.
    137      * @param array                          $args      {
    138      *     Optional. Arguments to override class property defaults.
    139      *
    140      *     @type array|string $settings All settings IDs tied to the partial. If undefined, `$id` will be used.
     137     * @param array                          $args {
     138     *     Optional. Array of properties for the new Partials object. Default empty array.
     139     *
     140     *     @type string   $type                  Type of the partial to be created.
     141     *     @type string   $selector              The jQuery selector to find the container element for the partial, that is,
     142     *                                           a partial's placement.
     143     *     @type string[] $settings              IDs for settings tied to the partial. If undefined, `$id` will be used.
     144     *     @type string   $primary_setting       The ID for the setting that this partial is primarily responsible for
     145     *                                           rendering. If not supplied, it will default to the ID of the first setting.
     146     *     @type string   $capability            Capability required to edit this partial.
     147     *                                           Normally this is empty and the capability is derived from the capabilities
     148     *                                           of the associated `$settings`.
     149     *     @type callable $render_callback       Render callback.
     150     *                                           Callback is called with one argument, the instance of WP_Customize_Partial.
     151     *                                           The callback can either echo the partial or return the partial as a string,
     152     *                                           or return false if error.
     153     *     @type bool     $container_inclusive   Whether the container element is included in the partial, or if only
     154     *                                           the contents are rendered.
     155     *     @type bool     $fallback_refresh      Whether to refresh the entire preview in case a partial cannot be refreshed.
     156     *                                           A partial render is considered a failure if the render_callback returns
     157     *                                           false.
    141158     * }
    142159     */
  • trunk/src/wp-includes/customize/class-wp-customize-selective-refresh.php

    r48111 r48617  
    8484     * @since 4.5.0
    8585     *
    86      * @param WP_Customize_Partial|string $id   Customize Partial object, or Panel ID.
    87      * @param array                       $args {
    88      *  Optional. Array of properties for the new Partials object. Default empty array.
    89      *
    90      *  @type string   $type                  Type of the partial to be created.
    91      *  @type string   $selector              The jQuery selector to find the container element for the partial, that is, a partial's placement.
    92      *  @type array    $settings              IDs for settings tied to the partial.
    93      *  @type string   $primary_setting       The ID for the setting that this partial is primarily responsible for
    94      *                                        rendering. If not supplied, it will default to the ID of the first setting.
    95      *  @type string   $capability            Capability required to edit this partial.
    96      *                                        Normally this is empty and the capability is derived from the capabilities
    97      *                                        of the associated `$settings`.
    98      *  @type callable $render_callback       Render callback.
    99      *                                        Callback is called with one argument, the instance of WP_Customize_Partial.
    100      *                                        The callback can either echo the partial or return the partial as a string,
    101      *                                        or return false if error.
    102      *  @type bool     $container_inclusive   Whether the container element is included in the partial, or if only
    103      *                                        the contents are rendered.
    104      *  @type bool     $fallback_refresh      Whether to refresh the entire preview in case a partial cannot be refreshed.
    105      *                                        A partial render is considered a failure if the render_callback returns
    106      *                                        false.
    107      * }
    108      * @return WP_Customize_Partial             The instance of the panel that was added.
     86     * @see WP_Customize_Partial::__construct()
     87     *
     88     * @param WP_Customize_Partial|string $id   Customize Partial object, or Partial ID.
     89     * @param array                       $args Optional. Array of properties for the new Partials object.
     90     *                                          See WP_Customize_Partial::__construct() for information
     91     *                                          on accepted arguments. Default empty array.
     92     * @return WP_Customize_Partial The instance of the partial that was added.
    10993     */
    11094    public function add_partial( $id, $args = array() ) {
Note: See TracChangeset for help on using the changeset viewer.