diff --git a/includes/collection/class-followers.php b/includes/collection/class-followers.php index e583b31..9848c5e 100644 --- a/includes/collection/class-followers.php +++ b/includes/collection/class-followers.php @@ -199,6 +199,10 @@ class Followers { wp_set_object_terms( $user_id, $actor, self::TAXONOMY, true ); } + public static function remove_follower( $user_id, $actor ) { + wp_remove_object_terms( $user_id, $actor, self::TAXONOMY ); + } + /** * Undocumented function * @@ -225,7 +229,7 @@ class Followers { * @param int $user_id * @param int $number * @param int $offset - * @return array The Term list of followers + * @return array The Term list of Followers */ public static function get_followers( $user_id, $number = null, $offset = null ) { //self::migrate_followers( $user_id ); diff --git a/includes/table/class-followers.php b/includes/table/class-followers.php index bba3208..dbd2647 100644 --- a/includes/table/class-followers.php +++ b/includes/table/class-followers.php @@ -59,8 +59,7 @@ class Followers extends WP_List_Table { public function get_bulk_actions() { return array( - 'revoke' => __( 'Revoke', 'activitypub' ), - 'verify' => __( 'Verify', 'activitypub' ), + 'delete' => __( 'Delete', 'activitypub' ), ); } @@ -79,6 +78,16 @@ class Followers extends WP_List_Table { } public function column_cb( $item ) { - return sprintf( '', esc_attr( $item['identifier'] ) ); + return sprintf( '', esc_attr( $item['identifier'] ) ); + } + + public function process_action() { + $followers = isset( $_REQUEST['followers'] ) ? $_REQUEST['followers'] : array(); // phpcs:ignore + + switch ( $this->current_action() ) { + case 'delete': + FollowerCollection::remove_follower( \get_current_user_id(), $followers ); + break; + } } } diff --git a/templates/followers-list.php b/templates/followers-list.php index 261808f..e76a45d 100644 --- a/templates/followers-list.php +++ b/templates/followers-list.php @@ -7,7 +7,7 @@