wp/wp-includes/customize/class-wp-customize-selective-refresh.php
changeset 16 a86126ab1dd4
parent 9 177826044cd9
child 18 be944660c56a
--- a/wp/wp-includes/customize/class-wp-customize-selective-refresh.php	Tue Oct 22 16:11:46 2019 +0200
+++ b/wp/wp-includes/customize/class-wp-customize-selective-refresh.php	Tue Dec 15 13:49:49 2020 +0100
@@ -49,7 +49,7 @@
 	 * Keep track of the current partial being rendered.
 	 *
 	 * @since 4.5.0
-	 * @var string
+	 * @var string|null
 	 */
 	protected $current_partial_id;
 
@@ -58,11 +58,11 @@
 	 *
 	 * @since 4.5.0
 	 *
-	 * @param WP_Customize_Manager $manager Manager instance.
+	 * @param WP_Customize_Manager $manager Customizer bootstrap instance.
 	 */
 	public function __construct( WP_Customize_Manager $manager ) {
 		$this->manager = $manager;
-		require_once( ABSPATH . WPINC . '/customize/class-wp-customize-partial.php' );
+		require_once ABSPATH . WPINC . '/customize/class-wp-customize-partial.php';
 
 		add_action( 'customize_preview_init', array( $this, 'init_preview' ) );
 	}
@@ -83,29 +83,13 @@
 	 *
 	 * @since 4.5.0
 	 *
-	 * @param WP_Customize_Partial|string $id   Customize Partial object, or Panel ID.
-	 * @param array                       $args {
-	 *  Optional. Array of properties for the new Partials object. Default empty array.
+	 * @see WP_Customize_Partial::__construct()
 	 *
-	 *  @type string   $type                  Type of the partial to be created.
-	 *  @type string   $selector              The jQuery selector to find the container element for the partial, that is, a partial's placement.
-	 *  @type array    $settings              IDs for settings tied to the partial.
-	 *  @type string   $primary_setting       The ID for the setting that this partial is primarily responsible for
-	 *                                        rendering. If not supplied, it will default to the ID of the first setting.
-	 *  @type string   $capability            Capability required to edit this partial.
-	 *                                        Normally this is empty and the capability is derived from the capabilities
-	 *                                        of the associated `$settings`.
-	 *  @type callable $render_callback       Render callback.
-	 *                                        Callback is called with one argument, the instance of WP_Customize_Partial.
-	 *                                        The callback can either echo the partial or return the partial as a string,
-	 *                                        or return false if error.
-	 *  @type bool     $container_inclusive   Whether the container element is included in the partial, or if only
-	 *                                        the contents are rendered.
-	 *  @type bool     $fallback_refresh      Whether to refresh the entire preview in case a partial cannot be refreshed.
-	 *                                        A partial render is considered a failure if the render_callback returns
-	 *                                        false.
-	 * }
-	 * @return WP_Customize_Partial             The instance of the panel that was added.
+	 * @param WP_Customize_Partial|string $id   Customize Partial object, or Partial ID.
+	 * @param array                       $args Optional. Array of properties for the new Partials object.
+	 *                                          See WP_Customize_Partial::__construct() for information
+	 *                                          on accepted arguments. Default empty array.
+	 * @return WP_Customize_Partial The instance of the partial that was added.
 	 */
 	public function add_partial( $id, $args = array() ) {
 		if ( $id instanceof WP_Customize_Partial ) {
@@ -208,7 +192,7 @@
 		);
 
 		// Export data to JS.
-		echo sprintf( '<script>var _customizePartialRefreshExports = %s;</script>', wp_json_encode( $exports ) );
+		printf( '<script>var _customizePartialRefreshExports = %s;</script>', wp_json_encode( $exports ) );
 	}
 
 	/**