jetpack_embed_medium_get_embed_type

The Jetpack by WordPress.com jetpack embed medium get type function.

Description

jetpack_embed_medium_get_embed_type( $url ); 

Parameters (1)

0. $url
The url.

Usage

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

Defined (1)

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

/modules/shortcodes/medium.php  
  1. function jetpack_embed_medium_get_embed_type( $url ) { 
  2. $url_path = parse_url( $url, PHP_URL_PATH ); 
  3. if ( 0 === strpos( $url_path, '/@' ) ) { 
  4. return 'profile'; 
  5. } elseif ( preg_match( '#^/[^/]+/[^/]+$#', $url_path ) ) { 
  6. return 'story'; 
  7. return 'collection';