Making WordPress.org

Changeset 10315


Ignore:
Timestamp:
09/29/2020 06:40:45 AM (5 years ago)
Author:
dd32
Message:

BuddyPress: Check that groups are enabled before checking if we need to redirect to them, Don't insert mentions on non-profiles.

Fixes a few PHP Notices.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/buddypress.org/public_html/wp-content/plugins/buddypress-org/extensions.php

    r9174 r10315  
    162162    global $bp;
    163163
    164     if ( bp_is_my_profile() || !$bp->displayed_user->id )
     164    if ( bp_is_my_profile() || empty( $bp->displayed_user->id ) )
    165165        return $content;
    166166
     
    194194    $redirect = false;
    195195    /* Redirect based on the type of activity */
    196     if ( $activity->component == $bp->groups->id ) {
     196    if ( bp_is_active( 'groups' ) && $activity->component == $bp->groups->id ) {
    197197        if ( $activity->user_id ) {
    198198            $redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . $bp->activity->name . '/' . $activity->id . '/';
Note: See TracChangeset for help on using the changeset viewer.