[theme-reviewers] Upgrading Masonry In Core

Otto otto at ottodestruct.com
Sun Nov 24 13:50:17 UTC 2013


"So when you enqueue jquery-masonry". Weird typo, that.

-Otto


On Sun, Nov 24, 2013 at 7:49 AM, Otto <otto at ottodestruct.com> wrote:

> On Sun, Nov 24, 2013 at 12:05 AM, Josh Pollock <jpollock412 at gmail.com>wrote:
>
>> A fun development:
>> https://github.com/desandro/masonry/issues/446
>> David DeSandro wrote a backwards compatibility shim:)
>>
>> I'm not sure what to do with it as I'm no javascript expert. If anyone
>> can give me advice or redo my patch to use this, I'd appreciate.
>>
>
>
> Try doing something like this in the /wp-includes/script-loader.php,
> replacing the masonry line there:
>
> $scripts->add( 'jquery-masonry3,
> "/wp-includes/js/jquery/jquery.masonry.min.js", array('jquery'), '3.1.2', 1
> );
> $scripts->add( 'jquery-masonry,
> "/wp-includes/js/jquery/masonry-v2-shim.js", array('jquery-masonry3'),
> '1.0', 1 );
>
> Basically, this makes the "jquery-masonry" script into shim instead, with
> a dependency on the masonry-3 code (which you'll need to have there as
> well). So when you enquery-masonry, then it enqueues jquery, followed by
> jquery.masonry.min.js, followed by the shim code.
>
> You'll know it works if the masonry 2 code in a theme continues to work
> with no changes.
>
> -Otto
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20131124/bb557d40/attachment.html>


More information about the theme-reviewers mailing list