Uncaught Error after adding my custom API to wp_rest_cache/allowed_endpoints
-
I am following steps from here:
“Can I register my own endpoint for caching?”When I add_filter for “wp_rest_cache/allowed_endpoints”, it causes my api endpoint to raise exception:
PHP Fatal error: Uncaught Error: Call to undefined function is_user_logged_in() in /var/www/html/wp-includes/rest-api.php:591
This happens only on cache HIT. When cache is cleaned, next first call to my endpoint is successful, after that all calls end up with 500 and the exception.
Please suggest solution or fix if it is bug.
Thank you
Jan
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Uncaught Error after adding my custom API to wp_rest_cache/allowed_endpoints’ is closed to new replies.