jetpack_sync_remote_action
Fires when an action is received from a remote Jetpack site.
Description
do_action( 'jetpack_sync_remote_action', (string) $action_name, (array) $args, (int) $user_id, (bool) $silent, (double) $timestamp, (double) $sent_timestamp, (string) $queue_id, (array) $token );
Parameters (8)
- 0. $action_name (string)
- The name of the action executed on the remote site
- 1. $args (array)
- The arguments passed to the action
- 2. $user_id (int)
- The external_user_id who did the action
- 3. $silent (bool)
- Whether the item was created via import
- 4. $timestamp (double)
- Timestamp (in seconds) when the action occurred
- 5. $sent_timestamp (double)
- Timestamp (in seconds) when the action was transmitted
- 6. $queue_id (string)
- ID of the queue from which the event was sent (sync or full_sync)
- 7. $token (array)
- The auth token used to invoke the API
Usage
- To run the hook, copy the example below.
- // run the action
- do_action( 'jetpack_sync_remote_action', $action_name, $args, $user_id, $silent, $timestamp, $sent_timestamp, $queue_id, $token );
- The following example is for adding a hook callback.
- // define the jetpack_sync_remote_action callback
- function action_jetpack_sync_remote_action( $action_name, $args, $user_id, $silent, $timestamp, $sent_timestamp, $queue_id, $token ) {
- // make action magic happen here...
- };
- // add the action
- add_action( 'jetpack_sync_remote_action', 'action_jetpack_sync_remote_action', 10, 8 );
- To remove a hook callback, use the example below.
- // remove the action
- remove_action( 'jetpack_sync_remote_action', 'action_jetpack_sync_remote_action', 10, 8 );
Defined (1)
The action is defined in the following location(s).
- /sync/class.jetpack-sync-server.php
- do_action( 'jetpack_sync_remote_action', $action_name, $args, $user_id, $silent, $timestamp, $sent_timestamp, $queue_id, $token );