diff --git a/src/wp-content/themes/twentyfourteen/inc/template-tags.php b/src/wp-content/themes/twentyfourteen/inc/template-tags.php index 39232a8974..9c3a6aba6e 100644 --- a/src/wp-content/themes/twentyfourteen/inc/template-tags.php +++ b/src/wp-content/themes/twentyfourteen/inc/template-tags.php @@ -129,7 +129,7 @@ endif; * @return boolean true if blog has more than 1 category */ function twentyfourteen_categorized_blog() { - if ( false === ( $all_the_cool_cats = get_transient( 'all_the_cool_cats' ) ) ) { + if ( false === ( $all_the_cool_cats = get_transient( 'twentyfourteen_category_count' ) ) ) { // Create an array of all the categories that are attached to posts $all_the_cool_cats = get_categories( array( 'hide_empty' => 1, @@ -138,10 +138,10 @@ function twentyfourteen_categorized_blog() { // Count the number of categories that are attached to the posts $all_the_cool_cats = count( $all_the_cool_cats ); - set_transient( 'all_the_cool_cats', $all_the_cool_cats ); + set_transient( 'twentyfourteen_category_count', $all_the_cool_cats ); } - if ( '1' != $all_the_cool_cats ) { + if ( 1 !== (int) $all_the_cool_cats ) { // This blog has more than 1 category so twentyfourteen_categorized_blog should return true return true; } else { @@ -159,7 +159,7 @@ function twentyfourteen_categorized_blog() { */ function twentyfourteen_category_transient_flusher() { // Like, beat it. Dig? - delete_transient( 'all_the_cool_cats' ); + delete_transient( 'twentyfourteen_category_count' ); } add_action( 'edit_category', 'twentyfourteen_category_transient_flusher' ); add_action( 'save_post', 'twentyfourteen_category_transient_flusher' );