Skip to content

Instantly share code, notes, and snippets.

@searchwpgists
Created April 12, 2022 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save searchwpgists/7843f40e28b458bdf629802bddcfec4a to your computer and use it in GitHub Desktop.
Save searchwpgists/7843f40e28b458bdf629802bddcfec4a to your computer and use it in GitHub Desktop.
Customize the SearchWP Query arguments used for REST requests
<?php
// @link https://searchwp.com/documentation/rest-api/
// Customize the SearchWP Query arguments used for REST requests.
add_filter( 'searchwp\rest\args', function( $args, $params ) {
// $args are sent to \SWP_Query after this.
// @link https://searchwp.com/documentation/classes/swp_query/
return $args;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment