Skip to:
Content

bbPress.org

Ticket #2878: theme-compat.php.patch

File theme-compat.php.patch, 615 bytes (added by GDragoN, 11 years ago)
  • includes/core/theme-compat.php

     
    383383        // Set the $post global
    384384        $post = new WP_Post( (object) $dummy );
    385385
     386        // Add $post to cache to fix the bug if page template loads
     387        // comments and triggers the error with missing post
     388        wp_cache_add($post->ID, $post, 'posts');
     389
    386390        // Copy the new post global into the main $wp_query
    387391        $wp_query->post       = $post;
    388392        $wp_query->posts      = array( $post );