jetpack_shortcode_get_archiveorg_book_id

Get ID of requested archive.org book embed.

Description

(int|string) jetpack_shortcode_get_archiveorg_book_id( $atts ); 

Returns (int|string)

Parameters (1)

0. $atts
The atts.

Usage

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

Defined (1)

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

/modules/shortcodes/archiveorg-book.php  
  1. function jetpack_shortcode_get_archiveorg_book_id( $atts ) { 
  2. if ( isset( $atts[0] ) ) { 
  3. $atts[0] = trim( $atts[0] , '=' ); 
  4. if ( preg_match( '#archive.org/stream/(.+)/?$#i', $atts[0], $match ) ) { 
  5. $id = $match[1]; 
  6. } else { 
  7. $id = $atts[0]; 
  8. return $id; 
  9. return 0;