WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Version 4.9

On November 15, 2017, WordPress Version 4.9, named for jazz musician Billy Tipton, was released to the public. WordPress 4.9 will smooth your design workflow and keep you safe from coding errors. For more information on this enhancement and bug-fix release, read the WordPress Blog, and see the Changelog for 4.9.

For Version 4.9, the database version (db_version in wp_options) remained at 38590, and the Trac revision was 42195.

Highlights

Welcome to an improved Customizer workflow with design drafts, locking, scheduling, and preview links. What’s more, code syntax highlighting and error checking will make for a clean and smooth site building experience. Finally, if all that wasn’t pretty great, we’ve got a great new Gallery widget and improvements to theme browsing and switching.

Customizer Workflow Improved

Draft and Schedule Site Design Customizations
Yes, you read that right. Just like you can draft and revise posts and schedule them to go live on the date and time you choose, you can now tinker with your site’s design and schedule those design changes to go live as you please.

Customizer Schdule function

Collaborate with Design Preview Links
Need to get some feedback on proposed site design changes? WordPress 4.9 gives you a preview link you can send to your team and customers so that you can collect and integrate feedback before you schedule the changes to go live. Can we say collaboration++?
Design Locking To Guard Your Changes
Ever encounter a scenario where two designers walk into a project and designer A overrides designer B’s beautiful changes? WordPress 4.9’s design lock feature (similar to post locking) secures your draft design so that no one can make changes to it or erase all your hard work.
A Prompt to Protect Your Work
Were you lured away from your desk before you saved your new draft design? Fear not, when you return, WordPress 4.9 will politely ask whether or not you’d like to save your unsaved changes.

customizer4 9-autosave.jpg

Coding Enhancements

Syntax Highlighting and Error Checking? Yes, Please!
You’ve got a display problem but can’t quite figure out exactly what went wrong in the CSS you lovingly wrote. With syntax highlighting and error checking for CSS editing and the Custom HTML widget introduced in WordPress 4.8.1, you’ll pinpoint coding errors quickly. Practically guaranteed to help you scan code more easily and suss out and fix code errors quickly.
Sandbox for Safety
The dreaded white screen. You’ll avoid it when working on themes and plugin code because WordPress 4.9 will warn you about saving an error. You’ll sleep better at night.
Warning, Potential Danger Ahead!
When you edit themes and plugins directly, WordPress 4.9 will politely warn you that this is a dangerous practice. It will recommend that you backup your files before saving, so they don’t get overwritten by the next update. Take the safe route: your future self will thank you. Your team and customers will thank you.

Even More Widget Updates

The New Gallery Widget
An incremental improvement to the media changes hatched in WordPress 4.8, you can now add a gallery via widget. Yes!

gallery-widget.jpg

Press a Button, Add Media
Want to add media to your text widget? Embed images, video, and audio directly into the widget along with your text, with our simple but useful Add Media button. Woo!

text-widget-with-media.jpg

Shortcodes in Text Widget
One very longstanding request—for over 8 years is finally implemented in WordPress Version 4.9. It is no longer required to have plugins and themes do add_filter( 'widget_text', 'do_shortcode' ).

Site Building Improvements

More Reliable Theme Switching
When you switch themes, widgets sometimes think they can just up and move location. Improvements in WordPress 4.9 offer more persistent menu and widget placement when you decide it’s time for a new theme. Additionally, you can preview installed themes or download, install, and preview new themes right. Nothing says handy like being able to preview before you deploy.

Customizer Themes function

Better Menu Instructions = Less Confusion
Were you confused by the steps to create a new menu? Perhaps no longer! We’ve ironed out the UX for a smoother menu creation process. Newly updated copy will guide you.

customizer4 9-menu.gif

Developer Happiness

Customizer JS API Improvements
We’ve made numerous improvements to the Customizer JS API in WordPress 4.9, eliminating many pain points and making it just as easy to work with as the PHP API. There are also new base control templates, a date/time control, and section/panel/global notifications to name a few. Check out the full list.
MediaElement.js upgraded to 4.2.6
WordPress 4.9 includes an upgraded version of MediaElement.js, which removes dependencies on jQuery, improves accessibility, modernizes the UI, and fixes many bugs.
CodeMirror available for use in your themes and plugins
We’ve introduced a new code editing library, CodeMirror, for use within core. Use it to improve any code writing or editing experiences within your plugins, like CSS or JavaScript include fields.
Improvements to Roles and Capabilities
New capabilities have been introduced that allow granular management of plugins and translation files. In addition, the site switching process in multisite has been fine-tuned to update the available roles and capabilities in a more reliable and coherent way.

