Access to logged in user, in REST filters
-
I’m trying to put a short bit of code in functions.php to filter REST calls based on both the route and the logged in user. When I filter ‘rest_authentication_errors’ I can use wp_get_current_user(), but I don’t know how to get the route there. In other filters such as ‘rest_pre_dispatch’ I can get the route from $request, but I (apparently) can’t use wp_get_current_user(). Is there any way I can see the logged in user in the other REST filters? Maybe I need to include something?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Access to logged in user, in REST filters’ is closed to new replies.