Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Shortcode style enqueue #1
class My_Shortcode {
function handle_shortcode( $atts, $content="" ) {
/* simply enqueue or print the scripts/styles in the shortcode itself */
<style type="text/css">
return "$content";
add_shortcode( 'myshortcode', array( 'My_Shortcode', 'handle_shortcode' ) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment