sharing_register_post_for_share_counts

The Jetpack by WordPress.com sharing register post for share counts function.

Description

sharing_register_post_for_share_counts( $post_id ); 

Parameters (1)

0. $post_id
The post id.

Usage

  1. if ( !function_exists( 'sharing_register_post_for_share_counts' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/sharedaddy/sharing-service.php'; 
  3.  
  4. // The post id. 
  5. $post_id = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = sharing_register_post_for_share_counts($post_id); 
  9.  

Defined (1)

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

/modules/sharedaddy/sharing-service.php  
  1. function sharing_register_post_for_share_counts( $post_id ) { 
  2. global $jetpack_sharing_counts; 
  3.  
  4. if ( ! isset( $jetpack_sharing_counts ) || ! is_array( $jetpack_sharing_counts ) ) 
  5. $jetpack_sharing_counts = array(); 
  6.  
  7. $jetpack_sharing_counts[ (int) $post_id ] = get_permalink( $post_id );