bp_activity_action_remove_favorite()

Remove activity from likes.

Description

Return

(bool) False on failure.

Source

File: bp-activity/actions/unfavorite.php

function bp_activity_action_remove_favorite() {
	if ( ! is_user_logged_in() || ! bp_is_activity_component() || ! bp_is_current_action( 'unfavorite' ) )
		return false;

	// Check the nonce.
	check_admin_referer( 'unmark_favorite' );

	if ( bp_activity_remove_user_favorite( bp_action_variable( 0 ) ) )
		bp_core_add_message( __( 'Post unsaved.', 'buddyboss' ) );
	else
		bp_core_add_message( __( 'There was an error unsaving that post. Please try again.', 'buddyboss' ), 'error' );

	bp_core_redirect( wp_get_referer() . '#activity-' . bp_action_variable( 0 ) );
}

Changelog

Changelog
Version Description
BuddyPress 1.2.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.