WordPress.org

Make WordPress Core

Changeset 21543


Ignore:
Timestamp:
08/17/12 22:18:01 (20 months ago)
Author:
lancewillett
Message:

Twenty Twelve: remove twentytwelve_is_categorized_site() in favor of a theme-agnostic future core fix for this issue, see #21479.

Also simplify the logic for checking tag and categories, props SergeyBiryukov and obenland.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentytwelve/functions.php

    r21542 r21543  
    315315 
    316316    // Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name. 
    317     if ( '' != $tag_list ) { 
     317    if ( $tag_list ) { 
    318318        $utility_text = __( 'This entry was posted in %1$s and tagged %2$s on %3$s by %4$s.', 'twentytwelve' ); 
    319     } elseif ( ! empty( $categories_list ) && twentytwelve_is_categorized_site() ) { 
     319    } elseif ( $categories_list ) { 
    320320        $utility_text = __( 'This entry was posted in %1$s on %3$s by %4$s.', 'twentytwelve' ); 
    321321    } else { 
     
    333333endif; 
    334334 
    335 if ( ! function_exists( 'twentytwelve_is_categorized_site' ) ) : 
    336 /** 
    337  * Returns true if a blog has more than one category. 
    338  * 
    339  * @since Twenty Twelve 1.0 
    340  */ 
    341 function twentytwelve_is_categorized_site() { 
    342     $non_empty_categories = get_categories( array( 
    343         'hide_empty' => 1, 
    344     ) ); 
    345  
    346     if ( is_wp_error( $non_empty_categories ) || empty( $non_empty_categories ) || count( $non_empty_categories ) < 1 ) 
    347         return false; 
    348  
    349     return true; 
    350 } 
    351 endif; 
    352  
    353335/** 
    354336 * Extends the default WordPress body class to denote: 
Note: See TracChangeset for help on using the changeset viewer.