WordPress.org

Make WordPress Core

Changeset 20025


Ignore:
Timestamp:
02/28/2012 08:38:09 PM (6 years ago)
Author:
nacin
Message:

Add argument to get_theme_feature_list() to allow the tags to be returned without hitting the WP.org API. We'll be using this to translate tags. Remove trailing space in the 'Light' string. see #20103.

File:
1 edited

Legend:

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

    r19712 r20025  
    271271 * @since 3.1.0
    272272 *
     273 * @param bool $api Optional. Whether try to fetch tags from the WP.org API. Defaults to true.
    273274 * @return array Array of features keyed by category with translations keyed by slug.
    274275 */
    275 function get_theme_feature_list() {
     276function get_theme_feature_list( $api = true ) {
    276277    // Hard-coded list is used if api not accessible.
    277278    $features = array(
     
    291292                'yellow'  => __( 'Yellow' ),
    292293                'dark'    => __( 'Dark' ),
    293                 'light'   => __( 'Light ')
     294                'light'   => __( 'Light' ),
    294295            ),
    295296
     
    300301            'four-columns'  => __( 'Four Columns' ),
    301302            'left-sidebar'  => __( 'Left Sidebar' ),
    302             'right-sidebar' => __( 'Right Sidebar' )
     303            'right-sidebar' => __( 'Right Sidebar' ),
    303304        ),
    304305
    305306        __('Width') => array(
    306307            'fixed-width'    => __( 'Fixed Width' ),
    307             'flexible-width' => __( 'Flexible Width' )
     308            'flexible-width' => __( 'Flexible Width' ),
    308309        ),
    309310
     
    326327            'theme-options'         => __( 'Theme Options' ),
    327328            'threaded-comments'     => __( 'Threaded Comments' ),
    328             'translation-ready'     => __( 'Translation Ready' )
     329            'translation-ready'     => __( 'Translation Ready' ),
    329330        ),
    330331
     
    332333            'holiday'       => __( 'Holiday' ),
    333334            'photoblogging' => __( 'Photoblogging' ),
    334             'seasonal'      => __( 'Seasonal' )
     335            'seasonal'      => __( 'Seasonal' ),
    335336        )
    336337    );
    337338
    338     if ( !current_user_can('install_themes') )
     339    if ( ! $api || ! current_user_can( 'install_themes' ) )
    339340        return $features;
    340341
Note: See TracChangeset for help on using the changeset viewer.