diff --git a/includes/activity/class-base-object.php b/includes/activity/class-base-object.php index 510ed23..9c5f52a 100644 --- a/includes/activity/class-base-object.php +++ b/includes/activity/class-base-object.php @@ -661,6 +661,6 @@ class Base_Object { public function to_json() { $array = $this->to_array(); - return \wp_json_encode( $array ); + return \wp_json_encode( $array, \JSON_HEX_TAG | \JSON_HEX_AMP | \JSON_HEX_QUOT ); } } diff --git a/includes/class-activity-dispatcher.php b/includes/class-activity-dispatcher.php index 5c91b04..51d69b2 100644 --- a/includes/class-activity-dispatcher.php +++ b/includes/class-activity-dispatcher.php @@ -23,7 +23,7 @@ class Activity_Dispatcher { */ public static function init() { \add_action( 'activitypub_send_activity', array( self::class, 'send_user_activity' ), 10, 2 ); - \add_action( 'activitypub_send_activity', array( self::class, 'send_blog_activity' ), 10, 2 ); + \add_action( 'activitypub_send_activity', array( self::class, 'send_announce_activity' ), 10, 2 ); } /** @@ -74,6 +74,10 @@ class Activity_Dispatcher { // check if a migration is needed before sending new posts Migration::maybe_migrate(); + if ( ! in_array( $type, array( 'Create', 'Update' ), true ) ) { + return; + } + if ( is_user_disabled( Users::BLOG_USER_ID ) ) { return; } @@ -110,10 +114,14 @@ class Activity_Dispatcher { * * @return void */ - public static function send_blog_announce_activity( WP_Post $wp_post, $type ) { + public static function send_announce_activity( WP_Post $wp_post, $type ) { // check if a migration is needed before sending new posts Migration::maybe_migrate(); + if ( ! in_array( $type, array( 'Create', 'Update' ), true ) ) { + return; + } + if ( is_user_disabled( Users::BLOG_USER_ID ) ) { return; } diff --git a/includes/collection/class-followers.php b/includes/collection/class-followers.php index 65d8cdb..ce62619 100644 --- a/includes/collection/class-followers.php +++ b/includes/collection/class-followers.php @@ -298,7 +298,7 @@ class Followers { * * @return array The Term list of Followers, the format depends on $output */ - public static function get_followers( $user_id, $number = null, $page = null, $args = array() ) { + public static function get_followers( $user_id, $number = -1, $page = null, $args = array() ) { $defaults = array( 'post_type' => self::POST_TYPE, 'posts_per_page' => $number, diff --git a/includes/table/class-followers.php b/includes/table/class-followers.php index b815df6..b27f311 100644 --- a/includes/table/class-followers.php +++ b/includes/table/class-followers.php @@ -62,7 +62,7 @@ class Followers extends WP_List_Table { $this->set_pagination_args( array( 'total_items' => $counter, - 'total_pages' => round( $counter / $per_page ), + 'total_pages' => ceil( $counter / $per_page ), 'per_page' => $per_page, ) ); diff --git a/templates/blog-user-followers-list.php b/templates/blog-user-followers-list.php index 9ce3bd1..f73826f 100644 --- a/templates/blog-user-followers-list.php +++ b/templates/blog-user-followers-list.php @@ -13,17 +13,17 @@

- + -

get_user_count() ) ); ?>

+

get_user_count() ) ); ?>

prepare_items(); - $followers_table->display(); + $table->prepare_items(); + $table->display(); ?>