Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/17/2017 06:57:26 PM (8 years ago)
Author:
dcavins
Message:

Update group update notifications to include slug updates.

Add cases for the group slug being updated in the code that creates the
various notifications and activity items alerting group admins that
some group information has been updated.

See #6014.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/bp-groups-activity.php

    r11447 r11557  
    190190    } elseif ( ! empty( $changed['description']['old'] ) && ! empty( $changed['description']['new'] ) ) {
    191191        $action = sprintf( __( '%1$s changed the description of the group %2$s from "%3$s" to "%4$s"', 'buddypress' ), $user_link, $group_link, esc_html( $changed['description']['old'] ), esc_html( $changed['description']['new'] ) );
     192
     193    } elseif ( ! empty( $changed['slug']['old'] ) && ! empty( $changed['slug']['new'] ) ) {
     194        $action = sprintf( __( '%1$s changed the permalink of the group %2$s.', 'buddypress' ), $user_link, $group_link );
    192195
    193196    }
     
    462465    }
    463466
    464     if ( ! isset( $old_group->name ) || ! isset( $old_group->description ) ) {
     467    if ( ! isset( $old_group->name ) || ! isset( $old_group->slug ) || ! isset( $old_group->description ) ) {
    465468        return false;
    466469    }
     
    487490            'old' => $old_group->name,
    488491            'new' => $group->name,
     492        );
     493    }
     494
     495    if ( $group->slug !== $old_group->slug ) {
     496        $changed['slug'] = array(
     497            'old' => $old_group->slug,
     498            'new' => $group->slug,
    489499        );
    490500    }
Note: See TracChangeset for help on using the changeset viewer.