Created
December 3, 2019 14:50
-
-
Save timersys/41d4d07a0ee184acaabe11ad862a6e75 to your computer and use it in GitHub Desktop.
custom shortcode to insert javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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