From 8fa49e77bd8552d2bc0710fca2a3f67b3fa48d5e Mon Sep 17 00:00:00 2001 From: Joe McGill Date: Fri, 4 Nov 2016 17:10:01 +0000 Subject: [PATCH] Themes: Improve support for placeholders in default headers. When themes register default headers, they can use sprintf style placeholder strings in place of the template directory URI, which WordPress transforms in several places by running the value of `get_theme_support( 'custom-header', 'default-image' )` through `sprintf()`. This fixes a few places where WordPress skipped the `sprintf()` step and referenced the `get_theme_support()` value directly. Props bradyvercher for initial patch. See #38557. Built from https://develop.svn.wordpress.org/trunk@39123 git-svn-id: http://core.svn.wordpress.org/trunk@39063 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/custom-header.php | 2 +- wp-includes/class-wp-customize-manager.php | 3 +-- wp-includes/version.php | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php index 9822c9ba84..5cc64ef7bf 100644 --- a/wp-admin/custom-header.php +++ b/wp-admin/custom-header.php @@ -639,7 +639,7 @@ class Custom_Image_Header { diff --git a/wp-includes/class-wp-customize-manager.php b/wp-includes/class-wp-customize-manager.php index c701364149..6e8faf2a8d 100644 --- a/wp-includes/class-wp-customize-manager.php +++ b/wp-includes/class-wp-customize-manager.php @@ -3439,12 +3439,11 @@ final class WP_Customize_Manager { ) ); $this->add_setting( new WP_Customize_Filter_Setting( $this, 'header_image', array( - 'default' => get_theme_support( 'custom-header', 'default-image' ), + 'default' => sprintf( get_theme_support( 'custom-header', 'default-image' ), get_template_directory_uri(), get_stylesheet_directory_uri() ), 'theme_supports' => 'custom-header', ) ) ); $this->add_setting( new WP_Customize_Header_Image_Setting( $this, 'header_image_data', array( - // 'default' => get_theme_support( 'custom-header', 'default-image' ), 'theme_supports' => 'custom-header', ) ) ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 6281ad421e..2f2effccf3 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-beta1-39122'; +$wp_version = '4.7-beta1-39123'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.