From 980f342ad6c41b82f6d94a77b9e8ccc541ca1df6 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Sun, 25 Jun 2017 07:04:42 +0000 Subject: [PATCH] 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 --- wp-admin/custom-header.php | 7 ++++++- wp-includes/version.php | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php index b9aecf2485..85238bf21c 100644 --- a/wp-admin/custom-header.php +++ b/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; diff --git a/wp-includes/version.php b/wp-includes/version.php index c51f719d6f..bc8ff25740 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.