fix delete

This commit is contained in:
Matthias Pfefferle 2023-06-28 09:56:18 +02:00
parent 58c04856c9
commit 36540c0f78

View file

@ -34,7 +34,7 @@ class Followers extends WP_List_Table {
'avatar' => \__( 'Avatar', 'activitypub' ), 'avatar' => \__( 'Avatar', 'activitypub' ),
'name' => \__( 'Name', 'activitypub' ), 'name' => \__( 'Name', 'activitypub' ),
'username' => \__( 'Username', 'activitypub' ), 'username' => \__( 'Username', 'activitypub' ),
'identifier' => \__( 'Identifier', 'activitypub' ), 'url' => \__( 'URL', 'activitypub' ),
'updated' => \__( 'Last updated', 'activitypub' ), 'updated' => \__( 'Last updated', 'activitypub' ),
//'errors' => \__( 'Errors', 'activitypub' ), //'errors' => \__( 'Errors', 'activitypub' ),
//'latest-error' => \__( 'Latest Error Message', 'activitypub' ), //'latest-error' => \__( 'Latest Error Message', 'activitypub' ),
@ -55,8 +55,8 @@ class Followers extends WP_List_Table {
$page_num = $this->get_pagenum(); $page_num = $this->get_pagenum();
$per_page = 20; $per_page = 20;
$follower = FollowerCollection::get_followers( $this->user_id, $per_page, ( $page_num - 1 ) * $per_page ); $followers = FollowerCollection::get_followers( $this->user_id, $per_page, ( $page_num - 1 ) * $per_page );
$counter = FollowerCollection::count_followers( $this->user_id ); $counter = FollowerCollection::count_followers( $this->user_id );
$this->items = array(); $this->items = array();
$this->set_pagination_args( $this->set_pagination_args(
@ -72,7 +72,8 @@ class Followers extends WP_List_Table {
'icon' => esc_attr( $follower->get_icon_url() ), 'icon' => esc_attr( $follower->get_icon_url() ),
'name' => esc_attr( $follower->get_name() ), 'name' => esc_attr( $follower->get_name() ),
'username' => esc_attr( $follower->get_preferred_username() ), 'username' => esc_attr( $follower->get_preferred_username() ),
'identifier' => esc_attr( $follower->get_url() ), 'url' => esc_attr( $follower->get_url() ),
'identifier' => esc_attr( $follower->get_id() ),
'updated' => esc_attr( $follower->get_updated() ), 'updated' => esc_attr( $follower->get_updated() ),
'errors' => $follower->count_errors(), 'errors' => $follower->count_errors(),
'latest-error' => $follower->get_latest_error_message(), 'latest-error' => $follower->get_latest_error_message(),
@ -102,11 +103,11 @@ class Followers extends WP_List_Table {
); );
} }
public function column_identifier( $item ) { public function column_url( $item ) {
return sprintf( return sprintf(
'<a href="%s" target="_blank">%s</a>', '<a href="%s" target="_blank">%s</a>',
$item['identifier'], $item['url'],
$item['identifier'] $item['url']
); );
} }
@ -135,7 +136,7 @@ class Followers extends WP_List_Table {
$followers = array( $followers ); $followers = array( $followers );
} }
foreach ( $followers as $follower ) { foreach ( $followers as $follower ) {
FollowerCollection::remove_follower( \get_current_user_id(), $follower ); FollowerCollection::remove_follower( $this->user_id, $follower );
} }
break; break;
} }