Patreon WordPress Action Hooks
This document lists all the action hooks that are present in Patreon WordPress

patreon_action_after_wp_logged_user_is_updated


This action runs inside the function createOrLogInUserFromPatreon in patreon_login.php after a user who was logged into WordPress goes through login action at Patreon. This hook only runs for users who were logged into the WordPress site before logging in via Patreon too. During that process, the existing WordPress user account of the user will be linked with his/her Patreon account. 

Provides, in order:

array: An associated array that provides the variables that exist after user login with below vars:

user: WP user object of the user

redirect: The final redirect the user is to be sent to after logging in

user_response: The response from Patreon API for this user’s Patreon details

tokens: The access and refresh tokens acquired from Patreon API during logging in of this user


patreon_do_action_after_user_logged_in_via_patreon


This action runs inside the function createOrLogInUserFromPatreon in patreon_login.php after login of a user who already has an account with the WP site which was previously linked with Patreon. In this case, user would not be already having logged into the WordPress site. The function identifies the user by his/her Patreon account, which would be linked to a WP account already, and then using this linkage, logs the user into the WP account. 

Provides, in order:

array: An associated array that provides the variables that exist after user login with below vars:

user: WP user object of the user

redirect: The final redirect the user is to be sent to after logging in

user_response: The response from Patreon API for this user’s Patreon details

tokens: The access and refresh tokens acquired from Patreon API during logging in of this user

patreon_do_action_after_new_user_created_from_patreon_logged_in


This action runs inside the function createOrLogInUserFromPatreon in patreon_login.php after a user who did not have an existing WP account linked with his/her Patreon account, logs in for the first time. This causes a new WP account being created for the user, and linked to his/her Patreon account. This user-creation will happen if the plugin cannot find a linked WP account linked to the Patreon account of the user, even if the user has a separate, unrelated and unlinked WP account.

Provides, in order:

array: An associated array that provides the variables that exist after user login with below vars:

user: WP user object of the user, which was newly created

redirect: The final redirect the user is to be sent to after logging in

user_response: The response from Patreon API for this user’s Patreon details

tokens: The access and refresh tokens acquired from Patreon API during logging in of this user