File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -705,7 +705,7 @@ public static function comment_query( $query ) {
705705 // Handle admin comment queries.
706706 if ( \is_admin () ) {
707707 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
708- if ( isset ( $ _GET ['comment_status ' ] ) && 'federated ' === $ _GET ['comment_status ' ] && empty ( $ query ->query_vars ['count ' ] ) ) {
708+ if ( ( isset ( $ _GET ['comment_status ' ] ) && 'federated ' === $ _GET ['comment_status ' ] && empty ( $ query ->query_vars ['count ' ] ) ) || $ query -> query_vars [ ' post_type ' ] ) {
709709 // Show only comments from hidden post types (Fediverse view).
710710 $ query ->query_vars ['post_type ' ] = self ::hide_for ();
711711 $ query ->query_vars ['status ' ] = 'all ' ;
Original file line number Diff line number Diff line change @@ -573,11 +573,20 @@ public static function comment_views( $views ) {
573573 $ views ['all ' ] = \str_replace ( 'current ' , '' , $ views ['all ' ] );
574574 }
575575
576+ // Count comments from hidden post types.
577+ $ count = \get_comments (
578+ array (
579+ 'post_type ' => $ post_types ,
580+ 'count ' => true ,
581+ )
582+ );
583+
576584 $ views ['federated ' ] = \sprintf (
577- '<a href="%s" class="%s">%s</a> ' ,
585+ '<a href="%s" class="%s">%s <span class="count">(%s)</span> </a> ' ,
578586 \esc_url ( \admin_url ( 'edit-comments.php?comment_status=federated ' ) ),
579587 \esc_attr ( $ current ),
580- \esc_html__ ( 'Fediverse ' , 'activitypub ' )
588+ \esc_html__ ( 'Fediverse ' , 'activitypub ' ),
589+ \esc_html ( \number_format_i18n ( $ count ) )
581590 );
582591
583592 return $ views ;
You can’t perform that action at this time.
0 commit comments