Skip to:
Content

BuddyPress.org

Ticket #7392: 7392.diff

File 7392.diff, 885 bytes (added by boonebgorges, 8 years ago)
  • src/bp-templates/bp-legacy/buddypress-functions.php

    diff --git src/bp-templates/bp-legacy/buddypress-functions.php src/bp-templates/bp-legacy/buddypress-functions.php
    index 70af04dab..dee9767e4 100644
    function bp_legacy_theme_ajax_close_notice() { 
    15271527                echo "-1<div id='message' class='error'><p>" . __( 'There was a problem closing the notice.', 'buddypress' ) . '</p></div>';
    15281528
    15291529        } else {
    1530                 $user_id      = get_current_user_id();
    1531                 $notice_ids   = bp_get_user_meta( $user_id, 'closed_notices', true );
     1530                $user_id    = get_current_user_id();
     1531                $notice_ids = bp_get_user_meta( $user_id, 'closed_notices', true );
     1532                if ( ! is_array( $notice_ids ) ) {
     1533                        $notice_ids = array();
     1534                }
     1535
    15321536                $notice_ids[] = (int) $_POST['notice_id'];
    15331537
    15341538                bp_update_user_meta( $user_id, 'closed_notices', $notice_ids );