From 26ebec2fc80ab24d4e405bd5c127a51d55f8cc8e Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Fri, 17 Aug 2012 22:18:01 +0000 Subject: [PATCH] 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. git-svn-id: http://core.svn.wordpress.org/trunk@21543 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/twentytwelve/functions.php | 22 ++------------------ 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/wp-content/themes/twentytwelve/functions.php b/wp-content/themes/twentytwelve/functions.php index 0567ddc317..0058f4b550 100644 --- a/wp-content/themes/twentytwelve/functions.php +++ b/wp-content/themes/twentytwelve/functions.php @@ -314,9 +314,9 @@ function twentytwelve_entry_meta() { ); // Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name. - if ( '' != $tag_list ) { + if ( $tag_list ) { $utility_text = __( 'This entry was posted in %1$s and tagged %2$s on %3$s by %4$s.', 'twentytwelve' ); - } elseif ( ! empty( $categories_list ) && twentytwelve_is_categorized_site() ) { + } elseif ( $categories_list ) { $utility_text = __( 'This entry was posted in %1$s on %3$s by %4$s.', 'twentytwelve' ); } else { $utility_text = __( 'This entry was posted on %3$s by %4$s.', 'twentytwelve' ); @@ -332,24 +332,6 @@ function twentytwelve_entry_meta() { } endif; -if ( ! function_exists( 'twentytwelve_is_categorized_site' ) ) : -/** - * Returns true if a blog has more than one category. - * - * @since Twenty Twelve 1.0 - */ -function twentytwelve_is_categorized_site() { - $non_empty_categories = get_categories( array( - 'hide_empty' => 1, - ) ); - - if ( is_wp_error( $non_empty_categories ) || empty( $non_empty_categories ) || count( $non_empty_categories ) < 1 ) - return false; - - return true; -} -endif; - /** * Extends the default WordPress body class to denote: * 1. Using a full-width layout, when no active widgets in the sidebar