2019-08-21 10:38:43 +02:00
|
|
|
<?php
|
|
|
|
namespace Activitypub\Table;
|
|
|
|
|
2019-12-01 21:20:26 +01:00
|
|
|
if ( ! \class_exists( '\WP_List_Table' ) ) {
|
2019-08-21 10:38:43 +02:00
|
|
|
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
|
|
|
|
}
|
|
|
|
|
|
|
|
class Followers_List extends \WP_List_Table {
|
|
|
|
public function get_columns() {
|
|
|
|
return array(
|
2019-09-27 10:12:59 +02:00
|
|
|
'identifier' => \__( 'Identifier', 'activitypub' ),
|
2019-08-21 10:38:43 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function get_sortable_columns() {
|
|
|
|
return array();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function prepare_items() {
|
|
|
|
$columns = $this->get_columns();
|
|
|
|
$hidden = array();
|
|
|
|
|
|
|
|
$this->process_action();
|
|
|
|
$this->_column_headers = array( $columns, $hidden, $this->get_sortable_columns() );
|
|
|
|
|
|
|
|
$this->items = array();
|
|
|
|
|
2019-11-18 20:57:00 +01:00
|
|
|
foreach ( \Activitypub\Peer\Followers::get_followers( \get_current_user_id() ) as $follower ) {
|
2019-09-27 10:12:59 +02:00
|
|
|
$this->items[]['identifier'] = \esc_attr( $follower );
|
2019-08-21 10:38:43 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public function column_default( $item, $column_name ) {
|
|
|
|
return $item[ $column_name ];
|
|
|
|
}
|
|
|
|
}
|