Changeset 20231
- Timestamp:
- 03/21/2012 03:36:17 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/themes/twentyeleven/functions.php
r20225 r20231 119 119 'random-default' => true, 120 120 // Callback for styling the header. 121 ' callback' => 'twentyeleven_header_style',121 'wp-head-callback' => 'twentyeleven_header_style', 122 122 // Callback for styling the header preview in the admin. 123 'admin-head er-callback' => 'twentyeleven_admin_header_style',123 'admin-head-callback' => 'twentyeleven_admin_header_style', 124 124 // 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', 126 126 ) ); 127 127 -
trunk/wp-content/themes/twentyten/functions.php
r20225 r20231 114 114 'header-text' => false, 115 115 // Callback for styling the header preview in the admin. 116 'admin-head er-callback' => 'twentyten_admin_header_style',116 'admin-head-callback' => 'twentyten_admin_header_style', 117 117 ) ); 118 118 -
trunk/wp-includes/deprecated.php
r20220 r20231 2991 2991 * @see add_theme_support() 2992 2992 * 2993 * @param callback $ callback Call on 'wp_head' action.2994 * @param callback $admin_head er_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 */ 2997 function add_custom_image_header( $wp_head_callback = '', $admin_head_callback = '', $admin_preview_callback = '' ) { 2998 2998 _deprecated_function( __FUNCTION__, '3.4', 'add_theme_support( \'custom-header\', $args )' ); 2999 2999 return add_theme_support( 'custom-header', array( 3000 ' callback' => $callback,3001 'admin-head er-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, 3003 3003 ) ); 3004 3004 } … … 3022 3022 * Add callbacks for background image display. 3023 3023 * 3024 * The parameter $header_callback callback will be required to display the3025 * content for the 'wp_head' action. The parameter $admin_header_callback3026 * callback will be added to Custom_Background class and that will be added3027 * to the 'admin_menu' action.3028 *3029 3024 * @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 */ 3033 function add_custom_background( $wp_head_callback = '', $admin_head_callback = '', $admin_preview_callback = '' ) { 3037 3034 _deprecated_function( __FUNCTION__, '3.4', 'add_theme_support( \'custom-background\', $args )' ); 3038 3035 3039 3036 return add_theme_support( 'custom-background', array( 3040 ' callback' => $callback,3041 'admin-head er-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, 3043 3040 ) ); 3044 3041 } -
trunk/wp-includes/theme.php
r20221 r20231 1297 1297 'header-text' => true, 1298 1298 'uploads' => true, 1299 ' callback' => '',1300 'admin-head er-callback' => '',1301 'admin- image-div-callback' => '',1299 'wp-head-callback' => '', 1300 'admin-head-callback' => '', 1301 'admin-preview-callback' => '', 1302 1302 ); 1303 1303 … … 1367 1367 'default-image' => '', 1368 1368 'default-color' => '', 1369 ' callback' => '',1370 'admin-head er-callback' => '',1371 'admin- image-div-callback' => '',1369 'wp-head-callback' => '_custom_background_cb', 1370 'admin-head-callback' => '', 1371 'admin-preview-callback' => '', 1372 1372 ); 1373 1373 … … 1392 1392 define( 'BACKGROUND_IMAGE', $args[0]['default-image'] ); 1393 1393 1394 if ( empty( $args[0]['callback'] ) )1395 $args[0]['callback'] = '_custom_background_cb';1396 1397 1394 break; 1398 1395 } … … 1415 1412 1416 1413 $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'] ); 1419 1416 1420 1417 if ( is_admin() ) { 1421 1418 require_once( ABSPATH . 'wp-admin/custom-header.php' ); 1422 $custom_image_header = new Custom_Image_Header( $args[0]['admin-head er-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'] ); 1423 1420 } 1424 1421 } … … 1429 1426 1430 1427 $args = get_theme_support( 'custom-background' ); 1431 add_action( 'wp_head', $args[0][' callback'] );1428 add_action( 'wp_head', $args[0]['wp-head-callback'] ); 1432 1429 1433 1430 if ( is_admin() ) { 1434 1431 require_once( ABSPATH . 'wp-admin/custom-background.php' ); 1435 $custom_background = new Custom_Background( $args[0]['admin-head er-callback'], $args[0]['admin-image-div-callback'] );1432 $custom_background = new Custom_Background( $args[0]['admin-head-callback'], $args[0]['admin-preview-callback'] ); 1436 1433 } 1437 1434 } … … 1510 1507 case 'custom-header' : 1511 1508 $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'] ); 1514 1511 remove_action( 'admin_menu', array( $GLOBALS['custom_image_header'], 'init' ) ); 1515 1512 unset( $GLOBALS['custom_image_header'] ); … … 1518 1515 case 'custom-background' : 1519 1516 $support = get_theme_support( 'custom-background' ); 1520 remove_action( 'wp_head', $support[0][' callback'] );1517 remove_action( 'wp_head', $support[0]['wp-head-callback'] ); 1521 1518 remove_action( 'admin_menu', array( $GLOBALS['custom_background'], 'init' ) ); 1522 1519 unset( $GLOBALS['custom_background'] );
Note: See TracChangeset
for help on using the changeset viewer.