Skip to content

Commit e6f0e88

Browse files
Merge pull request #6 from WebDevStudios/add-query-order-filters
Add filters for ordering
2 parents 653cf2d + ae3f211 commit e6f0e88

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

class-wds-react-post-search.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: WDS React Post Search
44
* Description: Power up the basic WordPress search with React.
55
* Plugin URI: https://www.webdevstudios.com
6-
* Version: 1.0.2
6+
* Version: 1.0.3
77
*
88
* With help from:
99
* https://www.ibenic.com/wordpress-react-search/
@@ -391,6 +391,8 @@ public function search_posts( $request ) {
391391
'post_type' => $this->get_valid_search_post_types( $request ),
392392
's' => sanitize_text_field( $request['s'] ),
393393
'tax_query' => apply_filters( 'wds_react_post_search_tax_query', array() ),
394+
'order' => apply_filters( 'wds_react_post_search_order', 'DESC' ),
395+
'orderby' => apply_filters( 'wds_react_post_search_orderby', 'date' ),
394396
];
395397

396398
// Get posts.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "wds-react-post-search",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "Power up the basic WordPress search field with React.",
55
"main": "assets/js/public.js",
66
"dependencies": {

0 commit comments

Comments
 (0)