wpcom_shortcodereverse_lytro

Lytro Shortcode Reversal.

Description

wpcom_shortcodereverse_lytro( $atts ); 

Example

Converts to: [lytro photo="202" show_border="true" width="400" height="415"]

Parameters (1)

0. $atts
The atts.

Usage

  1. if ( !function_exists( 'wpcom_shortcodereverse_lytro' ) ) { 
  2. require_once '/modules/shortcodes/lytro.php'; 
  3.  
  4. // The atts. 
  5. $atts = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wpcom_shortcodereverse_lytro($atts); 
  9.  

Defined (1)

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

/modules/shortcodes/lytro.php  
  1. function wpcom_shortcodereverse_lytro( $atts ) { 
  2. $atts = wpcom_shortcodereverse_parseattr( $atts ); 
  3. $shortcode_atts = array(); 
  4.  
  5. // Grab the src URL and convert to shortcode attributes 
  6. if ( $atts['src'] ) { 
  7. $shortcode_atts = jetpack_lytro_shortcode_url_to_atts( $atts['src'] ); 
  8.  
  9. // Width and height too 
  10. if ( $atts['width'] ) { 
  11. $shortcode_atts['width'] = $atts['width']; 
  12. if ( $atts['height'] ) { 
  13. $shortcode_atts['height'] = $atts['height']; 
  14.  
  15. // Generate the shortcode. 
  16. $shortcode = ''; 
  17. foreach ( $shortcode_atts as $key => $value ) { 
  18. $shortcode .= " $key='" . esc_attr( $value ) . "'"; 
  19. $shortcode = "[lytro {$shortcode}]"; 
  20.  
  21. return $shortcode;