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.
  1. // run the action 
  2. 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.
  1. // define the jetpack_sync_remote_action callback 
  2. function action_jetpack_sync_remote_action( $action_name, $args, $user_id, $silent, $timestamp, $sent_timestamp, $queue_id, $token ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( 'jetpack_sync_remote_action', 'action_jetpack_sync_remote_action', 10, 8 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. 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  
  1. do_action( 'jetpack_sync_remote_action', $action_name, $args, $user_id, $silent, $timestamp, $sent_timestamp, $queue_id, $token );