Changeset 2644 for trunk/bp-themes/bp-default/_inc/ajax.php
- Timestamp:
- 02/10/2010 03:15:48 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-themes/bp-default/_inc/ajax.php
r2606 r2644 226 226 return true; 227 227 } 228 add_action( 'wp_ajax_delete_activity_comment', 'bp_dtheme_delete_activity' );229 228 add_action( 'wp_ajax_delete_activity', 'bp_dtheme_delete_activity' ); 229 230 function bp_dtheme_delete_activity_comment() { 231 global $bp; 232 233 /* Check the nonce */ 234 check_admin_referer( 'bp_activity_delete_link' ); 235 236 if ( !is_user_logged_in() ) { 237 echo '-1'; 238 return false; 239 } 240 241 $comment = new BP_Activity_Activity( $_POST['id'] ); 242 243 /* Check access */ 244 if ( !is_site_admin() && $comment->user_id != $bp->loggedin_user->id ) 245 return false; 246 247 if ( empty( $_POST['id'] ) || !is_numeric( $_POST['id'] ) || !bp_activity_delete_comment( $comment->item_id, $comment->id ) ) { 248 echo '-1<div id="message" class="error"><p>' . __( 'There was a problem when deleting. Please try again.', 'buddypress' ) . '</p></div>'; 249 return false; 250 } 251 252 return true; 253 } 254 add_action( 'wp_ajax_delete_activity_comment', 'bp_dtheme_delete_activity_comment' ); 230 255 231 256 function bp_dtheme_mark_activity_favorite() {
Note: See TracChangeset
for help on using the changeset viewer.