WordPress 5.3: Backbone Upgrade Guide

In WordPress 5.3, the version of Backbone bundled with WordPress will be updated from v1.3.3 to v1.4.0. Developers who override on and off events on their models may run into a few issues if they have listenTo events being applied to them.

Consider the example below:

// Model
class Model extends Backbone.Model {
    initialize() {
        this.collection = new Backbone.Collection()

    on() {
        this.collection.on.apply( this.collection, arguments )

    off() {
        this.collection.off.apply( this.collection, arguments )

// View
class View extends Backbone.View {
    initialize() {
        this.listenTo( this.model, 'event-name', null )

// Create an instance of Model and View
const model = new Model()
new View( { model } )

// Remove callbacks from model

A TypeError will now be thrown at model.off, as when the model’s callbacks are removed, Backbone attempts to remove the set of listeners applied to the model as well. These sets of listeners are no longer on the model, but instead are on the model’s collection.

The reason for this is because Backbone now uses the listened object’s public on method when applying the listenedTo event, and in the example above, the on event will be applied to model.collection. A simple fix to this error is to instead pass model.collection as the object to be listened to.

For a full list of changes in this release, see the Backbone Changelog. For reference on this update, see the Trac ticket #47478.

Props @adamsilverstein and @desrosj for peer review.

#5-3, #dev-notes, #external-libraries

External library updates in 4.6

The following are external libraries that have been updated during the 4.6 release cycle.


Masonry was updated to version 3.3.2 from version 3.1.4 (#32802). Notable changes:

  • jQuery events are now triggered.
  • CommonJS is supported.
  • Percentages can now be used for horizontal positions.
  • Various browser compatibility issues are now resolved.

Full Changelog: https://github.com/desandro/masonry/releases


imagesLoaded was updated to version 3.2.0 from version 3.1.4 (#32802). Notable changes:

  • Background images are now supported.
  • setTimeout no longer triggers multiple events errantly.
  • Internal cache has been removed. Each image will now be checked.
  • Various browser compatibility issues are now resolved.

Full Changelog: https://github.com/desandro/imagesloaded/releases

NOTE: imagesLoaded and Masonry are now in separate files. This means that imagesLoaded can be enqueued without Masonry being enqueued. For backward compatibility reasons, imagesLoaded remains a dependency for Masonry.


MediaElement.js was updated to version 2.22.0 from version 2.18.1 (#36759, #37363). Notable changes:

  • Several YouTube embed issues have been resolved.
  • More Vimeo API support added.
  • A few a11y and i18n issues have been fixed.
  • General stability enhancements.

Full Changelog: https://github.com/johndyer/mediaelement/blob/2.22.0/changelog.md


TinyMCE was updated to version 4.4.1 from version 4.3.10 (#37225, #37327, #37476). Notable changes:

  • Various contentEditable bugs fixed.
  • Various browser compatibility bugs fixed.
  • General stability and performance enhancements.

Full Changelog: https://github.com/tinymce/tinymce/blob/4.4.1/changelog.txt


Backbone.js was updated to version 1.3.3 from 1.2.3 (#37099). Notable changes:

  • 4 major regressions were fixed.
  • Added findIndex and findLastIndex Underscore methods to Collection.
  • Added options.changes to Collection “update” event which includes added, merged, and removed models.
  • Removed component package support.

Full Changelog: https://cdn.rawgit.com/jashkenas/backbone/1.3.3/index.html#changelog

#4-6, #dev-notes, #external-libraries

jQuery UI datepicker localization in 4.6

In WordPress 4.6 (#29420) localization defaults were added for the jQuery UI datepicker based on the current locale using the new wp_add_inline_script() function. With 4.6 you can enqueue the datepicker and you are set. It works out of the box.

Instead of using the language files from the jQuery UI project the necessary information, mainly from the WP_Locale class, is directly passed to the datepicker. The list of localized information: closeText, currentText, monthNames, monthNamesShort, nextText, prevText, dayNames, dayNamesShort, dayNamesMin, dateFormat, firstDay, and isRTL.

If you are using the files from jQuery UI in your theme or plugin, please be aware of this change. With 4.6 you can omit calling these files and enqueue the default datepicker which will use the built-in defaults from WordPress.

If you want to change the defaults or add custom settings, you can still use all the arguments from the datepicker. WordPress only sets sane defaults for the chosen locale. But you should check if jQuery UI datepicker is enqueued and you should check if the browser is showing a native datepicker (like Chrome).

@ipstenu has scanned the plugin repo for plugins including the jQuery UI files. The following plugins can be changed to use WordPress’ own translations.

Advanced Booking Calendar, Albo Pretorio On line, Altos Toolbar, AWPCP – Classifieds Plugin, Appointment Calendar, Banner Garden Plugin for WordPress, BBS e-Popup, Beaverlodge Maintenance, Beaverlodge Menu Styler, BigContact Contact Page, Blog Post Calendar Widget, Booking Calendar Contact Form, Events Calendar, Class Booking, Contact Form 7 IE DatePicker and Number Spinner Fix, Custom fields, Datepicker i18n, Easy Calendar, EEXCESS, Event Post Type, Events Made Easy, Events Manager, Social Marketing Scheduler, FormCraft – Form Builder, Date Picker in List Fields for Gravity Forms, Gravity Forms (Spanish), Gravity Forms (nl), inquiry form creator, Jet Event System for BuddyPress, JQuery Accessible Accordion, JQuery Accessible Autocomplete, JQuery Accessible Button, JQuery Accessible Carousel, JQuery Accessible Checkbox, JQuery Accessible Datepicker, JQuery Accessible Dialog, JQuery Accessible Menu, JQuery Accessible Progressbar, JQuery Accessible Slider, JQuery Accessible Tabs, JQuery Accessible Tooltip, JQuery Accessible Tree, Js-appointment, LearnPress – WordPress LMS Plugin, LePress, List Urls, Livemesh SiteOrigin Widgets, Lodgix.com Vacation Rental Listing, Management & Booking Plugin, MailChimp List Subscribe Form, Social Media Share Buttons | MashShare, Member Register, Membership 2, Meta Collections, mind-body, Tribulant Newsletters, Orbis, Order Delivery Date for WooCommerce, OpenWebAnalytics, Pay2Post, PDF Catalog, Pronamic Events, RPB Calendar, Vinum Master Tracking Plugin, Simple Ads Manager, Simple Photos Contest, Sk Multi Tag, Solidres – Hotel booking plugin for WordPress, Cubilis Fastbooker, Surbma – Datepicker localization for Gravity Forms, teachPress, TemplatesNext ToolKit, TheNextTable, Toolset Types, Uiform – Cost Estimation & Payment Form Builder, Uiform – Form Builder, Vacation Rentals, Video Central for WordPress, Visual Form Builder, Webagency Widget – Website builder, WEeventscalendar, WooCommerce Checkout Manager, WooCommerce Quick Donation, WP Agenda, WP-AMD – Global JS and CSS handling, WP Any Form, WP Contact Slider, wp-creator-calculator, WP-CRM – Customer Relations Management for WordPress, WP FEvents Book, wp-greet, WP-Invoice – Web Invoice and Billing, WP Maintenance, WP Online Store, WP-Property – WordPress Powered Real Estate and Property Management, Wp-Recall, WP Scripts Updater, WP Swiper, wpShopGermany Free, and XO Event Calendar.

#4-6, #dev-notes, #external-libraries, #i18n

jQuery Updates in WordPress 4.5

jQuery was updated from version 1.11.3 to 1.12.2, see [36285], [36680], and [37070].
At the same time jQuery Migrate – the plugin to detect and restore APIs or features that have been deprecated in jQuery – was updated from 1.2.1 to 1.4.0 ([36285] and [37072]).

The non-minified version of jQuery Migrate throws a few more warnings now. See some examples from core in [36286-36288].

🔬 Please test your plugins and themes with the non-minified version to make them compatible with future versions of jQuery.

Ticket: #35380

#4-5, #dev-notes, #external-libraries

jQuery UI and wpdialogs in WordPress 3.9

WordPress 3.9 does not use the “wpdialogs” TinyMCE plugin as part of the TinyMCE 4.0 update ( #16284, #24067), which comes with a new dialog manager. (For more, see this post and their migration guide.) This was a jQuery UI wrapper we had introduced back in WP 3.1. If you were using this in your own scripts, please be sure you are setting “wpdialogs” as a script dependency.

If you were using jQuery UI for anything on the post screen, please be sure you are setting this as a script dependency.

In both cases you may need to enqueue the “wp-jquery-ui-dialog” stylesheet, if you are using the WP UI dialog design.

#3-9, #dev-notes, #editor, #external-libraries