Unyson
Unyson copied to clipboard
How to enqueue script / style from shortcode static file based on shortcode parameter?
Hello!
Is it possible to enqueue script or style from shortcode static file based on shortcode parameter? I mean something like this:
if( $atts['shortcode_param'] == 'foo') {
wp_enqueue_style( 'style-foo');
} elseif( $atts['shortcode_param'] == 'bar' ) {
wp_enqueue_style( 'style-bar');
}
thanks for advice :)
http://manual.unyson.io/en/latest/extension/shortcodes/index.html#enqueue-shortcode-dynamic-css-in-page-head