Aggiunta limitazione per mostrare solo post effettivamente pubblicati

This commit is contained in:
ulaulaman 2020-07-28 09:35:09 +02:00
parent fd9b2af9c2
commit 18fd43f1cc
1 changed files with 3 additions and 1 deletions

View File

@ -114,6 +114,7 @@ class Ajax_Filter_Posts {
$query = new WP_Query([
'post_type' => $attributes['post_type'],
'posts_per_page' => $attributes['posts_per_page'],
'posts_per_page' => $attributes['posts_per_page'],
]);
$plural_post_name = strtolower(get_post_type_object($query->query['post_type'])->labels->name);
@ -178,7 +179,8 @@ class Ajax_Filter_Posts {
'paged' => $page,
'post_type' => $post_type,
'posts_per_page' => $quantity,
'tax_query' => $tax
'tax_query' => $tax,
'post_status' => 'publish'
];
$response = $this->get_filter_posts($args, $language);