Thanks for writing this great plugin. Unfortunately, I cannot use it since my site is multilingual.
]]>has_shortcode( $post->post_content, 'review_slider')
only checks in the post for shortcodes and does not detect shortcodes in widgets or do_shortcode('')
.
Hence, this is preventing the loading of the scripts in those cases:
function review_slider_enqueue_scripts(){
global $post;
if( !is_a( $post, 'WP_Post' ) || !has_shortcode( $post->post_content, 'review_slider') )
return;
//enqueue styles and scripts ...
}
add_action( 'wp_enqueue_scripts', 'review_slider_enqueue_scripts');
Not sure how to exactly access the widget content cause I can’t see it in $wp_registered_widgets
.