Skip to content

Commit bdbbc85

Browse files
committed
Fix post type check in admin comment query
Replaces a generic post type check with a specific comparison to self::hide_for() in the admin comment query logic, ensuring only comments from the intended hidden post type are shown in the Fediverse view.
1 parent d73bb2c commit bdbbc85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

includes/class-comment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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'] ) ) || $query->query_vars['post_type'] ) {
708+
if ( ( isset( $_GET['comment_status'] ) && 'federated' === $_GET['comment_status'] && empty( $query->query_vars['count'] ) ) || self::hide_for() === $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';

0 commit comments

Comments
 (0)