WordPress.org

Make WordPress Core

Changeset 20246


Ignore:
Timestamp:
03/21/12 22:21:22 (6 years ago)
Author:
nacin
Message:

Only pass arguments from the deprecated add_custom_background() or add_custom_image_header() to add_theme_support() if the argument was actually supplied. With [20212], default argument values (like wp-head-callback=_custom_background_cb) only work for arguments that were not explicitly set, so don't set empty values. see #20249.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/deprecated.php

    r20231 r20246  
    29972997function add_custom_image_header( $wp_head_callback = '', $admin_head_callback = '', $admin_preview_callback = '' ) { 
    29982998    _deprecated_function( __FUNCTION__, '3.4', 'add_theme_support( \'custom-header\', $args )' ); 
    2999     return add_theme_support( 'custom-header', array( 
    3000         'wp-head-callback' => $wp_head_callback, 
    3001         'admin-head-callback' => $admin_head_callback, 
    3002         'admin-preview-callback' => $admin_preview_callback, 
    3003     ) ); 
     2999    $args = array(); 
     3000    if ( $wp_head_callback ) 
     3001        $args['wp-head-callback'] = $wp_head_callback; 
     3002    if ( $admin_head_callback ) 
     3003        $args['admin-head-callback'] = $admin_head_callback; 
     3004    if ( $admin_preview_callback ) 
     3005        $args['admin-preview-callback'] = $admin_preview_callback; 
     3006    return add_theme_support( 'custom-background', $args ); 
    30043007} 
    30053008 
     
    30333036function add_custom_background( $wp_head_callback = '', $admin_head_callback = '', $admin_preview_callback = '' ) { 
    30343037    _deprecated_function( __FUNCTION__, '3.4', 'add_theme_support( \'custom-background\', $args )' ); 
    3035  
    3036     return add_theme_support( 'custom-background', array( 
    3037         'wp-head-callback' => $wp_head_callback, 
    3038         'admin-head-callback' => $admin_head_callback, 
    3039         'admin-preview-callback' => $admin_preview_callback, 
    3040     ) ); 
     3038    $args = array(); 
     3039    if ( $wp_head_callback ) 
     3040        $args['wp-head-callback'] = $wp_head_callback; 
     3041    if ( $admin_head_callback ) 
     3042        $args['admin-head-callback'] = $admin_head_callback; 
     3043    if ( $admin_preview_callback ) 
     3044        $args['admin-preview-callback'] = $admin_preview_callback; 
     3045    return add_theme_support( 'custom-background', $args ); 
    30413046} 
    30423047 
Note: See TracChangeset for help on using the changeset viewer.