The Finer Points

Singular capabilities for activating and deactivating individual plugins
The singular activate_plugin and deactivate_plugin capabilities are used along with the corresponding plugin name when determining whether or not a user can activate or deactivate an individual plugin.
Sandbox PHP file edits in both plugins and themes, without auto-deactivation when an error occurs
A PHP edit that introduces a fatal error is rolled back with an opportunity then for the user to fix the error and attempt to re-save.
Addition of dirty state for widgets on the Administration Screen
indicating when a widget has been successfully saved and showing an “Are you sure?” dialog when attempting to leave without saving changes.

What's New

General

  • Drafting (#39896) and scheduling (#28721) of changes in the Customizer. Once you save or schedule a changeset, when any user comes into the Customizer the pending changes will be autoloaded. A button is provided to discard changes to restore the Customizer to the last published state.
  • Addition of a frontend preview link to the Customizer to allow changes to be browsed on the frontend, even without a user being logged in (#39896)
  • Addition of autosave revisions in the Customizer (#39275)
  • A brand new theme browsing experience in the Customizer (#37661)
  • Improve the flow for creating new menus in the Customizer (#40104)
  • Educated guess mapping of nav menus and widgets when switching themes (#39692)
  • Plugins: Introduce singular capabilities for activating and deactivating individual plugins (#38652)
  • Sandbox PHP file edits in both plugins and themes (#21622)

Posts

Media

  • Support for videos from providers other than YouTube and Vimeo in the Video widget (#42039)
  • Media: Upgrade MediaElement.js to 4.2.5-74e01a40 (#39686)
  • Media: Use max-width for default captions (#33981)
  • Media: Reduce duplicated custom header crops in the Customizer (#21819)
  • Media: Store video creation date in meta (#35218)

Comments

Appearance

  • Gallery widget (#41914), following the media and image widgets introduced in Version 4.8
  • Support for shortcodes in Text widgets (#10457)
  • Support for adding media to Text widgets (#40854)
  • Addition of dirty state for widgets on the Administration Screen, indicating when a widget has been successfully saved and showing an “Are you sure?” dialog when attempting to leave without saving changes (#23120, #41610)

Users

  • Role/Capability: Introduce capabilities dedicated to installing and updating language files (#39677)
  • Users: Require a confirmation link in an email to be clicked when a user attempts to change their email address (#16470)

Install Process

Multisite

Accessibility

Under The Hood

General

  • CodeMirror editor added to theme/plugin editor, Custom CSS in Customizer, and Custom HTML widgets (#12423)
  • Introduction of an extensible code editor control for adding instances of CodeMirror to the Customizer (#41897)
  • Addition of global notifications area (#35210), panel and section notifications (#38794), and a notification overlay that takes over the entire screen in the Customizer (#37727).
  • A date/time control in the Customizer (#42022)
  • Introduction of control templates for base controls (#30738)
  • Use WP_Term_Query when transforming tax queries (#37038)
  • Database: Add support for MySQL servers connecting to IPv6 hosts (#41722)
  • Emoji: Bring Twemoji compatibility to PHP (#35293)
  • Introducing search by amount of comments in WP_Query (#28399)

Images

Embeds

  • Support for adding oEmbeds outside post content, including Text widgets (#34115)

Script Loader

JavaScript

Bug Fixes

Multisite

  • Multisite: Introduce get_site_by() (#40180)
  • Multisite: Improve get_blog_details() by using get_site_by() (#40228)
  • Multisite: Improve initializing available roles when switch sites (#38645)
  • Multisite: Initialize a user’s roles correctly when setting them up for a different site (#36961)

Rest API

  • REST API: Support registering complex data structures for settings and meta
  • REST API: Support for objects in schema validation and sanitization (#38583)

Classes

What's New

  • I18N: Introduce the Plural_Forms class (#41562)

Deprecated

Functions

What's New

Deprecated

Actions & Filters

New Action Hooks

New Filter Hooks

Modified Filter Hooks

Deprecated

External Libraries

Miscellaneous

  • Core and the unit test suite is fully compatible with the upcoming release of PHP 7.2
See also: other WordPress Versions.