WordPress.org

Make WordPress Core

Ticket #14903: 14093-remove-custom-background.patch

File 14093-remove-custom-background.patch, 1.0 KB (added by Utkarsh, 5 years ago)

remove_custom_background

  • theme.php

     
    15911591} 
    15921592 
    15931593/** 
     1594 * Removes callbacks for background image display. 
     1595 * 
     1596 * The parameter $header_callback callback needs to be exactly the same as 
     1597 * the one used to add the custom background 
     1598 * 
     1599 * @since 3.1.0 
     1600 * 
     1601 * @param callback $header_callback Call on 'wp_head' action. 
     1602 */ 
     1603function remove_custom_background($header_callback = '') { 
     1604        if ( empty($header_callback) ) 
     1605                $header_callback = '_custom_background_cb'; 
     1606 
     1607        remove_action( 'wp_head', $header_callback ); 
     1608        remove_theme_support( 'custom-background' ); 
     1609 
     1610        if ( ! is_admin() || ! isset( $GLOBALS['custom_background'] ) ) 
     1611                return; 
     1612 
     1613        remove_action( 'admin_menu', array( &$GLOBALS['custom_background'], 'init') ); 
     1614        unset( $GLOBALS['custom_background'] ); 
     1615} 
     1616 
     1617/** 
    15941618 * Default custom background callback. 
    15951619 * 
    15961620 * @since 3.0.0 
     
    17781802} 
    17791803 
    17801804add_action( 'delete_attachment', '_delete_attachment_theme_mod' ); 
    1781  
    1782 ?>