Skip to content

Commit

Permalink
Fix standard post format
Browse files Browse the repository at this point in the history
  • Loading branch information
akirk committed Aug 31, 2024
1 parent ba7f55b commit 345dd6b
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions includes/class-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3189,13 +3189,22 @@ public function ajax_friends_dashboard() {

if ( isset( $post_formats[ $format ] ) ) {
$args['post_format'] = $format;
$query_args['tax_query'] = array( // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_tax_query
array(
'taxonomy' => 'post_format',
'field' => 'slug',
'terms' => array( 'post-format-' . $format ),
),
);
if ( 'standard' !== $format ) {
$query_args['tax_query'] = array( // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_tax_query
array(
'taxonomy' => 'post_format',
'field' => 'slug',
'terms' => array( 'post-format-' . $format ),
),
);
} else {
$query_args['tax_query'] = array( // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_tax_query
array(
'taxonomy' => 'post_format',
'operator' => 'NOT EXISTS',
),
);
}
}
}

Expand Down

0 comments on commit 345dd6b

Please sign in to comment.