wordpress-activitypub/includes/table/followers-list.php

37 lines
868 B
PHP
Raw Normal View History

2019-08-21 10:38:43 +02:00
<?php
namespace Activitypub\Table;
if ( ! class_exists( '\WP_List_Table' ) ) {
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 ];
}
}