PluginProbe
ActivityPub / 3.2.5
ActivityPub v3.2.5
9.3.1 9.3.0 9.2.2 9.2.1 9.2.0 9.1.0 9.0.2 9.0.1 9.0.0 8.3.0 8.2.1 8.2.0 8.1.1 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.2.0 1.3.0 2.0.0 2.0.1 2.1.0 2.1.1 All 160 releases
← All changes | includes/class-admin.php +444 -35 2.1.03.2.5 View file →
@@ -1,10 +1,14 @@
1 1 <?php
2 2 namespace Activitypub;
3 3
4 4 use WP_User_Query;
5 -use Activitypub\Model\Blog_User;
5 +use Activitypub\Model\Blog;
6 +use Activitypub\Activitypub;
7 +use Activitypub\Collection\Users;
8 +use Activitypub\Collection\Extra_Fields;
6 9
10 +use function Activitypub\count_followers;
7 11 use function Activitypub\is_user_disabled;
8 12 use function Activitypub\was_comment_received;
9 13 use function Activitypub\is_comment_federatable;
10 14
@@ -20,16 +24,31 @@
20 24 public static function init() {
21 25 \add_action( 'admin_menu', array( self::class, 'admin_menu' ) );
22 26 \add_action( 'admin_init', array( self::class, 'register_settings' ) );
23 27 \add_action( 'load-comment.php', array( self::class, 'edit_comment' ) );
24 - \add_action( 'personal_options_update', array( self::class, 'save_user_description' ) );
28 + \add_action( 'load-post.php', array( self::class, 'edit_post' ) );
29 + \add_action( 'load-edit.php', array( self::class, 'list_posts' ) );
30 + \add_action( 'personal_options_update', array( self::class, 'save_user_settings' ) );
25 31 \add_action( 'admin_enqueue_scripts', array( self::class, 'enqueue_scripts' ) );
26 32 \add_action( 'admin_notices', array( self::class, 'admin_notices' ) );
33 +
27 34 \add_filter( 'comment_row_actions', array( self::class, 'comment_row_actions' ), 10, 2 );
35 + \add_filter( 'manage_edit-comments_columns', array( static::class, 'manage_comment_columns' ) );
36 + \add_action( 'manage_comments_custom_column', array( static::class, 'manage_comments_custom_column' ), 9, 2 );
28 37
38 + \add_filter( 'manage_posts_columns', array( static::class, 'manage_post_columns' ), 10, 2 );
39 + \add_action( 'manage_posts_custom_column', array( self::class, 'manage_posts_custom_column' ), 10, 2 );
40 +
41 + \add_filter( 'manage_users_columns', array( self::class, 'manage_users_columns' ), 10, 1 );
42 + \add_action( 'manage_users_custom_column', array( self::class, 'manage_users_custom_column' ), 10, 3 );
43 + \add_filter( 'bulk_actions-users', array( self::class, 'user_bulk_options' ) );
44 + \add_filter( 'handle_bulk_actions-users', array( self::class, 'handle_bulk_request' ), 10, 3 );
45 +
29 46 if ( ! is_user_disabled( get_current_user_id() ) ) {
30 47 \add_action( 'show_user_profile', array( self::class, 'add_profile' ) );
31 48 }
49 +
50 + \add_filter( 'dashboard_glance_items', array( self::class, 'dashboard_glance_items' ) );
32 51 }
33 52
34 53 /**
35 54 * Add admin menu entry
@@ -42,15 +61,37 @@
42 61 'activitypub',
43 62 array( self::class, 'settings_page' )
44 63 );
45 64
46 - \add_action( 'load-' . $settings_page, array( self::class, 'add_settings_help_tab' ) );
65 + \add_action(
66 + 'load-' . $settings_page,
67 + array( self::class, 'add_settings_help_tab' )
68 + );
47 69
48 70 // user has to be able to publish posts
49 71 if ( ! is_user_disabled( get_current_user_id() ) ) {
50 - $followers_list_page = \add_users_page( \__( 'Followers', 'activitypub' ), \__( 'Followers', 'activitypub' ), 'read', 'activitypub-followers-list', array( self::class, 'followers_list_page' ) );
72 + $followers_list_page = \add_users_page(
73 + \__( '⁂ Followers', 'activitypub' ),
74 + \__( '⁂ Followers', 'activitypub' ),
75 + 'read',
76 + 'activitypub-followers-list',
77 + array(
78 + self::class,
79 + 'followers_list_page',
80 + )
81 + );
51 82
52 - \add_action( 'load-' . $followers_list_page, array( self::class, 'add_followers_list_help_tab' ) );
83 + \add_action(
84 + 'load-' . $followers_list_page,
85 + array( self::class, 'add_followers_list_help_tab' )
86 + );
87 +
88 + \add_users_page(
89 + \__( '⁂ Extra Fields', 'activitypub' ),
90 + \__( '⁂ Extra Fields', 'activitypub' ),
91 + 'read',
92 + \esc_url( \admin_url( '/edit.php?post_type=ap_extrafield' ) )
93 + );
53 94 }
54 95 }
55 96
56 97 /**
@@ -60,11 +101,23 @@
60 101 */
61 102 public static function admin_notices() {
62 103 $permalink_structure = \get_option( 'permalink_structure' );
63 104 if ( empty( $permalink_structure ) ) {
64 - $admin_notice = \__( 'You are using the ActivityPub plugin without setting a permalink structure. This will prevent ActivityPub from working. Please set a permalink structure.', 'activitypub' );
105 + $admin_notice = \__( 'You are using the ActivityPub plugin with a permalink structure of "plain". This will prevent ActivityPub from working. Please go to "Settings" / "Permalinks" and choose a permalink structure other than "plain".', 'activitypub' );
65 106 self::show_admin_notice( $admin_notice, 'error' );
66 107 }
108 +
109 + $current_screen = get_current_screen();
110 + if ( ! $current_screen ) {
111 + return;
112 + }
113 + if ( 'edit' === $current_screen->base && Extra_Fields::is_extra_fields_post_type( $current_screen->post_type ) ) {
114 + ?>
115 + <div class="notice" style="margin: 0; background: none; border: none; box-shadow: none; padding: 15px 0 0 0; font-size: 14px;">
116 + <?php esc_html_e( 'These are extra fields that are used for your ActivityPub profile. You can use your homepage, social profiles, pronouns, age, anything you want.', 'activitypub' ); ?>
117 + </div>
118 + <?php
119 + }
67 120 }
68 121
69 122 /**
70 123 * Display one admin menu notice about configuration problems or conflicts.
@@ -99,10 +152,16 @@
99 152 switch ( $tab ) {
100 153 case 'settings':
101 154 \load_template( ACTIVITYPUB_PLUGIN_DIR . 'templates/settings.php' );
102 155 break;
156 + case 'blog-profile':
157 + wp_enqueue_media();
158 + wp_enqueue_script( 'activitypub-header-image' );
159 +
160 + \load_template( ACTIVITYPUB_PLUGIN_DIR . 'templates/blog-settings.php' );
161 + break;
103 162 case 'followers':
104 - \load_template( ACTIVITYPUB_PLUGIN_DIR . 'templates/blog-user-followers-list.php' );
163 + \load_template( ACTIVITYPUB_PLUGIN_DIR . 'templates/blog-followers-list.php' );
105 164 break;
106 165 case 'welcome':
107 166 default:
108 167 wp_enqueue_script( 'plugin-install' );
@@ -174,9 +233,8 @@
174 233 'show_in_rest' => array(
175 234 'schema' => array(
176 235 'enum' => array(
177 236 'note',
178 - 'article',
179 237 'wordpress-post-format',
180 238 ),
181 239 ),
182 240 ),
@@ -193,8 +251,17 @@
193 251 )
194 252 );
195 253 \register_setting(
196 254 'activitypub',
255 + 'activitypub_use_opengraph',
256 + array(
257 + 'type' => 'boolean',
258 + 'description' => \__( 'Automatically add "fediverse:creator" OpenGraph tags for Authors and the Blog-User.', 'activitypub' ),
259 + 'default' => '1',
260 + )
261 + );
262 + \register_setting(
263 + 'activitypub',
197 264 'activitypub_support_post_types',
198 265 array(
199 266 'type' => 'string',
200 267 'description' => \esc_html__( 'Enable ActivityPub support for post types', 'activitypub' ),
@@ -203,14 +270,44 @@
203 270 )
204 271 );
205 272 \register_setting(
206 273 'activitypub',
207 - 'activitypub_blog_user_identifier',
274 + 'activitypub_enable_users',
208 275 array(
276 + 'type' => 'boolean',
277 + 'description' => \__( 'Every Author on this Blog (with the publish_posts capability) gets his own ActivityPub enabled Profile.', 'activitypub' ),
278 + 'default' => '1',
279 + )
280 + );
281 + \register_setting(
282 + 'activitypub',
283 + 'activitypub_enable_blog_user',
284 + array(
285 + 'type' => 'boolean',
286 + 'description' => \__( 'Your Blog becomes an ActivityPub compatible Profile.', 'activitypub' ),
287 + 'default' => '0',
288 + )
289 + );
290 +
291 + // Blog-User Settings
292 + \register_setting(
293 + 'activitypub_blog',
294 + 'activitypub_blog_description',
295 + array(
296 + 'type' => 'string',
297 + 'description' => \esc_html__( 'The Description of the Blog-User', 'activitypub' ),
298 + 'show_in_rest' => true,
299 + 'default' => '',
300 + )
301 + );
302 + \register_setting(
303 + 'activitypub_blog',
304 + 'activitypub_blog_identifier',
305 + array(
209 306 'type' => 'string',
210 307 'description' => \esc_html__( 'The Identifier of the Blog-User', 'activitypub' ),
211 308 'show_in_rest' => true,
212 - 'default' => Blog_User::get_default_username(),
309 + 'default' => Blog::get_default_username(),
213 310 'sanitize_callback' => function ( $value ) {
214 311 // hack to allow dots in the username
215 312 $parts = explode( '.', $value );
216 313 $sanitized = array();
@@ -233,15 +330,15 @@
233 330 );
234 331
235 332 if ( $user->results ) {
236 333 add_settings_error(
237 - 'activitypub_blog_user_identifier',
238 - 'activitypub_blog_user_identifier',
334 + 'activitypub_blog_identifier',
335 + 'activitypub_blog_identifier',
239 336 \esc_html__( 'You cannot use an existing author\'s name for the blog profile ID.', 'activitypub' ),
240 337 'error'
241 338 );
242 339
243 - return Blog_User::get_default_username();
340 + return Blog::get_default_username();
244 341 }
245 342
246 343 return $sanitized;
247 344 },
@@ -247,25 +344,16 @@
247 344 },
248 345 )
249 346 );
250 347 \register_setting(
251 - 'activitypub',
252 - 'activitypub_enable_users',
348 + 'activitypub_blog',
349 + 'activitypub_header_image',
253 350 array(
254 - 'type' => 'boolean',
255 - 'description' => \__( 'Every Author on this Blog (with the publish_posts capability) gets his own ActivityPub enabled Profile.', 'activitypub' ),
256 - 'default' => '1',
351 + 'type' => 'integer',
352 + 'description' => \__( 'The Attachment-ID of the Sites Header-Image', 'activitypub' ),
353 + 'default' => null,
257 354 )
258 355 );
259 - \register_setting(
260 - 'activitypub',
261 - 'activitypub_enable_blog_user',
262 - array(
263 - 'type' => 'boolean',
264 - 'description' => \__( 'Your Blog becomes an ActivityPub compatible Profile.', 'activitypub' ),
265 - 'default' => '0',
266 - )
267 - );
268 356 }
269 357
270 358 public static function add_settings_help_tab() {
271 359 require_once ACTIVITYPUB_PLUGIN_DIR . 'includes/help.php';
@@ -275,10 +363,13 @@
275 363 // todo
276 364 }
277 365
278 366 public static function add_profile( $user ) {
279 - $description = get_user_meta( $user->ID, 'activitypub_user_description', true );
367 + $description = \get_user_option( 'activitypub_description', $user->ID );
280 368
369 + wp_enqueue_media();
370 + wp_enqueue_script( 'activitypub-header-image' );
371 +
281 372 \load_template(
282 373 ACTIVITYPUB_PLUGIN_DIR . 'templates/user-settings.php',
283 374 true,
284 375 array(
@@ -286,30 +377,88 @@
286 377 )
287 378 );
288 379 }
289 380
290 - public static function save_user_description( $user_id ) {
381 + /**
382 + * Save the user settings
383 + *
384 + * Habdles the saving of the ActivityPub settings.
385 + *
386 + * @param int $user_id The user ID.
387 + *
388 + * @return void
389 + */
390 + public static function save_user_settings( $user_id ) {
291 391 if ( ! isset( $_REQUEST['_apnonce'] ) ) {
292 392 return false;
293 393 }
294 394 $nonce = sanitize_text_field( wp_unslash( $_REQUEST['_apnonce'] ) );
295 395 if (
296 - ! wp_verify_nonce( $nonce, 'activitypub-user-description' ) ||
396 + ! wp_verify_nonce( $nonce, 'activitypub-user-settings' ) ||
297 397 ! current_user_can( 'edit_user', $user_id )
298 398 ) {
299 399 return false;
300 400 }
301 - $description = ! empty( $_POST['activitypub-user-description'] ) ? sanitize_text_field( wp_unslash( $_POST['activitypub-user-description'] ) ) : false;
401 + $description = ! empty( $_POST['activitypub_description'] ) ? sanitize_textarea_field( wp_unslash( $_POST['activitypub_description'] ) ) : false;
302 402 if ( $description ) {
303 - update_user_meta( $user_id, 'activitypub_user_description', $description );
403 + \update_user_option( $user_id, 'activitypub_description', $description );
404 + } else {
405 + \delete_user_option( $user_id, 'activitypub_description' );
304 406 }
407 +
408 + $header_image = ! empty( $_POST['activitypub_header_image'] ) ? sanitize_text_field( wp_unslash( $_POST['activitypub_header_image'] ) ) : false;
409 + if ( $header_image && \wp_attachment_is_image( $header_image ) ) {
410 + \update_user_option( $user_id, 'activitypub_header_image', $header_image );
411 + } else {
412 + \delete_user_option( $user_id, 'activitypub_header_image' );
413 + }
305 414 }
306 415
307 416 public static function enqueue_scripts( $hook_suffix ) {
417 + wp_register_script(
418 + 'activitypub-header-image',
419 + plugins_url(
420 + 'assets/js/activitypub-header-image.js',
421 + ACTIVITYPUB_PLUGIN_FILE
422 + ),
423 + array( 'jquery' ),
424 + get_plugin_version(),
425 + false
426 + );
427 +
308 428 if ( false !== strpos( $hook_suffix, 'activitypub' ) ) {
309 - wp_enqueue_style( 'activitypub-admin-styles', plugins_url( 'assets/css/activitypub-admin.css', ACTIVITYPUB_PLUGIN_FILE ), array(), '1.0.0' );
310 - wp_enqueue_script( 'activitypub-admin-styles', plugins_url( 'assets/js/activitypub-admin.js', ACTIVITYPUB_PLUGIN_FILE ), array( 'jquery' ), '1.0.0', false );
429 + wp_enqueue_style(
430 + 'activitypub-admin-styles',
431 + plugins_url(
432 + 'assets/css/activitypub-admin.css',
433 + ACTIVITYPUB_PLUGIN_FILE
434 + ),
435 + array(),
436 + get_plugin_version()
437 + );
438 + wp_enqueue_script(
439 + 'activitypub-admin-script',
440 + plugins_url(
441 + 'assets/js/activitypub-admin.js',
442 + ACTIVITYPUB_PLUGIN_FILE
443 + ),
444 + array( 'jquery' ),
445 + get_plugin_version(),
446 + false
447 + );
311 448 }
449 +
450 + if ( 'index.php' === $hook_suffix ) {
451 + wp_enqueue_style(
452 + 'activitypub-admin-styles',
453 + plugins_url(
454 + 'assets/css/activitypub-admin.css',
455 + ACTIVITYPUB_PLUGIN_FILE
456 + ),
457 + array(),
458 + get_plugin_version()
459 + );
460 + }
312 461 }
313 462
314 463 /**
315 464 * Hook into the edit_comment functionality
@@ -337,14 +486,274 @@
337 486 3
338 487 );
339 488 }
340 489
490 + public static function edit_post() {
491 + // Disable the edit_post capability for federated posts.
492 + \add_filter(
493 + 'user_has_cap',
494 + function ( $allcaps, $caps, $arg ) {
495 + if ( 'edit_post' !== $arg[0] ) {
496 + return $allcaps;
497 + }
498 +
499 + $post = get_post( $arg[2] );
500 +
501 + if ( ! Extra_Fields::is_extra_field_post_type( $post->post_type ) ) {
502 + return $allcaps;
503 + }
504 +
505 + if ( (int) get_current_user_id() !== (int) $post->post_author ) {
506 + return false;
507 + }
508 +
509 + return $allcaps;
510 + },
511 + 1,
512 + 3
513 + );
514 + }
515 +
516 + /**
517 + * Add ActivityPub specific actions/filters to the post list view
518 + *
519 + * @return void
520 + */
521 + public static function list_posts() {
522 + // Show only the user's extra fields.
523 + \add_action(
524 + 'pre_get_posts',
525 + function ( $query ) {
526 + if ( $query->get( 'post_type' ) === 'ap_extrafield' ) {
527 + $query->set( 'author', get_current_user_id() );
528 + }
529 + }
530 + );
531 +
532 + // Remove all views for the extra fields.
533 + $screen_id = get_current_screen()->id;
534 +
535 + add_filter(
536 + "views_{$screen_id}",
537 + function ( $views ) {
538 + if ( Extra_Fields::is_extra_fields_post_type( get_current_screen()->post_type ) ) {
539 + return array();
540 + }
541 +
542 + return $views;
543 + }
544 + );
545 + }
546 +
341 547 public static function comment_row_actions( $actions, $comment ) {
342 548 if ( was_comment_received( $comment ) ) {
343 549 unset( $actions['edit'] );
344 - unset( $actions['reply'] );
345 550 unset( $actions['quickedit'] );
346 551 }
347 552
348 553 return $actions;
554 + }
555 +
556 + /**
557 + * Add a column "activitypub"
558 + *
559 + * This column shows if the user has the capability to use ActivityPub.
560 + *
561 + * @param array $columns The columns.
562 + *
563 + * @return array The columns extended by the activitypub.
564 + */
565 + public static function manage_users_columns( $columns ) {
566 + $columns['activitypub'] = __( 'ActivityPub', 'activitypub' );
567 + return $columns;
568 + }
569 +
570 + /**
571 + * Add "comment-type" and "protocol" as column in WP-Admin
572 + *
573 + * @param array $columns the list of column names
574 + */
575 + public static function manage_comment_columns( $columns ) {
576 + $columns['comment_type'] = esc_attr__( 'Comment-Type', 'activitypub' );
577 + $columns['comment_protocol'] = esc_attr__( 'Protocol', 'activitypub' );
578 +
579 + return $columns;
580 + }
581 +
582 + /**
583 + * Add "post_content" as column for Extra-Fields in WP-Admin
584 + *
585 + * @param array $columns Tthe list of column names.
586 + * @param string $post_type The post type.
587 + */
588 + public static function manage_post_columns( $columns, $post_type ) {
589 + if ( Extra_Fields::is_extra_fields_post_type( $post_type ) ) {
590 + $after_key = 'title';
591 + $index = array_search( $after_key, array_keys( $columns ), true );
592 + $columns = array_slice( $columns, 0, $index + 1 ) + array( 'extra_field_content' => esc_attr__( 'Content', 'activitypub' ) ) + $columns;
593 + }
594 +
595 + return $columns;
596 + }
597 +
598 + /**
599 + * Add "comment-type" and "protocol" as column in WP-Admin
600 + *
601 + * @param array $column The column to implement
602 + * @param int $comment_id The comment id
603 + */
604 + public static function manage_comments_custom_column( $column, $comment_id ) {
605 + if ( 'comment_type' === $column && ! defined( 'WEBMENTION_PLUGIN_DIR' ) ) {
606 + echo esc_attr( ucfirst( get_comment_type( $comment_id ) ) );
607 + } elseif ( 'comment_protocol' === $column ) {
608 + $protocol = get_comment_meta( $comment_id, 'protocol', true );
609 +
610 + if ( $protocol ) {
611 + echo esc_attr( ucfirst( str_replace( 'activitypub', 'ActivityPub', $protocol ) ) );
612 + } else {
613 + esc_attr_e( 'Local', 'activitypub' );
614 + }
615 + }
616 + }
617 +
618 + /**
619 + * Return the results for the activitypub column.
620 + *
621 + * @param string $output Custom column output. Default empty.
622 + * @param string $column_name Column name.
623 + * @param int $user_id ID of the currently-listed user.
624 + *
625 + * @return string The column contents.
626 + */
627 + public static function manage_users_custom_column( $output, $column_name, $user_id ) {
628 + if ( 'activitypub' !== $column_name ) {
629 + return $output;
630 + }
631 +
632 + if ( \user_can( $user_id, 'activitypub' ) ) {
633 + return '<span aria-hidden="true">&#x2713;</span><span class="screen-reader-text">' . esc_html__( 'ActivityPub enabled for this author', 'activitypub' ) . '</span>';
634 + } else {
635 + return '<span aria-hidden="true">&#x2717;</span><span class="screen-reader-text">' . esc_html__( 'ActivityPub disabled for this author', 'activitypub' ) . '</span>';
636 + }
637 + }
638 +
639 + /**
640 + * Add a column "extra_field_content" to the post list view
641 + *
642 + * @param string $column_name The column name.
643 + * @param int $post_id The post ID.
644 + *
645 + * @return void
646 + */
647 + public static function manage_posts_custom_column( $column_name, $post_id ) {
648 + $post = get_post( $post_id );
649 +
650 + if ( 'extra_field_content' === $column_name ) {
651 + $post = get_post( $post_id );
652 + if ( Extra_Fields::is_extra_fields_post_type( $post->post_type ) ) {
653 + echo esc_attr( wp_strip_all_tags( $post->post_content ) );
654 + }
655 + }
656 + }
657 +
658 + /**
659 + * Add options to the Bulk dropdown on the users page
660 + *
661 + * @param array $actions The existing bulk options.
662 + *
663 + * @return array The extended bulk options.
664 + */
665 + public static function user_bulk_options( $actions ) {
666 + $actions['add_activitypub_cap'] = __( 'Enable for ActivityPub', 'activitypub' );
667 + $actions['remove_activitypub_cap'] = __( 'Disable for ActivityPub', 'activitypub' );
668 +
669 + return $actions;
670 + }
671 +
672 + /**
673 + * Handle bulk activitypub requests
674 + *
675 + * * `add_activitypub_cap` - Add the activitypub capability to the selected users.
676 + * * `remove_activitypub_cap` - Remove the activitypub capability from the selected users.
677 + *
678 + * @param string $sendback The URL to send the user back to.
679 + * @param string $action The requested action.
680 + * @param array $users The selected users.
681 + *
682 + * @return string The URL to send the user back to.
683 + */
684 + public static function handle_bulk_request( $sendback, $action, $users ) {
685 + if (
686 + 'remove_activitypub_cap' !== $action &&
687 + 'add_activitypub_cap' !== $action
688 + ) {
689 + return $sendback;
690 + }
691 +
692 + foreach ( $users as $user_id ) {
693 + $user = new \WP_User( $user_id );
694 + if (
695 + 'add_activitypub_cap' === $action &&
696 + user_can( $user_id, 'publish_posts' )
697 + ) {
698 + $user->add_cap( 'activitypub' );
699 + } elseif ( 'remove_activitypub_cap' === $action ) {
700 + $user->remove_cap( 'activitypub' );
701 + }
702 + }
703 +
704 + return $sendback;
705 + }
706 +
707 + /**
708 + * Add ActivityPub infos to the dashboard glance items
709 + *
710 + * @param array $items The existing glance items.
711 + *
712 + * @return array The extended glance items.
713 + */
714 + public static function dashboard_glance_items( $items ) {
715 + \add_filter( 'number_format_i18n', '\Activitypub\custom_large_numbers', 10, 3 );
716 +
717 + if ( ! is_user_disabled( get_current_user_id() ) ) {
718 + $follower_count = sprintf(
719 + // translators: %s: number of followers
720 + _n(
721 + '%s Follower',
722 + '%s Followers',
723 + count_followers( \get_current_user_id() ),
724 + 'activitypub'
725 + ),
726 + \number_format_i18n( count_followers( \get_current_user_id() ) )
727 + );
728 + $items['activitypub-followers-user'] = sprintf(
729 + '<a class="activitypub-followers" href="%1$s" title="%2$s">%3$s</a>',
730 + \esc_url( \admin_url( 'users.php?page=activitypub-followers-list' ) ),
731 + \esc_attr__( 'Your followers', 'activitypub' ),
732 + \esc_html( $follower_count )
733 + );
734 + }
735 +
736 + if ( ! is_user_type_disabled( 'blog' ) && current_user_can( 'manage_options' ) ) {
737 + $follower_count = sprintf(
738 + // translators: %s: number of followers
739 + _n(
740 + '%s Follower (Blog)',
741 + '%s Followers (Blog)',
742 + count_followers( Users::BLOG_USER_ID ),
743 + 'activitypub'
744 + ),
745 + \number_format_i18n( count_followers( Users::BLOG_USER_ID ) )
746 + );
747 + $items['activitypub-followers-blog'] = sprintf(
748 + '<a class="activitypub-followers" href="%1$s" title="%2$s">%3$s</a>',
749 + \esc_url( \admin_url( 'options-general.php?page=activitypub&tab=followers' ) ),
750 + \esc_attr__( 'The Blog\'s followers', 'activitypub' ),
751 + \esc_html( $follower_count )
752 + );
753 + }
754 +
755 + \remove_filter( 'number_format_i18n', '\Activitypub\custom_large_numbers', 10, 3 );
756 +
757 + return $items;
349 758 }
350 759 }