WordPress.org

Codex

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

pt-br:Version 4.6

Para Version 4.6 a versão do banco de dados (db_version in wp_options) foi alterada para xxxxx e a revisão do Trac foi xxxxx/.

Installation/Upgrading Information

To download WordPress 4.6, visit https://wordpress.org/download/release-archive/

Highlights

The Finer Points

Shiny Updates v2
Shiny Updates replaces progress updates with a simpler and more straight forward experience when installing, updating, and deleting plugins and themes. Those actions are now all performed via AJAX.
One big user facing change is about search. There is now an AJAX search on both the Installed Plugins screen as well as the Add New Plugin screen, this means the search results change as you type, drastically simplifying your workflow. (read more)

Multiple Puglins Update Puglin Deletes
Left: Multiple plugins update, Right: Plugin delete

Native Font supports in the Administration Screen
The operating system’s UI font is used for any text that’s part of the WordPress user interface. Although WordPress switched to Open Sans in Version 3.8 at the end of 2013 by various reasons, today, the background condition and technology have changed. Then, experience faster load times, especially when working offline, a removal of a third-party dependency, and a more native-feeling experience as the lines between the mobile web and native applications continue to blur. (read more)

macOS-Safari-1024x576.png   Windows-Edge-1024x711.png
Left: Browser: Safari, OS: macOS, Font: San Francisco / Right: Browser: Edge, OS: Windows 10, Font: Segoe UI

Import Screen overhaul
The Import Screen was overhauled, improving accessibility and making it much easier to install and run an importer.

Overhauled Import Screen
Overhauled Import Screen

Internationalization improvements
The translation platform for plugins and themes was opened up in December 2015. Since then 15,000 plugins and themes were imported and are now benefiting from automated translation updates. Translations files are usually inside wp-content/languages, and WordPress now scans that directory for available translations and automatically loads them if it encounters a text domain for the first time. Also, jQuery UI datepicker was localized. (read more)
Editor Improvements
A more reliable recovery mode and detection of broken URLs while you type them.
Emoji
Emoji support has been updated to include all of the latest Unicode 9.0 emoji characters.

For Developers

Resource Hints
Resource Hints is a rather new W3C specification that "defines the dns-prefetch, preconnect, prefetch, and prerender relationships of the HTML Link Element (<link>)". Allow browsers to prefetch specific pages, render them in the background, perform DNS lookups, or to begin the connection handshake (DNS, TCP, TLS) in the background. (read more)
HTTP API internal changes
The HTTP API (wp_remote_request() and family) have undergone a large internal change. Rather than using a WordPress-specific HTTP library, WordPress now uses the open-source independent Requests library. (read more)
Language Packs
Translations managed through translate.wordpress.org now have a higher priority and are loaded just-in-time.
WP_Site_Query
New WP_Site_Query class to query sites with lazy loading for details.
WP_Network_Query
New WP_Network_Query class to query networks with lazy loading for details.
WP_Term_Query
New WP_Term_Query is modeled on existing query classes and provides a more consistent structure for generating term queries. (read more)
WP_Post_Type
New WP_Post_Type class provides methods to handle post type supports, rewrite rules, meta boxes, hooks, and taxonomies. This changes the global $wp_post_types to an array of WP_Post_Type objects. (read more)
Widgets API
The Widgets API was enhanced to support registering pre-instantiated widgets. (read more)
dbDelta updates
dbDelta() is a function which helps to modify the database based on specified SQL statements. This function has been updated to resolve some long standing bugs (read more)
  • Normalized index definitions
  • Backtick all the things
  • Support for SPATIAL keys
Persistent Comment Cache
Since Version 2.6, the comments API has purposefully not used a persistent cache. Over the past 20 releases, changes have been made to purge the problems from the comments API that caused this. Comments can now be stored in a persistent object cache. When comments are added, modified, or deleted, out of date cache values are properly invalidated. (read more)
External Libraries
External Libraries were updated to the latest versions – Masonry to 3.3.2 and imagesLoaded to 3.2.0, MediaElement.js to 2.22.0, TinyMCE to 4.4.1 and Backbone.js to 1.3.3. (read more)
REST API
REST API responses now include an auto-discovery header and a refreshed nonce when responding to an authenticated response.
Enhancing register_meta()
The register_meta() function is getting some updates to enable greater flexibility and features in the future (such as inclusion in the Rest API). It expands to support the registration of meta keys and what to expect from those keys. Its behavior is similar to register_post_type() in that the registration of this data is stored in the global scope. This makes an object’s meta data more accessible to parts of core and extending code.(read more and more)
Customizer
Improved API for Setting Validation in the Customizer. (read more).

