Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
custom shortcode to insert javascript
// insert javascript into WordPress posts or popups
// use shortcode [wpp_insert]
add_shortcode( 'wpp_insert', 'wpp_insert_code' );
function wpp_insert_code() {
ob_start();
?>
<!-- paste your html and javascript here -->
<?php
$html = ob_get_clean();
return $html;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment