Fix follower-list actions
This commit is contained in:
parent
e1fd0e1c39
commit
4f2a162f6c
3 changed files with 32 additions and 16 deletions
|
@ -65,7 +65,7 @@ class Admin {
|
||||||
\load_template( ACTIVITYPUB_PLUGIN_DIR . 'templates/settings.php' );
|
\load_template( ACTIVITYPUB_PLUGIN_DIR . 'templates/settings.php' );
|
||||||
break;
|
break;
|
||||||
case 'followers':
|
case 'followers':
|
||||||
\load_template( ACTIVITYPUB_PLUGIN_DIR . 'templates/followers-list.php' );
|
\load_template( ACTIVITYPUB_PLUGIN_DIR . 'templates/blog-user-followers-list.php' );
|
||||||
break;
|
break;
|
||||||
case 'welcome':
|
case 'welcome':
|
||||||
default:
|
default:
|
||||||
|
@ -85,7 +85,7 @@ class Admin {
|
||||||
if ( ! current_user_can( 'publish_posts' ) ) {
|
if ( ! current_user_can( 'publish_posts' ) ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
\load_template( ACTIVITYPUB_PLUGIN_DIR . 'templates/followers-list.php' );
|
\load_template( ACTIVITYPUB_PLUGIN_DIR . 'templates/user-followers-list.php' );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
30
templates/blog-user-followers-list.php
Normal file
30
templates/blog-user-followers-list.php
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
<?php
|
||||||
|
\load_template(
|
||||||
|
\dirname( __FILE__ ) . '/admin-header.php',
|
||||||
|
true,
|
||||||
|
array(
|
||||||
|
'settings' => '',
|
||||||
|
'welcome' => '',
|
||||||
|
'followers' => 'active',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="wrap">
|
||||||
|
<h1><?php \esc_html_e( 'Followers', 'activitypub' ); ?></h1>
|
||||||
|
|
||||||
|
<?php $followers_table = new \Activitypub\Table\Followers(); ?>
|
||||||
|
|
||||||
|
<?php // translators: ?>
|
||||||
|
<p><?php \printf( \esc_html__( 'You currently have %s followers.', 'activitypub' ), \esc_attr( $followers_table->get_user_count() ) ); ?></p>
|
||||||
|
|
||||||
|
<form method="get">
|
||||||
|
<input type="hidden" name="page" value="activitypub" />
|
||||||
|
<input type="hidden" name="tab" value="followers" />
|
||||||
|
<?php
|
||||||
|
$followers_table->prepare_items();
|
||||||
|
$followers_table->display();
|
||||||
|
?>
|
||||||
|
<?php wp_nonce_field( 'activitypub-followers-list', '_apnonce' ); ?>
|
||||||
|
</form>
|
||||||
|
</div>
|
|
@ -1,17 +1,3 @@
|
||||||
<?php
|
|
||||||
if ( get_current_screen()->id === 'settings_page_activitypub' ) {
|
|
||||||
\load_template(
|
|
||||||
\dirname( __FILE__ ) . '/admin-header.php',
|
|
||||||
true,
|
|
||||||
array(
|
|
||||||
'settings' => '',
|
|
||||||
'welcome' => '',
|
|
||||||
'followers' => 'active',
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
<h1><?php \esc_html_e( 'Followers', 'activitypub' ); ?></h1>
|
<h1><?php \esc_html_e( 'Followers', 'activitypub' ); ?></h1>
|
||||||
<?php Activitypub\Migration::maybe_migrate(); ?>
|
<?php Activitypub\Migration::maybe_migrate(); ?>
|
Loading…
Reference in a new issue