WordPress.org

Make WordPress Core

Changeset 13902


Ignore:
Timestamp:
03/31/10 09:06:11 (4 years ago)
Author:
nacin
Message:

Add blacklist to remove_theme_support(). fixes #12739.

File:
1 edited

Legend:

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

    r13877 r13902  
    15321532 * Allows a theme to register its support of a certain feature 
    15331533 * 
    1534  * Must be called in the themes functions.php file to work. 
     1534 * Must be called in the theme's functions.php file to work. 
     1535 * If attached to a hook, it must be after_setup_theme. 
     1536 * The init hook may be too late for some features. 
    15351537 * 
    15361538 * @since 2.9.0 
     
    15491551 * Allows a theme to de-register its support of a certain feature 
    15501552 * 
    1551  * Must be called in the themes functions.php file to work. 
     1553 * Should be called in the theme's functions.php file. Generally would 
     1554 * be used for child themes to override support from the parent theme. 
    15521555 * 
    15531556 * @since 3.0.0 
     1557 * @see add_theme_support() 
    15541558 * @param string $feature the feature being added 
     1559 * @return bool Whether feature was removed. 
    15551560 */ 
    15561561function remove_theme_support( $feature ) { 
     1562    // Blacklist: for internal registrations not used directly by themes. 
     1563    if ( in_array( $feature, array( 'custom-background', 'custom-header', 'editor-style', 'widgets' ) ) ) 
     1564        return false; 
     1565 
    15571566    global $_wp_theme_features; 
    15581567 
    1559     unset($_wp_theme_features[$feature]); 
     1568    if ( ! isset( $_wp_theme_features[$feature] ) ) 
     1569        return false; 
     1570    unset( $_wp_theme_features[$feature] ); 
     1571    return true; 
    15601572} 
    15611573 
Note: See TracChangeset for help on using the changeset viewer.