Skip to content

Instantly share code, notes, and snippets.

@richtabor richtabor/frontend-scripts.php Secret
Last active Mar 27, 2019

Embed
What would you like to do?
<?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
You can’t perform that action at this time.