1, 'fields' => 'ids', 'no_found_rows' => false ] ) ); wp_send_json_success( [ 'posts' => Posts::getPosts( $queryAttr, $pageNumber ), 'totalPosts' => (int) $allPosts->found_posts ] ); } } new Ajax();