sharing_add_meta_box

The Jetpack by WordPress.com sharing add meta box function.

Description

sharing_add_meta_box(); 

Usage

  1. if ( !function_exists( 'sharing_add_meta_box' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/sharedaddy/sharedaddy.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = sharing_add_meta_box(); 
  7.  

Defined (1)

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

/modules/sharedaddy/sharedaddy.php  
  1. function sharing_add_meta_box() { 
  2. global $post; 
  3. if ( empty( $post ) ) { // If a current post is not defined, such as when editing a comment. 
  4. return; 
  5.  
  6. /** 
  7. * Filter whether to display the Sharing Meta Box or not. 
  8. * @module sharedaddy 
  9. * @since 3.8.0 
  10. * @param bool true Display Sharing Meta Box. 
  11. * @param $post Post. 
  12. */ 
  13. if ( ! apply_filters( 'sharing_meta_box_show', true, $post ) ) { 
  14. return; 
  15.  
  16. $post_types = get_post_types( array( 'public' => true ) ); 
  17. /** 
  18. * Filter the Sharing Meta Box title. 
  19. * @module sharedaddy 
  20. * @since 2.2.0 
  21. * @param string $var Sharing Meta Box title. Default is "Sharing". 
  22. */ 
  23. $title = apply_filters( 'sharing_meta_box_title', __( 'Sharing', jetpack ) ); 
  24. if ( $post->ID !== get_option( 'page_for_posts' ) ) { 
  25. foreach( $post_types as $post_type ) { 
  26. add_meta_box( 'sharing_meta', $title, 'sharing_meta_box_content', $post_type, 'advanced', 'high' );