Skip to:
Content

BuddyPress.org

Changeset 9505


Ignore:
Timestamp:
02/17/2015 11:56:13 PM (10 years ago)
Author:
johnjamesjacoby
Message:

When removing directory pages, bail if request is not made from the root site ID.

This prevents accidental data loss when deleting pages from non-root blogs.

Props r-a-y. See #6226. (2.2 branch, for 2.2.1)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/src/bp-core/bp-core-functions.php

    r9479 r9505  
    626626 * Remove the entry from bp_pages when the corresponding WP page is deleted.
    627627 *
     628 * Bails early on multisite installations when not viewing the root site.
     629 * @link https://buddypress.trac.wordpress.org/ticket/6226
     630 *
    628631 * @since BuddyPress (2.2.0)
    629632 *
     
    631634 */
    632635function bp_core_on_directory_page_delete( $post_id ) {
    633     $page_ids = bp_core_get_directory_page_ids();
     636
     637    // Stop if we are not on the main BP root blog
     638    if ( ! bp_is_root_blog() ) {
     639        return;
     640    }
     641
     642    $page_ids       = bp_core_get_directory_page_ids();
    634643    $component_name = array_search( $post_id, $page_ids );
    635644
Note: See TracChangeset for help on using the changeset viewer.