Masonry in WordPress 3.9

If you use Masonry in your themes or plugins, here’s what you should know about the 3.9 update.

In WordPress 3.9 we’ve updated Masonry to v3, which no longer requires jQuery. The new script handle is masonry. Some of you have been using that very same handle with your own bundled copies of jQuery Masonry v2, this has potential to break in fairly rare cases:

  • You’re using Masonry v2 options or methods that are deprecated in v3
  • You’re dumping your Masonry init code inside the bundled library itself
  • You’re using v2 class names in CSS such as .masonry-brick and .masonry
  • You’re relying on a declared jquery dependency for masonry, even if you bundled v3

The older jquery-masonry handle is now the official v2/v3 shim, which provides (some) backwards compatible options, methods and classes. If you were using core’s jquery-masonry in your theme or plugin, you should be fine. It’s also the handle you’ll want to use to be compatible with both 3.8 and 3.9+. A short Masonry v2 to v3 upgrade guide could be found here.

Whatever you’re doing with Masonry in WordPress, we urge you to test your themes and plugins now. Get the latest beta and head over to #27510 to let us know if you’ve stumbled across any compatibility issues.

#3-9, #dev-notes, #themes