Twenty Twelve: remove back compat for custom header image, installs prior to 3.4 will not see it as an option. Props obenland, closes #21231.
git-svn-id: http://core.svn.wordpress.org/trunk@21328 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
80a592d548
commit
cb4f0bf507
|
@ -9,38 +9,9 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* Back compat support for get_custom_header().
|
||||
* New since WordPress version 3.4.
|
||||
*
|
||||
* To provide backward compatibility with previous versions, we
|
||||
* will define our own version of this function.
|
||||
*
|
||||
* @todo Should this go into core instead?
|
||||
*
|
||||
* @return stdClass All properties represent attributes of the current header image.
|
||||
*
|
||||
* @package Twenty_Twelve
|
||||
* @since Twenty Twelve 1.0
|
||||
*/
|
||||
if ( ! function_exists( 'get_custom_header' ) ) {
|
||||
function get_custom_header() {
|
||||
return (object) array(
|
||||
'url' => get_header_image(),
|
||||
'thumbnail_url' => get_header_image(),
|
||||
'width' => HEADER_IMAGE_WIDTH,
|
||||
'height' => HEADER_IMAGE_HEIGHT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup the WordPress core custom header arguments and settings.
|
||||
* Set up the WordPress core custom header arguments and settings.
|
||||
*
|
||||
* Use add_theme_support() to register support for WordPress 3.4+
|
||||
* as well as provide backward compatibility for previous versions.
|
||||
*
|
||||
* Use feature detection of wp_get_theme() which was introduced
|
||||
* in WordPress 3.4.
|
||||
*
|
||||
* @uses twentytwelve_header_style()
|
||||
* @uses twentytwelve_admin_header_style()
|
||||
|
@ -72,19 +43,8 @@ function twentytwelve_custom_header_setup() {
|
|||
'admin-preview-callback' => 'twentytwelve_admin_header_image',
|
||||
);
|
||||
|
||||
// Allow child themes to filter any of these arguments.
|
||||
$args = apply_filters( 'twentytwelve_custom_header_args', $args );
|
||||
|
||||
if ( function_exists( 'wp_get_theme' ) ) {
|
||||
add_theme_support( 'custom-header', $args );
|
||||
} else {
|
||||
// Back compat for < 3.4 versions.
|
||||
define( 'HEADER_TEXTCOLOR', $args['default-text-color'] );
|
||||
define( 'HEADER_IMAGE', $args['default-image'] );
|
||||
define( 'HEADER_IMAGE_WIDTH', $args['width'] );
|
||||
define( 'HEADER_IMAGE_HEIGHT', $args['height'] );
|
||||
add_custom_image_header( $args['wp-head-callback'], $args['admin-head-callback'], $args['admin-preview-callback'] );
|
||||
}
|
||||
// Add support and allow child themes to filter any of these arguments.
|
||||
add_theme_support( 'custom-header', apply_filters( 'twentytwelve_custom_header_args', $args ) );
|
||||
}
|
||||
add_action( 'after_setup_theme', 'twentytwelve_custom_header_setup' );
|
||||
|
||||
|
|
Loading…
Reference in New Issue