gist

The Jetpack by WordPress.com gist shortcode.


Usage

  1. // basic usage 
  2. echo do_shortcode('[gist]'); 
  1. // variable usage 
  2. $result = do_shortcode('[gist]'); 
  3. echo $result;  

Defined (1)

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

/modules/shortcodes/gist.php  
  1. /* returns raw HTML (no styling) and the first little bit of the code. 
  2. * Their Javascript-based embed method is a lot better, so that's what we're using. 
  3. */ 
  4. wp_embed_register_handler( 'github-gist', '#https?://gist\.github\.com/([a-zA-Z0-9]+)#', 'github_gist_embed_handler' ); 
  5. add_shortcode( 'gist', 'github_gist_shortcode' ); 
  6.  
  7. function github_gist_embed_handler( $matches, $attr, $url, $rawattr ) { 
  8. // Let the shortcode callback do all the work 
  9. return github_gist_shortcode( $attr, $url );