WordPress.org

Making WordPress.org


Ignore:
Timestamp:
07/04/2016 09:28:48 AM (4 years ago)
Author:
ocean90
Message:

Theme Directory: Update list of WordPress theme features.

Props grapplerulrich, rabmalin.
See [core37287].
Fixes #1187.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php

    r3149 r3622  
    166166/**
    167167 * This is a copy of get_theme_feature_list(), but with the wporg-themes text domain
    168  */
    169 function wporg_themes_get_feature_list() {
    170     return array(
    171         __( 'Colors', 'wporg-themes' )   => array(
    172             'black'  => __( 'Black',  'wporg-themes' ),
    173             'blue'   => __( 'Blue',   'wporg-themes' ),
    174             'brown'  => __( 'Brown',  'wporg-themes' ),
    175             'gray'   => __( 'Gray',   'wporg-themes' ),
    176             'green'  => __( 'Green',  'wporg-themes' ),
     168 *
     169 * @param string $include Optional. Type of list: 'active', 'deprecated' or 'all'. Default 'active'.
     170 * @return array List of features.
     171 */
     172function wporg_themes_get_feature_list( $include = 'active' ) {
     173    $features = array();
     174
     175    if ( 'active' === $include || 'all' === $include ) {
     176        $features = array(
     177            __( 'Layout', 'wporg-themes' )   => array(
     178                'grid-layout'   => __( 'Grid Layout', 'wporg-themes' ),
     179                'one-column'    => __( 'One Column', 'wporg-themes' ),
     180                'two-columns'   => __( 'Two Columns', 'wporg-themes' ),
     181                'three-columns' => __( 'Three Columns', 'wporg-themes' ),
     182                'four-columns'  => __( 'Four Columns', 'wporg-themes' ),
     183                'left-sidebar'  => __( 'Left Sidebar', 'wporg-themes' ),
     184                'right-sidebar' => __( 'Right Sidebar', 'wporg-themes' ),
     185            ),
     186            __( 'Features', 'wporg-themes' ) => array(
     187                'accessibility-ready'   => __( 'Accessibility Ready', 'wporg-themes' ),
     188                'buddypress'            => __( 'BuddyPress', 'wporg-themes' ),
     189                'custom-background'     => __( 'Custom Background', 'wporg-themes' ),
     190                'custom-colors'         => __( 'Custom Colors', 'wporg-themes' ),
     191                'custom-header'         => __( 'Custom Header', 'wporg-themes' ),
     192                'custom-logo'           => __( 'Custom Logo', 'wporg-themes' ),
     193                'custom-menu'           => __( 'Custom Menu', 'wporg-themes' ),
     194                'editor-style'          => __( 'Editor Style', 'wporg-themes' ),
     195                'featured-image-header' => __( 'Featured Image Header', 'wporg-themes' ),
     196                'featured-images'       => __( 'Featured Images', 'wporg-themes' ),
     197                'flexible-header'       => __( 'Flexible Header', 'wporg-themes' ),
     198                'footer-widgets'        => __( 'Footer Widgets', 'wporg-themes' ),
     199                'front-page-post-form'  => __( 'Front Page Posting', 'wporg-themes' ),
     200                'full-width-template'   => __( 'Full Width Template', 'wporg-themes' ),
     201                'microformats'          => __( 'Microformats', 'wporg-themes' ),
     202                'post-formats'          => __( 'Post Formats', 'wporg-themes' ),
     203                'rtl-language-support'  => __( 'RTL Language Support', 'wporg-themes' ),
     204                'sticky-post'           => __( 'Sticky Post', 'wporg-themes' ),
     205                'theme-options'         => __( 'Theme Options', 'wporg-themes' ),
     206                'threaded-comments'     => __( 'Threaded Comments', 'wporg-themes' ),
     207                'translation-ready'     => __( 'Translation Ready', 'wporg-themes' ),
     208            ),
     209            __( 'Subject', 'wporg-themes' )  => array(
     210                'blog'           => __( 'Blog', 'wporg-themes' ),
     211                'e-commerce'     => __( 'E-Commerce', 'wporg-themes' ),
     212                'education'      => __( 'Education', 'wporg-themes' ),
     213                'entertainment'  => __( 'Entertainment', 'wporg-themes' ),
     214                'food-and-drink' => __( 'Food & Drink', 'wporg-themes' ),
     215                'holiday'        => __( 'Holiday', 'wporg-themes' ),
     216                'news'           => __( 'News', 'wporg-themes' ),
     217                'photography'    => __( 'Photography', 'wporg-themes' ),
     218                'portfolio'      => __( 'Portfolio', 'wporg-themes' ),
     219            ),
     220        );
     221    }
     222
     223    if ( 'deprecated' === $include || 'all' === $include ) {
     224        $features[ __( 'Colors', 'wporg-themes' ) ] = array(
     225            'black'  => __( 'Black', 'wporg-themes' ),
     226            'blue'   => __( 'Blue', 'wporg-themes' ),
     227            'brown'  => __( 'Brown', 'wporg-themes' ),
     228            'gray'   => __( 'Gray', 'wporg-themes' ),
     229            'green'  => __( 'Green', 'wporg-themes' ),
    177230            'orange' => __( 'Orange', 'wporg-themes' ),
    178             'pink'   => __( 'Pink',   'wporg-themes' ),
     231            'pink'   => __( 'Pink', 'wporg-themes' ),
    179232            'purple' => __( 'Purple', 'wporg-themes' ),
    180             'red'    => __( 'Red',    'wporg-themes' ),
     233            'red'    => __( 'Red', 'wporg-themes' ),
    181234            'silver' => __( 'Silver', 'wporg-themes' ),
    182             'tan'    => __( 'Tan',    'wporg-themes' ),
    183             'white'  => __( 'White',  'wporg-themes' ),
     235            'tan'    => __( 'Tan', 'wporg-themes' ),
     236            'white'  => __( 'White', 'wporg-themes' ),
    184237            'yellow' => __( 'Yellow', 'wporg-themes' ),
    185             'dark'   => __( 'Dark',   'wporg-themes' ),
    186             'light'  => __( 'Light',  'wporg-themes' ),
    187         ),
    188         __( 'Layout', 'wporg-themes' ) => array(
    189             'fixed-layout'      => __( 'Fixed Layout',      'wporg-themes' ),
    190             'fluid-layout'      => __( 'Fluid Layout',      'wporg-themes' ),
     238            'dark'   => __( 'Dark', 'wporg-themes' ),
     239            'light'  => __( 'Light', 'wporg-themes' ),
     240        );
     241
     242        if ( 'deprecated' === $include ) {
     243            // Initialize arrays.
     244            $features[ __( 'Layout', 'wporg-themes' ) ]   = array();
     245            $features[ __( 'Features', 'wporg-themes' ) ] = array();
     246            $features[ __( 'Subject', 'wporg-themes' ) ]  = array();
     247        }
     248
     249        $features[ __( 'Layout', 'wporg-themes' ) ] = array_merge( $features[ __( 'Layout', 'wporg-themes' ) ], array(
     250            'fixed-layout'      => __( 'Fixed Layout', 'wporg-themes' ),
     251            'fluid-layout'      => __( 'Fluid Layout', 'wporg-themes' ),
    191252            'responsive-layout' => __( 'Responsive Layout', 'wporg-themes' ),
    192             'one-column'        => __( 'One Column',        'wporg-themes' ),
    193             'two-columns'       => __( 'Two Columns',       'wporg-themes' ),
    194             'three-columns'     => __( 'Three Columns',     'wporg-themes' ),
    195             'four-columns'      => __( 'Four Columns',      'wporg-themes' ),
    196             'left-sidebar'      => __( 'Left Sidebar',      'wporg-themes' ),
    197             'right-sidebar'     => __( 'Right Sidebar',     'wporg-themes' ),
    198         ),
    199         __( 'Features', 'wporg-themes' ) => array(
    200             'accessibility-ready'   => __( 'Accessibility Ready',   'wporg-themes' ),
    201             'blavatar'              => __( 'Blavatar',              'wporg-themes' ),
    202             'buddypress'            => __( 'BuddyPress',            'wporg-themes' ),
    203             'custom-background'     => __( 'Custom Background',     'wporg-themes' ),
    204             'custom-colors'         => __( 'Custom Colors',         'wporg-themes' ),
    205             'custom-header'         => __( 'Custom Header',         'wporg-themes' ),
    206             'custom-menu'           => __( 'Custom Menu',           'wporg-themes' ),
    207             'editor-style'          => __( 'Editor Style',          'wporg-themes' ),
    208             'featured-image-header' => __( 'Featured Image Header', 'wporg-themes' ),
    209             'featured-images'       => __( 'Featured Images',       'wporg-themes' ),
    210             'flexible-header'       => __( 'Flexible Header',       'wporg-themes' ),
    211             'front-page-post-form'  => __( 'Front Page Posting',    'wporg-themes' ),
    212             'full-width-template'   => __( 'Full Width Template',   'wporg-themes' ),
    213             'microformats'          => __( 'Microformats',          'wporg-themes' ),
    214             'post-formats'          => __( 'Post Formats',          'wporg-themes' ),
    215             'rtl-language-support'  => __( 'RTL Language Support',  'wporg-themes' ),
    216             'sticky-post'           => __( 'Sticky Post',           'wporg-themes' ),
    217             'theme-options'         => __( 'Theme Options',         'wporg-themes' ),
    218             'threaded-comments'     => __( 'Threaded Comments',     'wporg-themes' ),
    219             'translation-ready'     => __( 'Translation Ready',     'wporg-themes' ),
    220         ),
    221         __( 'Subject', 'wporg-themes' ) => array(
    222             'holiday'       => __( 'Holiday',       'wporg-themes' ),
     253        ) );
     254
     255        $features[ __( 'Features', 'wporg-themes' ) ] = array_merge( $features[ __( 'Features', 'wporg-themes' ) ], array(
     256            'blavatar' => __( 'Blavatar', 'wporg-themes' ),
     257        ) );
     258
     259        $features[ __( 'Subject', 'wporg-themes' ) ] = array_merge( $features[ __( 'Subject', 'wporg-themes' ) ], array(
    223260            'photoblogging' => __( 'Photoblogging', 'wporg-themes' ),
    224             'seasonal'      => __( 'Seasonal',      'wporg-themes' ),
    225         )
    226     );
     261            'seasonal'      => __( 'Seasonal', 'wporg-themes' ),
     262        ) );
     263    }
     264
     265    return $features;
    227266}
    228267
    229268/**
    230269 * Returns an array of [ tag_slug => translated_tag_name] tags for translation within JS
     270 *
     271 * @return array List of features.
    231272 */
    232273function wporg_themes_get_tag_translations() {
    233274    $translations = array();
    234     foreach ( wporg_themes_get_feature_list() as $group => $tags ) {
     275    foreach ( wporg_themes_get_feature_list( 'all' ) as $group => $tags ) {
    235276        $translations = array_merge( $translations, $tags );
    236277    }
Note: See TracChangeset for help on using the changeset viewer.