diff --git a/wp-includes/theme.php b/wp-includes/theme.php index f8cf1688ac..d35a337ebf 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -1931,22 +1931,27 @@ function require_if_theme_supports( $feature, $include ) { * Checks an attachment being deleted to see if it's a header or background image. * * If true it removes the theme modification which would be pointing at the deleted - * attachment + * attachment. * * @access private * @since 3.0.0 - * @param int $id the attachment id + * @since 4.3.0 Also removes `header_image_data`. + * + * @param int $id The attachment id. */ function _delete_attachment_theme_mod( $id ) { $attachment_image = wp_get_attachment_url( $id ); - $header_image = get_header_image(); + $header_image = get_header_image(); $background_image = get_background_image(); - if ( $header_image && $header_image == $attachment_image ) + if ( $header_image && $header_image == $attachment_image ) { remove_theme_mod( 'header_image' ); + remove_theme_mod( 'header_image_data' ); + } - if ( $background_image && $background_image == $attachment_image ) + if ( $background_image && $background_image == $attachment_image ) { remove_theme_mod( 'background_image' ); + } } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 44b039ac2f..8825bd4d08 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-beta2-33276'; +$wp_version = '4.3-beta2-33278'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.