jetpack_sync_before_send

Modify the data within an action before it is serialized and sent to the server For example, during full sync this expands Post ID's into full Post objects, so that we don't have to serialize the whole object into the queue.

Description

apply_filters( 'jetpack_sync_before_send', (array) $item_1, (int) $item_2 ); 

Parameters (2)

0. $item_1 (array)
The action parameters
1. $item_2 (int)
The ID of the user who triggered the action

Usage

To run the hook, copy the example below.
  1. $item_1 = apply_filters( 'jetpack_sync_before_send', $item_1, $item_2 ); 
  2.  
  3. if ( !empty( $item_1 ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the jetpack_sync_before_send callback 
  2. function filter_jetpack_sync_before_send( $item_1, $item_2 ) { 
  3. // make filter magic happen here... 
  4. return $item_1
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'jetpack_sync_before_send', 'filter_jetpack_sync_before_send', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'jetpack_sync_before_send', 'filter_jetpack_sync_before_send', 10, 2 ); 

Defined (1)

The filter is defined in the following location(s).

/sync/class.jetpack-sync-sender.php  
  1. $item[1] = apply_filters( 'jetpack_sync_before_send_' . $item[0], $item[1], $item[2] );