jetpack_facebook_shortcode_handler

The Jetpack by WordPress.com jetpack facebook shortcode handler function.

Description

jetpack_facebook_shortcode_handler( $atts ); 

Parameters (1)

0. $atts
The atts.

Usage

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

Defined (1)

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

/modules/shortcodes/facebook.php  
  1. function jetpack_facebook_shortcode_handler( $atts ) { 
  2. global $wp_embed; 
  3.  
  4. if ( empty( $atts['url'] ) ) 
  5. return; 
  6.  
  7. if ( ! preg_match( JETPACK_FACEBOOK_EMBED_REGEX, $atts['url'] ) 
  8. && ! preg_match( JETPACK_FACEBOOK_PHOTO_EMBED_REGEX, $atts['url'] ) 
  9. && ! preg_match( JETPACK_FACEBOOK_VIDEO_EMBED_REGEX, $atts['url'] ) 
  10. && ! preg_match( JETPACK_FACEBOOK_VIDEO_ALTERNATE_EMBED_REGEX, $atts['url'] ) ) { 
  11. return; 
  12.  
  13. return $wp_embed->shortcode( $atts, $atts['url'] );