1. Home
  2. For Devs
  3. Action
  4. Create do_action On Update and Create Of A User
  1. Home
  2. Plugins
  3. WP Webhooks
  4. For Devs
  5. Action
  6. Create do_action On Update and Create Of A User

Create do_action On Update and Create Of A User

{$do_action}

Description:
This action allows you to dynamically create a callback function after your specified webhook created, deleted or updated a user. This gets useful if you want to fire custom WordPress events after your specified webhook fires for the mentioned webhooks.

To make it work, please define within your webhook call the “do_action” argument. After that’s done, you can use the defined slug as the webhook action.
For example: Let’s set do_action to my_custom_action
This is what you can call within your code to catch the call:

add_action( 'my_custom_action', 'my_custom_action_callback', 10, 3 );
Parameter Type Description
$do_action string The name of the action that should be created
$user_data array An array of all the available user data
$user_id int The id of the new/updated user
$user_meta string The usermeta in the predefined format (We send it in the raw format in case you use special chars or a custom logic.)

	/**
	 * Create an action based on your needs via your specified webhook for creating, deleting and updating a user
	 */
	do_action( $do_action, $user_data, $user_id, $user_meta );

Updated on August 10, 2019

Was this article helpful?

Related Articles