<?php | |
blockgallery_frontend_scripts() { | |
if ( has_block( 'blockgallery/masonry' ) ) { | |
wp_enqueue_script( | |
'blockgallery-masonry', | |
plugins_url( 'dist/blockgallery-masonry.js', __FILE__ ), | |
array( 'jquery', 'masonry', 'imagesloaded' ), | |
filemtime( plugin_dir_path( __FILE__ ) . 'dist/blockgallery-masonry.js' ) | |
); | |
} | |
} | |
add_action( 'wp_enqueue_scripts', 'blockgallery_frontend_scripts' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment