allow skip catching for wp-admin referer, or by filter
-
Hi,
would like to skip the catching for all requests from wp-admin.
Currently I added some lines to
Endpoint_Api::skip_caching
:if ( substr( $_SERVER['HTTP_REFERER'], 0, strlen( admin_url() )) === admin_url() ) { return true; }
Would be nice to have a filter there, so I could write an mu-plugin and hook my custom skip function. Some filter like this:
if ( apply_filters( 'wp_rest_cache/skip_caching', false ) ) { return true; }
To skip all requests from wp-admin referer solves/skips all gutenberg issues.
Adding an option to the plugin settings page would be great. Think that might help some users.Some background: I got this issue using wpml. It always shows the cached custom taxonomies and terms in the editor inspector, that leads into weird language syncing issues.
Example: gutenberg wants to list our custom taxonomy terms forprefix_region
and calls/wp-json/wp/v2/prefix_region?per_page=100&orderby=name&order=asc&_fields=id%2Cname%2Cparent&_locale=user
. The request url is same for all languages.And thanks for your plugin! its great. and the code is nice to read, lovely poetry
- The topic ‘allow skip catching for wp-admin referer, or by filter’ is closed to new replies.