Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/21/2010 03:47:02 PM (15 years ago)
Author:
apeatling
Message:

Fixes #1598 - broken sitewide notices

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-themes/bp-default/_inc/ajax.php

    r2372 r2397  
    425425add_action( 'wp_ajax_joinleave_group', 'bp_dtheme_ajax_joinleave_group' );
    426426
     427function bp_dtheme_ajax_close_notice() {
     428    global $userdata;
     429
     430    if ( !isset( $_POST['notice_id'] ) ) {
     431        echo "-1<div id='message' class='error'><p>" . __('There was a problem closing the notice.', 'buddypress') . '</p></div>';
     432    } else {
     433        $notice_ids = get_usermeta( $userdata->ID, 'closed_notices' );
     434
     435        $notice_ids[] = (int) $_POST['notice_id'];
     436
     437        update_usermeta( $userdata->ID, 'closed_notices', $notice_ids );
     438    }
     439}
     440add_action( 'wp_ajax_messages_close_notice', 'bp_dtheme_ajax_close_notice' );
     441
    427442function bp_dtheme_ajax_messages_send_reply() {
    428443    global $bp;
     
    460475add_action( 'wp_ajax_messages_send_reply', 'bp_dtheme_ajax_messages_send_reply' );
    461476
    462 function bp_dtheme_ajax_markunread() {
     477function bp_dtheme_ajax_message_markunread() {
    463478    global $bp;
    464479
     
    473488    }
    474489}
    475 add_action( 'wp_ajax_messages_markunread', 'bp_dtheme_ajax_markunread' );
     490add_action( 'wp_ajax_messages_markunread', 'bp_dtheme_ajax_message_markunread' );
    476491
    477492function bp_dtheme_ajax_message_markread() {
     
    488503    }
    489504}
    490 add_action( 'wp_ajax_messages_markread', 'bp_dtheme_ajax_messages_markread' );
     505add_action( 'wp_ajax_messages_markread', 'bp_dtheme_ajax_message_markread' );
    491506
    492507function bp_dtheme_ajax_messages_delete() {
Note: See TracChangeset for help on using the changeset viewer.