Skip to content

Commit

Permalink
Merge pull request #62 from ryanwelcher/feature/sort-post__in
Browse files Browse the repository at this point in the history
Add Sorting by Included Posts IDs.
  • Loading branch information
ryanwelcher authored Jun 4, 2024
2 parents a9cc21f + dfcab19 commit b102ad0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions includes/query-loop.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ function add_more_sort_by( $query_params ) {
$query_params['orderby']['enum'][] = 'meta_value';
$query_params['orderby']['enum'][] = 'meta_value_num';
$query_params['orderby']['enum'][] = 'rand';
$query_params['orderby']['enum'][] = 'post__in';
$query_params['orderby']['enum'][] = 'comment_count';
return $query_params;
}
Expand Down
4 changes: 4 additions & 0 deletions src/components/post-order-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ export const PostOrderControls = ( { attributes, setAttributes } ) => {
label: __( 'Date', 'advanced-query-loop' ),
value: 'date',
},
{
label: __( 'Included Posts', 'advanced-query-loop' ),
value: 'post__in',
},
{
label: __(
'Last Modified Date',
Expand Down

0 comments on commit b102ad0

Please sign in to comment.