WordPress.org

Make WordPress Core

Ticket #39671: 39671.patch

File 39671.patch, 5.1 KB (added by 4nickpick, 3 years ago)

Improves inline documentation for add_partial

  • wp-includes/customize/class-wp-customize-selective-refresh.php

    diff --git wp-includes/customize/class-wp-customize-selective-refresh.php wp-includes/customize/class-wp-customize-selective-refresh.php
    index 23d5a9488..39a6954e0 100644
    final class WP_Customize_Selective_Refresh { 
    9191         * @access public
    9292         *
    9393         * @param WP_Customize_Partial|string $id   Customize Partial object, or Panel ID.
    94          * @param array                       $args Optional. Partial arguments. Default empty array.
     94         * @param array                       $args {
     95         *     Optional. Array of properties for the new Partials object. Default empty array.
     96         *
     97         *     @type string   $type                  Type of the partial to be created.
     98         *     @type string   $selector              The jQuery selector to find the container element for the partial.
     99         *     @type array    $settings              IDs for settings tied to the partial.
     100         *     @type string   $primary_setting       The ID for the setting that this partial is primarily responsible for
     101         *                                           rendering. If not supplied, it will default to the ID of the first setting.
     102         *     @type string   $capability            Capability required to edit this partial.
     103         *                                           Normally this is empty and the capability is derived from the capabilities
     104         *                                           of the associated `$settings`.
     105         *     @type callable $render_callback       Render callback.
     106         *                                           Callback is called with one argument, the instance of WP_Customize_Partial.
     107         *                                           The callback can either echo the partial or return the partial as a string,
     108         *                                           or return false if error.
     109         *     @type bool     $container_inclusive   Whether the container element is included in the partial, or if only
     110         *                                           the contents are rendered.
     111         *     @type bool     $fallback_refresh      Whether to refresh the entire preview in case a partial cannot be refreshed.
     112         *                                           A partial render is considered a failure if the render_callback returns
     113         *                                           false.
     114         * }
     115         *
    95116         * @return WP_Customize_Partial             The instance of the panel that was added.
    96117         */
    97118        public function add_partial( $id, $args = array() ) {