Don't initialize scripts if wc is not active

This commit is contained in:
claudiulodro 2018-08-22 10:28:39 -07:00
parent 0e07f05d30
commit ce6938548e
1 changed files with 4 additions and 0 deletions

View File

@ -43,6 +43,10 @@ function wgpb_register_products_block() {
* Register extra scripts needed.
*/
function wgpb_extra_gutenberg_scripts() {
if ( ! function_exists( 'wc_get_theme_support' ) ) {
return;
}
wp_enqueue_script(
'react-transition-group',
plugins_url( 'assets/js/vendor/react-transition-group.js', __FILE__ ),