Skip to content

Commit

Permalink
Merge pull request #4137 from Codeinwp/fix/infinit-scroll
Browse files Browse the repository at this point in the history
Fix Post Type assignment in Infinit scroll
  • Loading branch information
preda-bogdan authored Nov 28, 2023
2 parents 6fd8c20 + 5440e49 commit a7cdb66
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions inc/views/pluggable/pagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,12 @@ public function get_posts( \WP_REST_Request $request ) {
unset( $args['pagename'] );
}

$args['posts_per_page'] = $per_page;
$args['post_type'] = 'post';
$args['posts_per_page'] = $per_page;

if ( empty( $args['post_type'] ) ) {
$args['post_type'] = 'post';
}

$args['paged'] = $request['page_number'];
$args['ignore_sticky_posts'] = 1;
$args['post_status'] = 'publish';
Expand Down

0 comments on commit a7cdb66

Please sign in to comment.