Skip to content

Instantly share code, notes, and snippets.

@saurini
saurini / shortcodes.php
Created September 19, 2012 09:37
Github for WordPress
<?php
// Inserts an embedded gist into the content usage [gist id="12345"]
function saurini_gist_func( $atts ){
extract(shortcode_atts(array(
'id' => '1337'), $atts));
// Only allow gist ids that are letters or numbers
if ( preg_match( '/[^0-9^a-z^A-Z]/', $id ) )
return;