Make WordPress Core


Ignore:
Timestamp:
03/19/2012 09:14:41 PM (13 years ago)
Author:
nacin
Message:

Deprecate add_custom_image_header(), remove_custom_image_header(), add_custom_background(), remove_custom_background(). Replacements are add_theme_support() and remove_theme_support(). see #20249.

File:
1 edited

Legend:

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

    r20193 r20218  
    29822982    return wp_get_theme()->get('Name');
    29832983}
     2984
     2985/**
     2986 * Add callbacks for image header display.
     2987 *
     2988 * @since 2.1.0
     2989 * @deprecated 3.4.0
     2990 * @deprecated Use add_theme_support('custom-header', $args)
     2991 * @see add_theme_support()
     2992 *
     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 */
     2997function add_custom_image_header( $callback, $admin_header_callback, $admin_image_div_callback = '' ) {
     2998    _deprecated_function( __FUNCTION__, '3.4', 'add_theme_support(\'custom-header\', $args)' );
     2999    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,
     3003    ) );
     3004}
     3005
     3006/**
     3007 * Remove image header support.
     3008 *
     3009 * @since 3.1.0
     3010 * @deprecated 3.4.0
     3011 * @deprecated Use remove_theme_support('custom-header')
     3012 * @see remove_theme_support()
     3013 *
     3014 * @return bool Whether support was removed.
     3015 */
     3016function remove_custom_image_header() {
     3017    _deprecated_function( __FUNCTION__, '3.4', 'remove_theme_support(\'custom-header\')' );
     3018    return remove_theme_support( 'custom-header' );
     3019}
     3020
     3021/**
     3022 * Add callbacks for background image display.
     3023 *
     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 *
     3029 * @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 */
     3036function add_custom_background( $callback = '', $admin_header_callback = '', $admin_image_div_callback = '' ) {
     3037    if ( $callback || $admin_header_callback || $admin_image_div_callback )
     3038        _deprecated_function( __FUNCTION__, '3.4', 'add_theme_support(\'custom-background\', $args)' );
     3039    else
     3040        _deprecated_function( __FUNCTION__, '3.4', 'add_theme_support(\'custom-background\')' );
     3041
     3042    return add_theme_support( 'custom-background', array(
     3043        'callback' => $callback,
     3044        'admin-header-callback' => $admin_header_callback,
     3045        'admin-image-div-callback' => $admin_image_div_callback,
     3046    ) );
     3047}
     3048
     3049/**
     3050 * Remove custom background support.
     3051 *
     3052 * @since 3.1.0
     3053 * @see add_custom_background()
     3054 *
     3055 * @return bool Whether support was removed.
     3056 */
     3057function remove_custom_background() {
     3058    _deprecated_function( __FUNCTION__, '3.4', 'remove_theme_support(\'custom-background\')' );
     3059    return remove_theme_support( 'custom-background' );
     3060}
Note: See TracChangeset for help on using the changeset viewer.