authorize

authorize (WP_User|null|WP_Error $wpUser) : WP_User|WP_Error $return

This is a global filter to introduce an authorization workflow for WordPress.

Description

Execute an authorization check after a user has been authenticated

Return value

WP_User|WP_Error $return

If the authorization fails, you should return an WP_Error object, otherwise the previously authenticated WP_User object.

Parameters

WP_User|null|WP_Error $wpUser

The previously authenticated user (= instance of WP_User), an error or null. You are responsible to check if the parameter is an authenticated user or not.