Making WordPress.org

Changeset 7723


Ignore:
Timestamp:
10/11/2018 09:56:14 PM (7 years ago)
Author:
coffee2code
Message:

Handbook plugin: Add greater specificity to cache key to prevent cached posts from being used in the wrong context.

Fixes bug where navigation links often didn't appear.

See #3757.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/inc/navigation.php

    r6416 r7723  
    163163        }
    164164
    165         // Cache key format is pages:{post type}:{sort column}(:{excluded})?.
    166         $cache_key = 'pages:' . get_post_type( $post ) . ':' . $sort_column;
     165        // Cache key format is pages:{post ID}:{sort column}:{source_post}(:{excluded})?.
     166        $cache_key = 'pages:' . $post->ID . ':' . $sort_column . ':' . ( $source_post ? '1' : '0' );
    167167        if ( $exclude ) {
    168168            $cache_key .= ':' . str_replace( ' ', '', $exclude );
Note: See TracChangeset for help on using the changeset viewer.