Skip to content

Commit

Permalink
Merge pull request #3777 from 10up/fix/issue-3766
Browse files Browse the repository at this point in the history
Fix warning on term archive page when the term was not found
  • Loading branch information
felipeelia authored Dec 6, 2023
2 parents d221fac + bae14f2 commit 78613af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/classes/Indexable/Post/QueryIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public function get_es_posts( $posts, $query ) {
* If not search and not set default to post. If not set and is search, use searchable post types
*/
if ( empty( $query_vars['post_type'] ) ) {
if ( $query->is_tax() ) {
if ( $query->is_tax() && $query->get_queried_object() ) {
$query_vars['post_type'] = get_taxonomy( $query->get_queried_object()->taxonomy )->object_type;
} elseif ( empty( $query_vars['s'] ) ) {
$query_vars['post_type'] = 'post';
Expand Down

0 comments on commit 78613af

Please sign in to comment.