Skip to:
Content

bbPress.org


Ignore:
Timestamp:
06/28/2024 10:02:43 PM (22 months ago)
Author:
johnjamesjacoby
Message:

Merge r7250 through r7267 from branches/2.6.

In trunk, for 2.7.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/includes/search/template.php

    r7175 r7268  
    4747    }
    4848
    49     // What are the default allowed statuses (based on user caps)
    50     if ( bbp_get_view_all() ) {
    51 
    52         // Default view=all statuses
    53         $post_statuses = array_keys( bbp_get_topic_statuses() );
    54 
    55         // Add support for private status
    56         if ( current_user_can( 'read_private_topics' ) ) {
    57             $post_statuses[] = bbp_get_private_status_id();
    58         }
    59 
    60         // Join post statuses together
    61         $default['post_status'] = $post_statuses;
    62 
    63     // Lean on the 'perm' query var value of 'readable' to provide statuses
    64     } else {
    65         $default['perm'] = 'readable';
    66     }
     49    // Default public statuses (topics coincidentally cover all post types)
     50    $post_statuses = array_keys( bbp_get_public_topic_statuses() );
     51
     52    // Add support for private status
     53    if ( current_user_can( 'read_private_topics' ) ) {
     54        $post_statuses[] = bbp_get_private_status_id();
     55    }
     56
     57    // Add support for hidden status
     58    if ( current_user_can( 'read_hidden_topics' ) ) {
     59        $post_statuses[] = bbp_get_hidden_status_id();
     60    }
     61
     62    // Join post statuses together
     63    $default['post_status'] = $post_statuses;
    6764
    6865    /** Setup *****************************************************************/
Note: See TracChangeset for help on using the changeset viewer.