Skip to content

Commit

Permalink
fix: post type assigment in infinit scroll
Browse files Browse the repository at this point in the history
The post type was overrided with the value 'post' even if the args had its own value. Now it will act as default value.
  • Loading branch information
Soare-Robert-Daniel committed Nov 9, 2023
1 parent 163a53f commit 41855ee
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 41855ee

Please sign in to comment.