File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -116,13 +116,24 @@ public static function nodeinfo2( $request ) {
116116 'version ' => \get_bloginfo ( 'version ' ),
117117 );
118118
119- $ users = \count_users ();
119+ $ users = \get_users (
120+ array (
121+ 'capability__in ' => array ( 'publish_posts ' ),
122+ )
123+ );
124+
125+ if ( is_array ( $ users ) ) {
126+ $ users = count ( $ users );
127+ } else {
128+ $ users = 1 ;
129+ }
130+
120131 $ posts = \wp_count_posts ();
121132 $ comments = \wp_count_comments ();
122133
123134 $ nodeinfo ['usage ' ] = array (
124135 'users ' => array (
125- 'total ' => (int ) $ users[ ' total_users ' ] ,
136+ 'total ' => (int ) $ users ,
126137 ),
127138 'localPosts ' => (int ) $ posts ->publish ,
128139 'localComments ' => (int ) $ comments ->approved ,
Original file line number Diff line number Diff line change @@ -75,6 +75,9 @@ public static function user_outbox_get( $request ) {
7575 $ json ->partOf = \get_rest_url ( null , "/activitypub/1.0/users/ $ user_id/outbox " ); // phpcs:ignore
7676 $ json ->totalItems = 0 ; // phpcs:ignore
7777
78+ // phpcs:ignore
79+ $ json ->totalItems = 0 ;
80+
7881 foreach ( $ post_types as $ post_type ) {
7982 $ count_posts = \wp_count_posts ( $ post_type );
8083 $ json ->totalItems += \intval ( $ count_posts ->publish ); // phpcs:ignore
You can’t perform that action at this time.
0 commit comments