Ticket #38557: 38557.diff
File 38557.diff, 4.3 KB (added by , 8 years ago) |
---|
-
src/wp-admin/custom-header.php
246 246 } 247 247 248 248 $this->default_headers = $_wp_default_headers; 249 $template_directory_uri = get_template_directory_uri();250 $stylesheet_directory_uri = get_stylesheet_directory_uri();251 foreach ( array_keys($this->default_headers) as $header ) {252 $this->default_headers[$header]['url'] = sprintf( $this->default_headers[$header]['url'], $template_directory_uri, $stylesheet_directory_uri );253 $this->default_headers[$header]['thumbnail_url'] = sprintf( $this->default_headers[$header]['thumbnail_url'], $template_directory_uri, $stylesheet_directory_uri );254 }255 249 } 256 250 257 251 /** … … 1080 1074 $this->remove_header_image(); 1081 1075 return; 1082 1076 } 1083 $default = sprintf( $default, get_template_directory_uri(), get_stylesheet_directory_uri() );1084 1077 1085 1078 $default_data = array(); 1086 1079 foreach ( $this->default_headers as $header => $details ) { … … 1333 1326 return $this->default_headers; // easy peasy. 1334 1327 } 1335 1328 1336 $default = sprintf( $default, get_template_directory_uri(), get_stylesheet_directory_uri() );1337 1329 $already_has_default = false; 1338 1330 1339 1331 foreach ( $this->default_headers as $k => $h ) { -
src/wp-includes/class-wp-customize-manager.php
3435 3435 ) ); 3436 3436 3437 3437 $this->add_setting( new WP_Customize_Filter_Setting( $this, 'header_image', array( 3438 'default' => get_theme_support( 'custom-header', 'default-image'),3438 'default' => sprintf( get_theme_support( 'custom-header', 'default-image' ), get_template_directory_uri(), get_stylesheet_directory_uri() ), 3439 3439 'theme_supports' => 'custom-header', 3440 3440 ) ) ); 3441 3441 -
src/wp-includes/theme.php
1128 1128 return new stdClass; 1129 1129 1130 1130 $_wp_random_header = (object) $headers[ array_rand( $headers ) ]; 1131 1132 $_wp_random_header->url = sprintf( $_wp_random_header->url, get_template_directory_uri(), get_stylesheet_directory_uri() );1133 $_wp_random_header->thumbnail_url = sprintf( $_wp_random_header->thumbnail_url, get_template_directory_uri(), get_stylesheet_directory_uri() );1134 1131 } 1135 1132 return $_wp_random_header; 1136 1133 } … … 1242 1239 } else { 1243 1240 $data = get_theme_mod( 'header_image_data' ); 1244 1241 if ( ! $data && current_theme_supports( 'custom-header', 'default-image' ) ) { 1245 $directory_args = array( get_template_directory_uri(), get_stylesheet_directory_uri() );1246 1242 $data = array(); 1247 $data['url'] = $data['thumbnail_url'] = vsprintf( get_theme_support( 'custom-header', 'default-image' ), $directory_args);1243 $data['url'] = $data['thumbnail_url'] = get_theme_support( 'custom-header', 'default-image' ); 1248 1244 if ( ! empty( $_wp_default_headers ) ) { 1249 1245 foreach ( (array) $_wp_default_headers as $default_header ) { 1250 $url = vsprintf( $default_header['url'], $directory_args ); 1251 if ( $data['url'] == $url ) { 1246 if ( $data['url'] == $default_header['url'] ) { 1252 1247 $data = $default_header; 1253 $data['url'] = $url;1254 $data['thumbnail_url'] = vsprintf( $data['thumbnail_url'], $directory_args );1255 1248 break; 1256 1249 } 1257 1250 } … … 1281 1274 function register_default_headers( $headers ) { 1282 1275 global $_wp_default_headers; 1283 1276 1277 $directory_args = array( get_template_directory_uri(), get_stylesheet_directory_uri() ); 1278 1279 foreach ( (array) $headers as $key => $header ) { 1280 if ( isset( $header['url'] ) ) { 1281 $headers[ $key ]['url'] = vsprintf( $header['url'], $directory_args ); 1282 } 1283 1284 if ( isset( $header['thumbnail_url'] ) ) { 1285 $headers[ $key ]['thumbnail_url'] = vsprintf( $header['thumbnail_url'], $directory_args ); 1286 } 1287 } 1288 1284 1289 $_wp_default_headers = array_merge( (array) $_wp_default_headers, (array) $headers ); 1285 1290 } 1286 1291 … … 2094 2099 $args[0]['flex-height'] = true; 2095 2100 } 2096 2101 2102 $args[0]['default-image'] = sprintf( $args[0]['default-image'], get_template_directory_uri(), get_stylesheet_directory_uri() ); 2103 2097 2104 break; 2098 2105 2099 2106 case 'custom-background' :