Makes sure that api accepts s as a search param. #428

This commit is contained in:
mateuswetah 2020-09-10 14:21:29 -03:00
parent 8e070faae2
commit b1128f1229
2 changed files with 4 additions and 0 deletions

View File

@ -69,6 +69,7 @@ class REST_Controller extends \WP_REST_Controller {
'authorid' => 'author',
'authorname' => 'author_name',
'search' => 's',
's' => 's',
'searchterm' => 'search',
'status' => 'post_status',
'offset' => 'offset',

View File

@ -38,6 +38,9 @@ export const fetchItems = ({ rootGetters, dispatch, commit }, { collectionId, is
if (postQueries.advancedSearch)
advancedSearchResults = postQueries.advancedSearch;
}
if (postQueries.s != undefined && postQueries.s != null)
postQueries.search = postQueries.s;
let query = qs.stringify(postQueries);
// Guarantees at least empty fetch_only are passed in case none is found