WordPress.org

Make WordPress Core

Changeset 20231


Ignore:
Timestamp:
03/21/12 03:36:17 (2 years ago)
Author:
nacin
Message:

Callbacks for custom headers and custom backgrounds registered through add_theme_support() are now wp-head-callback, admin-head-callback, and admin-preview-callback. see #19910.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentyeleven/functions.php

    r20225 r20231  
    119119        'random-default' => true, 
    120120        // Callback for styling the header. 
    121         'callback' => 'twentyeleven_header_style', 
     121        'wp-head-callback' => 'twentyeleven_header_style', 
    122122        // Callback for styling the header preview in the admin. 
    123         'admin-header-callback' => 'twentyeleven_admin_header_style', 
     123        'admin-head-callback' => 'twentyeleven_admin_header_style', 
    124124        // Callback used to display the header preview in the admin. 
    125         'admin-image-div-callback' => 'twentyeleven_admin_header_image', 
     125        'admin-preview-callback' => 'twentyeleven_admin_header_image', 
    126126    ) ); 
    127127 
  • trunk/wp-content/themes/twentyten/functions.php

    r20225 r20231  
    114114        'header-text' => false, 
    115115        // Callback for styling the header preview in the admin. 
    116         'admin-header-callback' => 'twentyten_admin_header_style', 
     116        'admin-head-callback' => 'twentyten_admin_header_style', 
    117117    ) ); 
    118118 
  • trunk/wp-includes/deprecated.php

    r20220 r20231  
    29912991 * @see add_theme_support() 
    29922992 * 
    2993  * @param callback $callback Call on 'wp_head' action. 
    2994  * @param callback $admin_header_callback Call on custom header administration screen. 
    2995  * @param callback $admin_image_div_callback Output a custom header image div on the custom header administration screen. Optional. 
    2996  */ 
    2997 function add_custom_image_header( $callback, $admin_header_callback, $admin_image_div_callback = '' ) { 
     2993 * @param callback $wp_head_callback Call on 'wp_head' action. 
     2994 * @param callback $admin_head_callback Call on custom header administration screen. 
     2995 * @param callback $admin_preview_callback Output a custom header image div on the custom header administration screen. Optional. 
     2996 */ 
     2997function 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 )' ); 
    29992999    return add_theme_support( 'custom-header', array( 
    3000         'callback' => $callback, 
    3001         'admin-header-callback' => $admin_header_callback, 
    3002         'admin-image-div-callback' => $admin_image_div_callback, 
     3000        'wp-head-callback' => $wp_head_callback, 
     3001        'admin-head-callback' => $admin_head_callback, 
     3002        'admin-preview-callback' => $admin_preview_callback, 
    30033003    ) ); 
    30043004} 
     
    30223022 * Add callbacks for background image display. 
    30233023 * 
    3024  * The parameter $header_callback callback will be required to display the 
    3025  * content for the 'wp_head' action. The parameter $admin_header_callback 
    3026  * callback will be added to Custom_Background class and that will be added 
    3027  * to the 'admin_menu' action. 
    3028  * 
    30293024 * @since 3.0.0 
    3030  * @uses Custom_Background Sets up for $admin_header_callback for administration panel display. 
    3031  * 
    3032  * @param callback $callback Call on 'wp_head' action. 
    3033  * @param callback $admin_header_callback Call on custom background administration screen. 
    3034  * @param callback $admin_image_div_callback Output a custom background image div on the custom background administration screen. Optional. 
    3035  */ 
    3036 function add_custom_background( $callback = '', $admin_header_callback = '', $admin_image_div_callback = '' ) { 
     3025 * @deprecated 3.4.0 
     3026 * @deprecated Use add_theme_support('custom-background, $args) 
     3027 * @see add_theme_support() 
     3028 * 
     3029 * @param callback $wp_head_callback Call on 'wp_head' action. 
     3030 * @param callback $admin_head_callback Call on custom background administration screen. 
     3031 * @param callback $admin_preview_callback Output a custom background image div on the custom background administration screen. Optional. 
     3032 */ 
     3033function add_custom_background( $wp_head_callback = '', $admin_head_callback = '', $admin_preview_callback = '' ) { 
    30373034    _deprecated_function( __FUNCTION__, '3.4', 'add_theme_support( \'custom-background\', $args )' ); 
    30383035 
    30393036    return add_theme_support( 'custom-background', array( 
    3040         'callback' => $callback, 
    3041         'admin-header-callback' => $admin_header_callback, 
    3042         'admin-image-div-callback' => $admin_image_div_callback, 
     3037        'wp-head-callback' => $wp_head_callback, 
     3038        'admin-head-callback' => $admin_head_callback, 
     3039        'admin-preview-callback' => $admin_preview_callback, 
    30433040    ) ); 
    30443041} 
  • trunk/wp-includes/theme.php

    r20221 r20231  
    12971297                'header-text' => true, 
    12981298                'uploads' => true, 
    1299                 'callback' => '', 
    1300                 'admin-header-callback' => '', 
    1301                 'admin-image-div-callback' => '', 
     1299                'wp-head-callback' => '', 
     1300                'admin-head-callback' => '', 
     1301                'admin-preview-callback' => '', 
    13021302            ); 
    13031303 
     
    13671367                'default-image' => '', 
    13681368                'default-color' => '', 
    1369                 'callback' => '', 
    1370                 'admin-header-callback' => '', 
    1371                 'admin-image-div-callback' => '', 
     1369                'wp-head-callback' => '_custom_background_cb', 
     1370                'admin-head-callback' => '', 
     1371                'admin-preview-callback' => '', 
    13721372            ); 
    13731373 
     
    13921392                define( 'BACKGROUND_IMAGE', $args[0]['default-image'] ); 
    13931393 
    1394             if ( empty( $args[0]['callback'] ) ) 
    1395                 $args[0]['callback'] = '_custom_background_cb'; 
    1396  
    13971394            break; 
    13981395    } 
     
    14151412 
    14161413        $args = get_theme_support( 'custom-header' ); 
    1417         if ( $args[0]['callback'] ) 
    1418             add_action( 'wp_head', $args[0]['callback'] ); 
     1414        if ( $args[0]['wp-head-callback'] ) 
     1415            add_action( 'wp_head', $args[0]['wp-head-callback'] ); 
    14191416 
    14201417        if ( is_admin() ) { 
    14211418            require_once( ABSPATH . 'wp-admin/custom-header.php' ); 
    1422             $custom_image_header = new Custom_Image_Header( $args[0]['admin-header-callback'], $args[0]['admin-image-div-callback'] ); 
     1419            $custom_image_header = new Custom_Image_Header( $args[0]['admin-head-callback'], $args[0]['admin-preview-callback'] ); 
    14231420        } 
    14241421    } 
     
    14291426 
    14301427        $args = get_theme_support( 'custom-background' ); 
    1431         add_action( 'wp_head', $args[0]['callback'] ); 
     1428        add_action( 'wp_head', $args[0]['wp-head-callback'] ); 
    14321429 
    14331430        if ( is_admin() ) { 
    14341431            require_once( ABSPATH . 'wp-admin/custom-background.php' ); 
    1435             $custom_background = new Custom_Background( $args[0]['admin-header-callback'], $args[0]['admin-image-div-callback'] ); 
     1432            $custom_background = new Custom_Background( $args[0]['admin-head-callback'], $args[0]['admin-preview-callback'] ); 
    14361433        } 
    14371434    } 
     
    15101507        case 'custom-header' : 
    15111508            $support = get_theme_support( 'custom-header' ); 
    1512             if ( $support[0]['callback'] ) 
    1513                 remove_action( 'wp_head', $support[0]['callback'] ); 
     1509            if ( $support[0]['wp-head-callback'] ) 
     1510                remove_action( 'wp_head', $support[0]['wp-head-callback'] ); 
    15141511            remove_action( 'admin_menu', array( $GLOBALS['custom_image_header'], 'init' ) ); 
    15151512            unset( $GLOBALS['custom_image_header'] ); 
     
    15181515        case 'custom-background' : 
    15191516            $support = get_theme_support( 'custom-background' ); 
    1520             remove_action( 'wp_head', $support[0]['callback'] ); 
     1517            remove_action( 'wp_head', $support[0]['wp-head-callback'] ); 
    15211518            remove_action( 'admin_menu', array( $GLOBALS['custom_background'], 'init' ) ); 
    15221519            unset( $GLOBALS['custom_background'] ); 
Note: See TracChangeset for help on using the changeset viewer.