What's New

General

  • Unifying permission error messages (#34521)

Posts

  • Editor Improvements (#36638) - A more reliable recovery mode and detection of broken URLs while you type them.
  • Emoji (#37361) - Emoji support has been updated to include all of the latest Unicode 9 emoji characters.


Media

  • Featured images are no longer immediately saved to posts or non-image attachments until the corresponding post or attachment has been updated.

Comments

  • Comments: Allow for default comment form action, /wp-comments-post.php, to be changed via the comment_form_defaults filter. (#26841)
  • Comments: Add parameters to edit_comment_link() to allow specifying a Comment and link class. Matches the parameters for edit_post_link(). (#36538)

Comments: add a $comment parameter to get_comment_author_url_link(), comment_author_email_link(), and get_comment_author_email_link(). (#36573) (#36573)

Appearance

  • Native Fonts in the Administration Screen (#36753) - Experience faster load times, especially when working offline, a removal of a third-party dependency, and a more native-feeling experience as the lines between the mobile web and native applications continue to blur.
    The operating system’s UI font is used for any text that’s part of the WordPress user interface. In other contexts, like the Editor, we continue to use a serif system typeface, Georgia. (read more)
  • Loading Translations in Different Order (#34213) - load_plugin_textdomain( $domain ) and load_theme_textdomain( $domain ) are used to load the translations for a specific text domain, where $domain equals the slug of your plugin or theme. Now, these functions first looked inside the wp-content/languages directory, where language packs reside, then, the plugin/theme folder.
  • Just-in-time Loading for Translations (#34114) - Translations files are usually inside wp-content/languages, and WordPress now scans that directory for available translations and automatically loads them if it encounters a text domain for the first time.
  • jQuery UI datepicker localization (#29420) - localization defaults were added for the jQuery UI datepicker based on the current locale using the new wp_add_inline_script() function. (read more)

Users

  • Users: In wp_new_user_notification(), add 'user' option for the $notify parameter, which allows for sending notification only to the user created. (#36009)
  • Multisite: Add the pre_get_blogs_of_user filter. This allows a plugin to short circuit get_blogs_of_user() in cases where the default behavior of the function is unnecessary or slow. (e.g. A user is a member of thousands of sites.) (#36707)
  • List Tables: Pass the $which parameter to restrict_manage_posts and restrict_manage_users. $which contains the location of the extra table nav markup: 'top' or 'bottom'. ([#35307)

Install Process

  • Shiny Updates v2 (#37714) - Shiny Updates replaces progress updates with a simpler and more straight forward experience when installing, updating, and deleting plugins and themes.

Multisite

See the For Developers section for information on the new Multisite classes, WP_Site_Query, WP_Network_Query, and WP_Term_Query.

Accessibility

  • Taxonomy pages tab order now reflects the visual order. (#35664) (read more)
  • Themes: Make default "read more" link more accessible. (#36572)
  • Import: Enhance accessibility on the Import screen. (#35191)
    • Remove title attributes.
    • Show "Install Now" and "Details" links if the importer isn't installed yet.
    • Show a "Run Importer" link if the importer is installed. It also handles activation if the plugin isn't activated.
    • Add aria-label attributes to each link.
    • Unify the importer descriptions to make them independent from the plugin state.
    • Adjust JavaScript callbacks for ajaxified importer installs.

Under The Hood

General

  • Resource Hints (#34292) – Allow browsers to prefetch specific pages, render them in the background, perform DNS lookups, or to begin the connection handshake (DNS, TCP, TLS) in the background.
    By default, wp_resource_hints() prints hints for s.w.org (the WordPress.org CDN) and for all scripts and styles which are enqueued from external hosts. (read more)
  • HTTP API internal changes (#33055) - The HTTP API (wp_remote_request() and family) now uses the open-source independent Requests library, rather than using a WordPress-specific HTTP library. Requests provide the same functionalities with current library, and better HTTP standard support, case-insensitive headers, parallel HTTP requests, support for Internationalized Domain Names (like böcean901.ch), and many other internal improvements. (read more)
  • Persistent Comment Cache (#36906) - Comments can now be stored in a persistent object cache. When comments are added, modified, or deleted, out of date cache values are properly invalidated. (read more)

Images

  • Allowed upload file types are now checked before uploading (#14244)
  • Adds a new action hook, wp_edit_form_attachment_display to edit_form_image_editor(), which can be used as a fallback to render previews of an attachment that isn't an image, audio, or video file included in the media library. (#36052)
  • Removed a private, deprecated and unused function, _wp_upload_dir_baseurl(). (#36375)
  • Prior image edits are now cleaned up properly when `IMAGE_EDIT_OVERWRITE` is true. (#32171)

Bootstrap / Load

There are changes to the bootstrap or loading process focused on making pieces available earlier. These changes are all expected to be backward compatible. (read more)

  • Load plugin.php earlier in wp-settings.php (#36819)
  • Reconcile wp-settings-cli.php with wp-settings.php (#34936)
  • is_ssl() is now located in wp-includes/load.php (#35844)
  • ABSPATH can now be safely defined before WordPress is loaded (#26592)

Bug Fixes

Embeds

  • Autoembeds now work with paragraphs. (#25387)
  • Improved height calculation for slow loading images. (#35657)
  • Docs: Added missing @access tags to methods in WP_oEmbed_Controller. (#36297)
  • Removed support for Google Video since the service has been retired for years. (#36304)
  • Now WordPress includes the locale stylesheets after the default styles. (#36839)
  • Added unit tests for the WP_Embed class.(#37214)
  • WordPress doesn't print the HTML for a featured image if an embedded post has no featured image. (#37288)

Multisite

For detail about multisite changes in Version 4.6, refer this Tech Docs.

  • WP_Site_Query (#35791) - With new WP_Site_Query or get_sites(), sites can now be queried from the $wpdb->blogs table in a flexible way by id, domain, path, and more.
  • WP_Network_Query (#32504) - With new WP_Network_Query or get_networks(), networks can now be queried from the $wpdb->site table by id, domain, and path.
  • Enhancements to WP_Site and WP_Network - It includes new utility methods, property changes (#36717, #37050), Lazy-loading extended properties (#36935), New Actions and Filters (#26580) and others.

Note: WP Multi Network compatibility - The introduction of get_networks() in Version 4.6 conflicts with the function of the same name in WP Multi Network, a plugin commonly used to provide multiple networks on a multisite installation. If you are using WP Multi Network, please be sure to update the plugin to the latest (detail).

Classes

What's New

Visit the Code Reference for a full list of classes added or changed in 4.6.
  • New WP_Term_Query is modeled on existing query classes and provides a more consistent structure for generating term queries. It brings parity between taxonomy term queries and WordPress's other content type queries (read more)
  • New WP_Post_Type class provides methods to handle post type supports, rewrite rules, meta boxes, hooks, and taxonomies. (#36217)

Functions

What's New

Visit the Code Reference for a full list of functions added or changed in 4.6.
  • dbDelta() function updates resolve following issues (read more)
    • Normalized index definitions
    • Backtick all the things
    • Support for SPATIAL keys
  • REST API responses now include an auto-discovery header (#35580) and a refreshed nonce when responding to an authenticated response (#35662).
  • Enhancing register_meta() (#35658) - register_meta() is getting some updates to enable greater flexibility and features in the future (such as inclusion in the Rest API). It expands to support the registration of meta keys and what to expect from those keys. Its behavior is similar to register_post_type() in that the registration of this data is stored in the global scope. This makes an object’s meta data more accessible to parts of core and extending code. A global variable, $wp_meta_keys, contains all registered meta keys.(read more and more)

Deprecated

Actions & Filters

Visit the Code Reference for a full list of hooks added or changed in 4.6.

External Libraries

Miscellaneous

See also: other WordPress Versions.