Created
October 23, 2016 01:25
-
-
Save vladimirlukyanov/1f3c7a29b02be7792f4d4f13947beb65 to your computer and use it in GitHub Desktop.
Shortcode style enqueue #1
This file contains hidden or 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
<?php | |
class My_Shortcode { | |
function handle_shortcode( $atts, $content="" ) { | |
/* simply enqueue or print the scripts/styles in the shortcode itself */ | |
?> | |
<style type="text/css"> | |
</style> | |
<?php | |
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