jetpack_sharing_twitter_related

Filter the list of related Twitter accounts added to the Twitter sharing button.

Description

apply_filters( 'jetpack_sharing_twitter_related', (array) $array, (int) $post_id ); 

Parameters (2)

0. $array — Optional. (array) => array()
Array of Twitter usernames. Format is username => Optional description
1. $post_id (int)
The post id.

Usage

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

Defined (1)

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

/modules/sharedaddy/sharing-sources.php  
  1. $related_accounts = apply_filters( 'jetpack_sharing_twitter_related', array(), $post->ID );