From 4bdbfc452690f6b5aad1ffe7521c4c6572bf35a0 Mon Sep 17 00:00:00 2001 From: Joe McGill Date: Thu, 3 Nov 2016 19:01:16 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@39123 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/custom-header.php | 2 +- src/wp-includes/class-wp-customize-manager.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/custom-header.php b/src/wp-admin/custom-header.php index 9822c9ba84..5cc64ef7bf 100644 --- a/src/wp-admin/custom-header.php +++ b/src/wp-admin/custom-header.php @@ -639,7 +639,7 @@ class Custom_Image_Header { diff --git a/src/wp-includes/class-wp-customize-manager.php b/src/wp-includes/class-wp-customize-manager.php index c701364149..6e8faf2a8d 100644 --- a/src/wp-includes/class-wp-customize-manager.php +++ b/src/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', ) ) );