Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/19/2010 08:38:20 PM (15 years ago)
Author:
apeatling
Message:

Better activity delete usability.

File:
1 edited

Legend:

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

    r2369 r2370  
    145145add_action( 'wp_ajax_new_activity_comment', 'bp_dtheme_new_activity_comment' );
    146146
    147 function bp_dtheme_delete_activity_comment() {
     147function bp_dtheme_delete_activity() {
    148148    /* Check the nonce */
    149     check_admin_referer( 'delete_activity_comment' );
     149    check_admin_referer( 'bp_activity_delete_link' );
    150150
    151151    if ( !is_user_logged_in() ) {
     
    154154    }
    155155
    156     if ( empty( $_POST['comment_id'] ) || !is_numeric( $_POST['comment_id'] ) || !bp_activity_delete_by_activity_id( $_POST['comment_id'] ) ) {
    157         echo '-1<div class="error"><p>' . __( 'There was a problem deleting that comment. Please try again.', 'buddypress' ) . '</p></div>';
     156    if ( empty( $_POST['id'] ) || !is_numeric( $_POST['id'] ) || !bp_activity_delete_by_activity_id( $_POST['id'] ) ) {
     157        echo '-1<div class="error"><p>' . __( 'There was a problem when deleting. Please try again.', 'buddypress' ) . '</p></div>';
    158158        return false;
    159159    }
     
    161161    return true;
    162162}
    163 add_action( 'wp_ajax_delete_activity_comment', 'bp_dtheme_delete_activity_comment' );
     163add_action( 'wp_ajax_delete_activity_comment', 'bp_dtheme_delete_activity' );
     164add_action( 'wp_ajax_delete_activity', 'bp_dtheme_delete_activity' );
    164165
    165166function bp_dtheme_activity_loop( $type = 'all', $filter = false, $query_string = false, $per_page = 20, $page = 1 ) {
Note: See TracChangeset for help on using the changeset viewer.