Changeset 26572
- Timestamp:
- 12/03/2013 06:23:58 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyfourteen/inc/template-tags.php
r26556 r26572 130 130 */ 131 131 function twentyfourteen_categorized_blog() { 132 if ( false === ( $all_the_cool_cats = get_transient( ' all_the_cool_cats' ) ) ) {132 if ( false === ( $all_the_cool_cats = get_transient( 'twentyfourteen_category_count' ) ) ) { 133 133 // Create an array of all the categories that are attached to posts 134 134 $all_the_cool_cats = get_categories( array( … … 139 139 $all_the_cool_cats = count( $all_the_cool_cats ); 140 140 141 set_transient( ' all_the_cool_cats', $all_the_cool_cats );142 } 143 144 if ( '1' !=$all_the_cool_cats ) {141 set_transient( 'twentyfourteen_category_count', $all_the_cool_cats ); 142 } 143 144 if ( 1 !== (int) $all_the_cool_cats ) { 145 145 // This blog has more than 1 category so twentyfourteen_categorized_blog should return true 146 146 return true; … … 160 160 function twentyfourteen_category_transient_flusher() { 161 161 // Like, beat it. Dig? 162 delete_transient( ' all_the_cool_cats' );162 delete_transient( 'twentyfourteen_category_count' ); 163 163 } 164 164 add_action( 'edit_category', 'twentyfourteen_category_transient_flusher' );
Note: See TracChangeset
for help on using the changeset viewer.