scribd_shortcode_handler

Scribd Short Code Author: Nick Momrik.

Description

scribd_shortcode_handler( $atts ); 

[scribd id=DOCUMENT_ID key=DOCUMENT_KEY mode=MODE] DOCUMENT_ID is an integer (also used as an object_id) DOCUMENT_KEY is an alphanumeric hash ('-' character as well) MODE can be list,, book, slide, slideshow, or tile

[scribd id=39027960 key=key-3kaiwcjqhtipf25m8tw mode=list]

Parameters (1)

0. $atts
The atts.

Usage

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

Defined (1)

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

/modules/shortcodes/scribd.php  
  1. function scribd_shortcode_handler( $atts ) { 
  2. $atts = shortcode_atts( array( 
  3. 'id' => 0,  
  4. 'key' => 0,  
  5. 'mode' => "",  
  6. ), $atts, 'scribd' ); 
  7.  
  8. $modes = array( 'list', 'book', 'slide', 'slideshow', 'tile' ); 
  9.  
  10. $atts['id'] = (int) $atts['id']; 
  11. if ( preg_match( '/^[A-Za-z0-9-]+$/', $atts['key'], $m ) ) { 
  12. $atts['key'] = $m[0]; 
  13.  
  14. if ( !in_array( $atts['mode'], $modes ) ) 
  15. $atts['mode'] = ''; 
  16.  
  17. return scribd_shortcode_markup( $atts ); 
  18. } else { 
  19. return '';