Skip to content

Instantly share code, notes, and snippets.

@stephenharris stephenharris/init-masonry.js Secret
Created Aug 15, 2016

What would you like to do?
37666 - masonry shim bug
jQuery(document).ready(function ($) {
var $container = $('.grid');
isAnimated: true,//this option is causing the error
* Plugin demonstrating bug with Masonry v2 shim
* @see
function register_scripts(){
wp_register_script( 'init-masonry', plugin_dir_url( __FILE__ )."init-masonry.js", array( 'jquery', 'jquery-masonry' ) );
add_action( 'init', 'register_scripts' );
function insert_grid( $atts = array() ){
wp_enqueue_script( 'init-masonry' );
return '<div class="grid">
<div class="grid-item">...</div>
<div class="grid-item">...</div>
<div class="grid-item">...</div>
add_filter( 'the_content', 'insert_grid' );
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.