Make WordPress Core


Ignore:
Timestamp:
03/21/2012 03:36:17 AM (12 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.