Ticket #26319: 26319.patch
File 26319.patch, 1.4 KB (added by , 11 years ago) |
---|
-
src/wp-content/themes/twentyfourteen/inc/template-tags.php
127 127 * @return boolean true if blog has more than 1 category 128 128 */ 129 129 function twentyfourteen_categorized_blog() { 130 if ( false === ( $all_the_cool_cats = get_transient( ' all_the_cool_cats' ) ) ) {130 if ( false === ( $all_the_cool_cats = get_transient( 'twentyfourteen_number_of_categories' ) ) ) { 131 131 // Create an array of all the categories that are attached to posts 132 132 $all_the_cool_cats = get_categories( array( 133 133 'hide_empty' => 1, … … 136 136 // Count the number of categories that are attached to the posts 137 137 $all_the_cool_cats = count( $all_the_cool_cats ); 138 138 139 set_transient( ' all_the_cool_cats', $all_the_cool_cats );139 set_transient( 'twentyfourteen_number_of_categories', $all_the_cool_cats ); 140 140 } 141 141 142 142 if ( '1' != $all_the_cool_cats ) { … … 157 157 */ 158 158 function twentyfourteen_category_transient_flusher() { 159 159 // Like, beat it. Dig? 160 delete_transient( ' all_the_cool_cats' );160 delete_transient( 'twentyfourteen_number_of_categories' ); 161 161 } 162 162 add_action( 'edit_category', 'twentyfourteen_category_transient_flusher' ); 163 163 add_action( 'save_post', 'twentyfourteen_category_transient_flusher' );