The rest_grammar_terms_query hook should normally fire, but it’s possible that when registering the custom taxonomy or defining the API endpoint, that hook wasn’t applied or the wrong namespace was used.
One approach would be to try using register_rest_field() or the rest_prepare_<taxonomy> filter. For example, rest_prepare_grammar_terms can be used to modify the API response of your taxonomy before it’s returned by REST. If that specific filter isn’t available, you might also try rest_pre_dispatch or rest_<taxonomy>_query if you’re controlling the response via register_rest_route().
For debugging, adding some error_log() or even a wp_die() inside the suspected hooks can help confirm whether those hooks are firing and where the process is being skipped.
Related Posts:
- Is the WordPress REST API installed and enabled in a vanilla WordPress 4.7 installation?
- check the requesting url
- WP REST API Require Password for GET Endpoint
- Getting user meta data from WP REST API
- WP REST API V2 – Retrieve sub page by full slug (URL/Path)
- Increase per_page limit in REST API
- How to use the WP REST API for new user registration (sign up form)?
- Can I authenticate with both WooCommerce consumer key and JWT?
- Can’t send emails through REST API
- WP REST API: check if user is logged in
- How to login to WordPress site using basic authentication HTTP headers?
- Adding post fields in wp-json/wp/v2/search
- WordPress Gutenberg get page template value when post updated?
- WP Rest API convert permalink to post ID for fetch
- How to update custom meta fields with rest api?
- Formating content rendered from wordpress REST API as JSON and not HTML
- How to filter users on custom meta fields in WP JSON v2?
- How can I return an image from a custom REST API endpoint?
- Gutenberg Custom Block Getting All Posts
- Check Password Strength using WordPress API
- Send request to WordPress REST API
- Request to REST endpoint works fine in browser and curl, but fails from WP_REST_Request
- Can we assume that /wp-json/ will always be /wp-json/ under any circumstances when creating custom REST routes?
- WP REST api.wordpress.org discovery
- Rest API in integration tests – filtering by slug not working?
- Passing a borrowed nonce through Postman fails
- How to hook into “register_rest_field” to modify the behavior of a custom field?
- How do you format the set_body option for WP_Rest_Request?
- Get all PDF files from page with WordPress API
- current_user_can(‘administrator’) returns false when I’m logged in
- featured image not found in json from wp rest api
- New user signup via REST API
- is it possible to filter a rest api endpoint by using a registered rest field?
- Ho to style post content for WordPress API?
- rendering view in backbone
- Update a post based on results from GET request to another server
- WP REST API can’t set post tags
- Manipulating/view postmeta remotely
- Check authentication credentials using WP REST API
- Rest API basic auth not working
- WP_REST_Response() doesn’t seem to return the expected object
- Setting ?context=edit results in rest_forbidden_context, even for an Administrator user
- Rest API: wp_verify_nonce() fails despite receiving correct nonce value
- Update user meta via REST API?
- WP Rest Api- Update callback (POST request) to existing database table through the rest api
- Save default options as an array of options and display in REST API
- Get a term object using getEntityRecords
- WordPress REST Api get posts by ID
- Backbone with custom rest endpoints
- rest Api jwt authentication for get methodes
- [Zapier + WP Webhooks Pro]: Custom Fields get cut off at first comma or semicolon
- Which route in the WP REST API do I access data passed into register_setting()?
- How to use Python to create a Post in WordPress?
- Send a get request to wordpress
- Best Authetication between REST API and Mobile App
- Replace content via rest api only?
- WP rest api endpoint protection using jwt token
- WP Rest API – Change response status code for failed validation request
- Unable to create a Rest end-point
- Log in user using WordPress REST API
- Can i fetch the list of pouplar posts of last 24 hours from WordPress API?
- IIS Authorization Rules breaks WP REST-API and results in fail in Site Health
- How to delete all instances of the image using REST API
- Performance of WordPress Rest API vs WordPress Feeds
- WordPress Rest Api rest_cannot_edit
- WordPress REST API in Integromat: How to overcome “Sorry, you are not allowed to list users / edit this…”
- how to create JSON array [] for REST response?
- Getting 401 unauthenticated error in WP Rest API revisions
- How to receive JSON payload from a digital device
- WordPress Custom Rest Api – How to get Image Url?
- Remote publishing using WP’s RetAPI // Issues with HTACCESS
- save_post hook error with REST API
- Connecting WordPress with an External API
- rest api add post meta
- Users REST API not working?
- Using WordPress solely as a Backend – dealing with WP_SITEURL
- phpmailer_init ignored on REST calls
- use WordPress Rest API to build a web application
- REST Request Post including meta/custom fields
- Display Post Featured Image along with Categories via WP Rest API
- Register rest field authentication with REST API
- Why wp_set_password not working within a api endpoint?
- WordPress api returns distinct data
- Redefine REST API variables
- Where is the HTML content for my post in the API
- WordPress Rest API Escapes Returned URLs Forward Slash
- Update post / page using API + python
- Calling a Rest API with parameters on button Click
- WordPress json – How to use the content rendered from json
- Subscriber role cann’t add comment meta using REST API
- WordPress REST API function not calling from external site
- Issue with API after 6.2 update
- Verify user login and password over api
- All wp-json routes suddenly return 404
- Get rendered HTML single view from post template
- Modify request payload for Core API requests
- WordPress Rest Api search limited to 10 results
- Using backbone, can I prevent the nonce from being set?
- Preview endpoint REST API gives 403 error
- trying to send request-body to rest_api custom csp-endpoint