jetpack_register_post_for_share_counts

Allow plugins to disable sharing counts for specific sharing services.

Description

apply_filters( 'jetpack_register_post_for_share_counts', (bool) $true, (int) $post_id, (string) $twitter ); 

Parameters (3)

0. $true (bool)
True Should sharing counts be enabled for this specific service. Default to true.
1. $post_id (int)
The post id.
2. $twitter (string) => 'twitter'
Sharing service name.

Usage

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

Defined (4)

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

/modules/sharedaddy/sharing-sources.php  
  1. apply_filters( 'jetpack_register_post_for_share_counts', true, $post->ID, 'twitter' ) 
  1. if ( apply_filters( 'jetpack_register_post_for_share_counts', true, $post->ID, 'linkedin' ) ) { 
  1. if ( apply_filters( 'jetpack_register_post_for_share_counts', true, $post->ID, 'facebook' ) ) { 
  1. if ( apply_filters( 'jetpack_register_post_for_share_counts', true, $post->ID, 'linkedin' ) ) {