Customize: Ensure `header_image_data` setting exists before attempting to use it.

Amends [27497].
Props Collizo4sky.
Fixes #41007.

Built from https://develop.svn.wordpress.org/trunk@40935


git-svn-id: http://core.svn.wordpress.org/trunk@40785 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter 2017-06-25 07:04:42 +00:00
parent 332884f8dc
commit 980f342ad6
2 changed files with 7 additions and 2 deletions

View File

@ -1321,7 +1321,12 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?>
* @param WP_Customize_Manager $wp_customize Customize manager.
*/
public function customize_set_last_used( $wp_customize ) {
$data = $wp_customize->get_setting( 'header_image_data' )->post_value();
$header_image_data_setting = $wp_customize->get_setting( 'header_image_data' );
if ( ! $header_image_data_setting ) {
return;
}
$data = $header_image_data_setting->post_value();
if ( ! isset( $data['attachment_id'] ) ) {
return;

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.9-alpha-40934';
$wp_version = '4.9-alpha-40935';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.