Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/16/2017 03:49:08 PM (9 years ago)
Author:
johnjamesjacoby
Message:

Core: Make sure trashed activate and register pages are unset in bp_core_get_directory_page_ids().

This flips the order of 2 conditions, which incorrectly included trashed pages for the activate & register components.

In addition, normalize the return value & type-casting of bp_core_get_directory_page_ids() to ensure it is always an array, even if an empty one.

Fixes #7469.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-cache.php

    r11447 r11513  
    7474 * @param int $post_id ID of the page that was saved.
    7575 */
    76 function bp_core_clear_directory_pages_cache_page_edit( $post_id ) {
    77     if ( ! bp_is_root_blog() ) {
    78         return;
    79     }
     76function bp_core_clear_directory_pages_cache_page_edit( $post_id = 0 ) {
    8077
    8178    // Bail if BP is not defined here.
     
    8481    }
    8582
     83    // Bail if not on the root blog
     84    if ( ! bp_is_root_blog() ) {
     85        return;
     86    }
     87
    8688    $page_ids = bp_core_get_directory_page_ids( 'all' );
    8789
    88     if ( ! in_array( $post_id, (array) $page_ids ) ) {
     90    // Bail if post ID is not a directory page
     91    if ( ! in_array( $post_id, $page_ids ) ) {
    8992        return;
    9093    }
Note: See TracChangeset for help on using the changeset viewer.