Function: setup_userdata

setup_userdata( integer $for_user_id )

Set up global user vars.

Used by wp_set_current_user() for back compat. Might be deprecated in the future.

Parameters

Name Type(s) Default Value Description
$for_user_id integer ''

Optional. User ID to set up global data.

WordPress Developer Newsletter

Stay on top of the latest WordPress API changes, developer tool updates, security alerts and more.