Require both wp-head-callback and admin-head-callback for custom header theme support. fixes #20603.
git-svn-id: http://core.svn.wordpress.org/trunk@20684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
bd1224eacf
commit
a5a40528c2
|
@ -3022,13 +3022,12 @@ function clean_pre($matches) {
|
|||
* @param callback $admin_head_callback Call on custom header administration screen.
|
||||
* @param callback $admin_preview_callback Output a custom header image div on the custom header administration screen. Optional.
|
||||
*/
|
||||
function add_custom_image_header( $wp_head_callback = '', $admin_head_callback = '', $admin_preview_callback = '' ) {
|
||||
function add_custom_image_header( $wp_head_callback, $admin_head_callback, $admin_preview_callback = '' ) {
|
||||
_deprecated_function( __FUNCTION__, '3.4', 'add_theme_support( \'custom-header\', $args )' );
|
||||
$args = array();
|
||||
if ( $wp_head_callback )
|
||||
$args['wp-head-callback'] = $wp_head_callback;
|
||||
if ( $admin_head_callback )
|
||||
$args['admin-head-callback'] = $admin_head_callback;
|
||||
$args = array(
|
||||
'wp-head-callback' => $wp_head_callback,
|
||||
'admin-head-callback' => $admin_head_callback,
|
||||
);
|
||||
if ( $admin_preview_callback )
|
||||
$args['admin-preview-callback'] = $admin_preview_callback;
|
||||
return add_theme_support( 'custom-header', $args );
|
||||
|
|
|
@ -1347,7 +1347,7 @@ function _custom_header_background_just_in_time() {
|
|||
add_theme_support( 'custom-header', array( '__jit' => true ) );
|
||||
|
||||
$args = get_theme_support( 'custom-header' );
|
||||
if ( $args[0]['wp-head-callback'] )
|
||||
if ( $args[0]['wp-head-callback'] && $args[0]['admin-head-callback'] ) {
|
||||
add_action( 'wp_head', $args[0]['wp-head-callback'] );
|
||||
|
||||
if ( is_admin() ) {
|
||||
|
@ -1355,6 +1355,7 @@ function _custom_header_background_just_in_time() {
|
|||
$custom_image_header = new Custom_Image_Header( $args[0]['admin-head-callback'], $args[0]['admin-preview-callback'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( current_theme_supports( 'custom-background' ) ) {
|
||||
// In case any constants were defined after an add_custom_background() call, re-run.
|
||||
|
@ -1556,6 +1557,7 @@ function check_theme_switched() {
|
|||
if ( $stylesheet = get_option( 'theme_switched' ) ) {
|
||||
$old_theme = wp_get_theme( $stylesheet );
|
||||
|
||||
|
||||
if ( $old_theme->exists() )
|
||||
do_action( 'after_switch_theme', $old_theme->get('Name'), $old_theme );
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue