• Resolved adamjgriffith

    (@adamjgriffith)


    Hi,

    I am trying to figure out how to access the current authenticated user in a register_rest_route callback function.

    I’m sure I’m just missing something as this should be regularly used functionality.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • /wp-json/wp/v2/users/me

    Thread Starter adamjgriffith

    (@adamjgriffith)

    Hi Alex,

    Thanks for the reply but this is unfortunately not what I am looking for.

    I need to be able to determine the current user on an api endpoint without sending the user id with the request as this would be insecure.

    It turns out I answered my own question but forgot to report back here.

    $user = apply_filters('determine_current_user', false);

    Hope this helps someone in the future.

    Adam

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Get current user’ is closed to new replies.