Skip to:
Content

bbPress.org


Ignore:
Timestamp:
06/19/2017 04:29:43 AM (9 years ago)
Author:
johnjamesjacoby
Message:

Better 404 handling:

  • Introduce bbp_is_404 query var, and set this in places where the default 404 condition needs to be overridden
  • Introduce bbp_set_200() for cases where a default of 404 needs to be set to a 200
  • Introduce bbp_get_wp_query() helper for getting the $wp_query global
  • Update bbp_set_404() to accept a $query parameter to make passing the query around easier
  • Update child-ids queries to use the last_changed cache to reduce the amount of cache churn when cleaning

Fixes #3047. See #1973.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/extend/buddypress/groups.php

    r6573 r6583  
    816816     */
    817817    public function display_forums( $offset = 0 ) {
    818         global $wp_query;
    819818
    820819        // Allow actions immediately before group forum output
     
    928927                        add_filter( 'bbp_get_topic_types', array( $this, 'unset_super_sticky' ), 10, 1 );
    929928
     929                        // Get the main query object
     930                        $wp_query = bbp_get_wp_query();
     931
    930932                        // Set the edit switches
    931933                        $wp_query->bbp_is_edit       = true;
     
    994996
    995997                    if ( bp_action_variable( $offset + 2 ) === bbp_get_edit_rewrite_id() ) :
     998
     999                        // Get the main query object
     1000                        $wp_query = bbp_get_wp_query();
    9961001
    9971002                        // Set the edit switches
Note: See TracChangeset for help on using the changeset viewer.