Correct filter hook to modify the output of a custom taxonomy API call?

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.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)