Unable to enable caching for custom end point
-
I want to enable caching for this custom endpoint which takes search_term to find matching posts in the db.
For example: https://site.com/wp-json/custom/v1/search/{search_term}
add_action('rest_api_init', 'RegisterSearch'); function RegisterSearch() { ? register_rest_route('custom/v1', 'search/(?P<search_term>[\w-]+)', array( ? ? 'methods' ?=> 'GET', ? ? 'callback' => 'getSearchResults', ? )); }
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Unable to enable caching for custom end point’ is closed to new replies.