Skip to content

Instantly share code, notes, and snippets.

@stephanie-walter
Created February 22, 2013 15:31
Show Gist options
  • Save stephanie-walter/5014232 to your computer and use it in GitHub Desktop.
Save stephanie-walter/5014232 to your computer and use it in GitHub Desktop.
WordPress Branch embed - WordPress short code to embed
// Adds [branch id=""] shortcode in WordPress
if ( !function_exists('branch_embedded')) {
function branch_embedded($atts) {
$atts = shortcode_atts(array('id' => ''), $atts);
$output = '<script type="text/javascript" src="http://embed-script.branch.com/assets/embed/embed.m.js?body=0" data-branch-embedid="' . esc_attr($atts['id']) . '" ></script>';
return $output ;
}
add_shortcode('branch', 'branch_embedded');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment