bp_dtheme_delete_activity()
Deletes an Activity item received via a POST request.
Description Description
Return Return
(mixed) String on error, void on success
Source Source
File: bp-themes/bp-default/_inc/ajax.php
function bp_dtheme_delete_activity() { // Bail if not a POST action if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; // Check the nonce check_admin_referer( 'bp_activity_delete_link' ); if ( ! is_user_logged_in() ) exit( '-1' ); if ( empty( $_POST['id'] ) || ! is_numeric( $_POST['id'] ) ) exit( '-1' ); $activity = new BP_Activity_Activity( (int) $_POST['id'] ); // Check access if ( ! bp_activity_user_can_delete( $activity ) ) exit( '-1' ); // Call the action before the delete so plugins can still fetch information about it do_action( 'bp_activity_before_action_delete_activity', $activity->id, $activity->user_id ); if ( ! bp_activity_delete( array( 'id' => $activity->id, 'user_id' => $activity->user_id ) ) ) exit( '-1<div id="message" class="error"><p>' . __( 'There was a problem when deleting. Please try again.', 'buddypress' ) . '</p></div>' ); do_action( 'bp_activity_action_delete_activity', $activity->id, $activity->user_id ); exit; }
Changelog Changelog
Version | Description |
---|---|
BuddyPress (1.2) | Introduced. |