enhanced_og_image

Better OG Image Tags for Image Post Formats.

Description

enhanced_og_image( $tags ); 

Parameters (1)

0. $tags
The tags.

Usage

  1. if ( !function_exists( 'enhanced_og_image' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/publicize/enhanced-open-graph.php'; 
  3.  
  4. // The tags. 
  5. $tags = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = enhanced_og_image($tags); 
  9.  

Defined (1)

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

/modules/publicize/enhanced-open-graph.php  
  1. function enhanced_og_image( $tags ) { 
  2. if ( !is_singular() || post_password_required() ) 
  3. return $tags; 
  4.  
  5. global $post; 
  6.  
  7. // Always favor featured images. 
  8. if ( enhanced_og_has_featured_image( $post->ID ) ) 
  9. return $tags; 
  10.  
  11. $summary = Jetpack_Media_Summary::get( $post->ID ); 
  12.  
  13. if ( 'image' != $summary['type'] ) 
  14. return $tags; 
  15.  
  16. $tags['og:image'] = $summary['image']; 
  17. $tags['og:image:secure_url'] = $summary['secure']['image']; 
  18.  
  19. return $tags;