Make WordPress Core

Ticket #26319: 26319.patch

File 26319.patch, 1.4 KB (added by SergeyBiryukov, 11 years ago)
  • src/wp-content/themes/twentyfourteen/inc/template-tags.php

     
    127127 * @return boolean true if blog has more than 1 category
    128128 */
    129129function 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' ) ) ) {
    131131                // Create an array of all the categories that are attached to posts
    132132                $all_the_cool_cats = get_categories( array(
    133133                        'hide_empty' => 1,
     
    136136                // Count the number of categories that are attached to the posts
    137137                $all_the_cool_cats = count( $all_the_cool_cats );
    138138
    139                 set_transient( 'all_the_cool_cats', $all_the_cool_cats );
     139                set_transient( 'twentyfourteen_number_of_categories', $all_the_cool_cats );
    140140        }
    141141
    142142        if ( '1' != $all_the_cool_cats ) {
     
    157157 */
    158158function twentyfourteen_category_transient_flusher() {
    159159        // Like, beat it. Dig?
    160         delete_transient( 'all_the_cool_cats' );
     160        delete_transient( 'twentyfourteen_number_of_categories' );
    161161}
    162162add_action( 'edit_category', 'twentyfourteen_category_transient_flusher' );
    163163add_action( 'save_post',     'twentyfourteen_category_transient_flusher' );