From 51be161019871c14b0fd02e79b41ec872d576114 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Sun, 25 Jun 2017 07:03:16 +0000 Subject: [PATCH] Customize: Ensure `header_image_data` setting exists before attempting to use it. Amends [27497]. Props Collizo4sky. Fixes #41007. git-svn-id: https://develop.svn.wordpress.org/trunk@40935 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/custom-header.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/custom-header.php b/src/wp-admin/custom-header.php index b9aecf2485..85238bf21c 100644 --- a/src/wp-admin/custom-header.php +++ b/src/wp-admin/custom-header.php @@ -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;