Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/26/2014 05:13:30 PM (12 years ago)
Author:
boonebgorges
Message:

Don't attempt to overload add_root property in bp_core_add_root_component()

The add_root array is defined only for backward compatibility purposes in the
BuddyPress global object, and thus is overloaded rather than defined in the
constructor. This means that adding items directly to the array is forbidden
on recent versions of PHP. As a workaround, we add the item as a separate array
and then swap the array, which is allowed and will not result in notices.

Fixes #5588

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-functions.php

    r8185 r8323  
    562562        // If there was no match, add a page for this root component
    563563        if ( empty( $match ) ) {
    564                 $bp->add_root[] = $slug;
     564                $add_root_items   = $bp->add_root();
     565                $add_root_items[] = $slug;
     566                $bp->add_root     = $add_root_items;
    565567        }
    566568
Note: See TracChangeset for help on using the changeset viewer.