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 CSSCSS Cascading Style Sheets. 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 coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress.’s jquery-masonry in your theme or pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the Plugin Directory or can be cost-based plugin from a third-party, 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