Skip to content

Commit

Permalink
Adding option to get posts individually, but also apply an ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-c-woodard committed Jan 6, 2025
1 parent 86c7bd5 commit 7d5b821
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions includes/class-kadence-blocks-posts-rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@ public function get_query_items( $request ) {
$query_args['orderby'] = 'post__in';
$query_args['posts_per_page'] = -1;
$query_args['ignore_sticky_posts'] = 1;
} else if ( 'individual-ordered' === $query_type ) {
$query_args['post__in'] = $request->get_param( self::PROP_INCLUDE );
$query_args['orderby'] = $request->get_param( self::PROP_ORDER_BY );
$query_args['posts_per_page'] = -1;
$query_args['ignore_sticky_posts'] = 1;
} else {
$query_args['posts_per_page'] = $request->get_param( self::PROP_PER_PAGE );
$query_args['tax_query'] = array();
Expand Down

0 comments on commit 7d5b821

Please sign in to comment.