Changeset 16720
- Timestamp:
- 12/04/2010 09:59:35 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/theme.php
r16711 r16720 1475 1475 1476 1476 $callback = get_theme_support( 'custom-header' ); 1477 remove_action( 'wp_head', $callback[ 'callback'] );1477 remove_action( 'wp_head', $callback[0]['callback'] ); 1478 1478 _remove_theme_support( 'custom-header' ); 1479 1479 remove_theme_support( 'custom-header-uploads' ); … … 1584 1584 * @param callback $admin_image_div_callback Output a custom background image div on the custom background administration screen. Optional. 1585 1585 */ 1586 function add_custom_background( $header_callback = '', $admin_header_callback = '', $admin_image_div_callback = '') {1587 if ( isset( $GLOBALS['custom_background']) )1586 function add_custom_background( $header_callback = '', $admin_header_callback = '', $admin_image_div_callback = '' ) { 1587 if ( isset( $GLOBALS['custom_background'] ) ) 1588 1588 return; 1589 1589 1590 if ( empty( $header_callback) )1590 if ( empty( $header_callback ) ) 1591 1591 $header_callback = '_custom_background_cb'; 1592 1592 1593 add_action( 'wp_head', $header_callback);1594 1595 add_theme_support( 'custom-background' );1593 add_action( 'wp_head', $header_callback ); 1594 1595 add_theme_support( 'custom-background', array( 'callback' => $header_callback ) ); 1596 1596 1597 1597 if ( ! is_admin() ) 1598 1598 return; 1599 require_once(ABSPATH . 'wp-admin/custom-background.php'); 1600 $GLOBALS['custom_background'] =& new Custom_Background($admin_header_callback, $admin_image_div_callback); 1601 add_action('admin_menu', array(&$GLOBALS['custom_background'], 'init')); 1599 require_once( ABSPATH . 'wp-admin/custom-background.php' ); 1600 $GLOBALS['custom_background'] =& new Custom_Background( $admin_header_callback, $admin_image_div_callback ); 1601 add_action( 'admin_menu', array( &$GLOBALS['custom_background'], 'init' ) ); 1602 } 1603 1604 /** 1605 * Remove custom background support. 1606 * 1607 * @since 3.1.0 1608 * @see add_custom_background() 1609 * 1610 * @return bool Whether support was removed. 1611 */ 1612 function remove_custom_background() { 1613 if ( ! current_theme_supports( 'custom-background' ) ) 1614 return false; 1615 1616 $callback = get_theme_support( 'custom-background' ); 1617 remove_action( 'wp_head', $callback[0]['callback'] ); 1618 _remove_theme_support( 'custom-background' ); 1619 1620 if ( is_admin() ) { 1621 remove_action( 'admin_menu', array( &$GLOBALS['custom_background'], 'init' ) ); 1622 unset( $GLOBALS['custom_background'] ); 1623 } 1624 1625 return true; 1602 1626 } 1603 1627 … … 1727 1751 1728 1752 /** 1729 * Removes theme support internally, ignorant of the blacklist.1753 * Do not use. Removes theme support internally, ignorant of the blacklist. 1730 1754 * 1731 1755 * @access private
Note: See TracChangeset
for help on using the changeset viewer.