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
This commit is contained in:
Weston Ruter 2016-02-29 07:02:24 +00:00
parent 13e409ac15
commit 8ce52f3926
1 changed files with 3 additions and 1 deletions

View File

@ -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();
}
}