Friends::remove( $args )
Remove a friendship.
Description Description
OPTIONS OPTIONS
## EXAMPLE
$ wp bp friend remove user1 another_user Success: Friendship successfully removed.
Source Source
File: cli/src/friends.php
public function remove( $args ) { $initiator = $this->get_user_id_from_identifier( $args[0] ); $friend = $this->get_user_id_from_identifier( $args[1] ); // Check if users are already friends, if not, bail. if ( ! friends_check_friendship( $initiator->ID, $friend->ID ) ) { WP_CLI::error( 'These users are not friends.' ); } if ( friends_remove_friend( $initiator->ID, $friend->ID ) ) { WP_CLI::success( 'Friendship successfully removed.' ); } else { WP_CLI::error( 'There was a problem while removing the friendship.' ); } }
Expand full source code Collapse full source code View on Trac