From 8ce52f3926fb8b1943f8726f5b3c3c0117af9d79 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Mon, 29 Feb 2016 07:02:24 +0000 Subject: [PATCH] Customize: Fix PHP notice when calling `WP_Customize_Control::json()` inside `content_template()` method. A `temp` control is instantiated when `WP_Customize_Manager:: render_control_templates()` is called. This control needs to explicitly specify an empty settings array to avoid trying to use a `temp` setting which won't exist. See #35926. See #29572. git-svn-id: https://develop.svn.wordpress.org/trunk@36776 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-customize-manager.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/class-wp-customize-manager.php b/src/wp-includes/class-wp-customize-manager.php index 1b02c3ad6d..10d7f3a74a 100644 --- a/src/wp-includes/class-wp-customize-manager.php +++ b/src/wp-includes/class-wp-customize-manager.php @@ -1401,7 +1401,9 @@ final class WP_Customize_Manager { */ public function render_control_templates() { foreach ( $this->registered_control_types as $control_type ) { - $control = new $control_type( $this, 'temp', array() ); + $control = new $control_type( $this, 'temp', array( + 'settings' => array(), + ) ); $control->print_template(); } }