bp_dtheme_unmark_activity_favorite()
Un-favourite an activity via a POST request.
Description Description
Return Return
(string) HTML
Source Source
File: bp-themes/bp-default/_inc/ajax.php
function bp_dtheme_unmark_activity_favorite() { // Bail if not a POST action if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; if ( ! isset( $_POST['nonce'] ) ) { return; } // Either the 'mark' or 'unmark' nonce is accepted, for backward compatibility. $nonce = wp_unslash( $_POST['nonce'] ); if ( ! wp_verify_nonce( $nonce, 'mark_favorite' ) && ! wp_verify_nonce( $nonce, 'unmark_favorite' ) ) { return; } if ( bp_activity_remove_user_favorite( $_POST['id'] ) ) _e( 'Favorite', 'buddypress' ); else _e( 'Remove Favorite', 'buddypress' ); exit; }
Changelog Changelog
Version | Description |
---|---|
BuddyPress (1.2) | Introduced. |