Skip to:
Content

BuddyPress.org

Changeset 14041


Ignore:
Timestamp:
10/08/2024 10:55:02 PM (2 years ago)
Author:
dcavins
Message:

Avoid using notifications class if not available.

Check that notifications are active before attempting to use the notification class.

Fixes #9232.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/bp-members-notifications.php

    r13799 r14041  
    143143 */
    144144function bp_members_invitations_accepted_invitation_notification( $invite, $new_user, $inviter_id ) {
     145        if ( ! bp_is_active( 'notifications' ) ) {
     146                return;
     147        }
    145148
    146149        // Notify all inviters.
     
    183186 */
    184187function bp_members_mark_read_accepted_invitation_notification() {
    185         if ( false === is_singular() || false === is_user_logged_in() || ! bp_is_user() || empty( $_GET['welcome'] ) ) {
     188        if ( false === is_singular() || false === is_user_logged_in() || ! bp_is_user() || empty( $_GET['welcome'] ) || ! bp_is_active( 'notifications' ) ) {
    186189                return;
    187190        }
     
    209212
    210213        $signup_screens = array( 'users_page_bp-signups', 'users_page_bp-signups-network' );
    211         if ( ! wp_doing_ajax() && in_array( get_current_screen()->base, $signup_screens, true ) && ! empty( $_GET['mod_req'] ) && ! empty( $_GET['signup_id'] ) ) {
     214        if ( ! wp_doing_ajax() && in_array( get_current_screen()->base, $signup_screens, true ) && ! empty( $_GET['mod_req'] ) && ! empty( $_GET['signup_id'] ) && bp_is_active( 'notifications' ) ) {
    212215                // Mark all notifications about this request as read.
    213216                BP_Notifications_Notification::update(
Note: See TracChangeset for help on using the changeset viewer.