Make WordPress Core


Ignore:
Timestamp:
11/01/2009 05:27:39 AM (17 years ago)
Author:
markjaquith
Message:

Introducing add_theme_support(feature) and current_theme_supports(feature) for announcing and checking theme support for various features. Implement it for post/page thumbanils, hiding UI if not supported.

File:
1 edited

Legend:

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

    r12129 r12132  
    13041304}
    13051305
     1306/**
     1307 * Allows a theme to register its support of a certain feature
     1308 *
     1309 * @author Mark Jaquith
     1310 * @since 2.9
     1311 * @param string $feature the feature being added
     1312 */
     1313function add_theme_support( $feature ) {
     1314    global $_wp_theme_features;
     1315    $_wp_theme_features[$feature] = true;
     1316}
     1317
     1318/**
     1319 * Checks a theme's support for a given feature
     1320 *
     1321 * @author Mark Jaquith
     1322 * @since 2.9
     1323 * @param string $feature the feature being checked
     1324 * @return boolean
     1325 */
     1326
     1327function current_theme_supports( $feature ) {
     1328    global $_wp_theme_features;
     1329    return ( isset( $_wp_theme_features[$feature] ) && $_wp_theme_features[$feature] );
     1330}
     1331
    13061332?>
Note: See TracChangeset for help on using the changeset viewer.