WordPress.org

Make WordPress Core

Tagged: field guide Toggle Comment Threads | Keyboard Shortcuts

  • Aaron Jorbin 7:18 pm on July 26, 2016 Permalink |
    Tags: , , field guide   

    WordPress 4.6 Field Guide 

    Many of the changes in the forthcoming WordPress 4.6 are developer-focused changes that take place under the hood. Please remember to test your plugins, themes, and sites with WordPress 4.6 before the release. An hour of testing today can save you days of anguish later.

    Enhanced Meta Registration

    register_meta() is getting some updates to enable greater flexibility and features in the future (such as inclusion in the Rest API). Until now, register_meta() took four arguments. In WordPress 4.6, this will decrease to 3, with the third one being an array of arguments. When register_meta() is used with the old signature in WordPress 4.6, it will continue to function but will now return false. Please read the initial post outlining why register_meta() has been updated and the followup detailing further enhancements.

    Persistent Comment Cache

    Since WordPress 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. If you have a plugin which modifies comment data directly please change them to make use of the various comment API functions or use clean_comment_cache(). You can hit this changes announcement for more info.

    New Object: WP_Post_Type

    Rather than a standard object, there is now a WP_Post_Type for each registered post type. Three functions and three actions have been changed to use this new object. WP_Post_Type provides methods to handle post type supports, rewrite rules, meta boxes, hooks, and taxonomies.

    🛫 Open Sans, 🛬 Native Fonts

    With the continued evolution of system fonts allowing for all devices to have a beautiful looking admin, WordPress 4.6 updates the font stack. To keep your custom admin pages looking consistent with the rest of the WordPress admin, you are encouraged to audit your CSS. The new font stack is:

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;

    When using this font stack, it must be called using the font-family property, and not the font shorthand. This works around an issue in Microsoft Edge. Additionally, the only font weights used in core now are 400 for general text and 600 for heavier text.

    Shiny Updates

    One of the user-facing features in 4.6 is an update to Shiny Updates, first introduced in 4.2. For developers, the change to pay attention to is that the JavaScript under the updates handle has been refactored and updated to support plugins and themes. If you are dependent on that handle, make sure to read about the shiny updates changes.

    Resource Hints in 4.6

    Resource Hints is a rather new W3C specification that “defines the dns-prefetch, preconnect, prefetch, and prerender relationships of the HTML Link Element (<link>)”. These can be used to assist the browser in the decision process of which origins it should connect to, and which resources it should fetch and preprocess to improve page performance.

    In 4.6, WordPress adds an API to register and use resource hints. The relevant ticket is #34292.

    Developers can use the wp_resource_hints filter to add custom domains and URLs for dns-prefetchpreconnect, prefetch or prerender. One needs to be careful to not add too many resource hints as they could quite easily negatively impact performance, especially on mobile.

    WP_Term_Query

    WordPress 4.6 will introduce WP_Term_Query. This new class brings parity between taxonomy term queries and WP’s other content type queries: WP_Query, WP_Comment_Query, and WP_User_Query. And – as in the case of posts, comments, and users – the get_terms() function has been converted to a wrapper for the new WP_Term_Query.

    Internationalization

    Everyone should be able to use WordPress in the language they want. WordPress 4.6 makes a number of changes to assist with internationalization and localization. Some of the highlights include:

    • Just-in-time loading for translations. You do not have to call load_plugin_textdomain() or load_theme_textdomain() anymore (if you distribute your theme/plugin via wordpress.org).
    • Community translations are now favored over translations which are included in your theme/plugin.
    • Localized jQuery UI datepicker.
    • Support for comment number declension in get_comments_number_text(). See #13651.
    • Fallback for TextDomain header field in get_plugin_data(). See #36706.
    • Updated list of continents and cities for the timezone selector. See #37554.
    • Support for the German (Switzerland) locale in remove_accents(). See #37076.
    • Improved support for month name declension. See #36790.

    Pre-instantiated Widget Registration in 4.6

    Since WP_Widget was introduced in 2.8 the register_widget() and unregister_widget() functions required the class name (string) of a WP_Widget subclass to be supplied. As of 4.6 these functions also accept a class instance (object) of a WP_Widget subclass as well. See #28216.

    Two key benefits of allowing objects to be instantiated are:

    1. Widgets can now be instantiated and registered with constructor dependency injection.
    2. New widget types can now be added dynamically, such as adding a Recent Posts widget for each post type, per #35990.

    New and Improved Customizer APIs

    The customizer has four major changes in WordPress 4.6. The most prominent is a new collection of APIs for validation of setting values. Included in this new notifications API for the customizer.

    Additional changes include some CSS cleanup. Custom controls that use part of the core UI and subclass WP_Customize_Media_Control no longer need to create their own CSS styles that duplicate core rules. Because the markup and styling have changed significantly, please test any custom controls, CSS, or JavaScript that is related to media controls in the customizer.

    If your code uses the customizer, you are encouraged to review the changes.

    Bootstrap/Load Updates in 4.6

    Alert: A late change was made to <a href=”https://make.wordpress.org/core/2016/08/13/global-overloading-in-advanced-cache-php/”>remove protection for overloading Plugin API related global variables</a> in <code>advanced-cache.php</code>

    Every time WordPress is loaded, it goes through the bootstrap or loading process. In WordPress 4.6, there will be a few changes to the process focused on making pieces available earlier. Many of these changes will have no effect whatsoever on the vast majority of WordPress sites. However, if you are the type that maintains your own advanced-cache.php drop-in, host/run large profile sites, or work on tools that bootstrap WordPress is odd ways, you need to know about the following changes:

    • Load plugin.php earlier in wp-settings.php
    • is_ssl() is now located in wp-includes/load.php
    • ABSPATH can now be safely defined before WordPress is loaded

    Multisite Focused Changes

    This release, work continues on multisite with a focus on improved APIs and performance. Some highlights include:

    • New WP_Site_Query and WP_Network_Query classes to query sites and networks in a standardized way.
    • Enhancements to WP_Site and WP_Network objects including lazy-loading for site details.
    • A new helper function get_current_network_id() to find the current network’s ID.
    • wp_get_sites() has been deprecated. get_site(), get_sites(), get_network(), and get_networks() are the future.

    External Library Updates

    • Masonry was updated to version 3.3.2 from version 3.1.4.
    • imagesLoaded was updated to version 3.2.0 from version 3.1.4.
    • imagesLoaded can now 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.
    • TinyMCE was updated to version 4.4.1 from version 4.3.10.
    • Backbone.js was updated to version 1.3.3 from 1.2.3.

    Summaries for each of these updates and links to full changelogs are available.

    But Wait! There’s More!

    Over 280 bugs, 125 enhancements, 7 feature requests, and 18 blessed tasks have been marked as fixed in WordPress 4.6. Some additional ones include:

    Please, test your code. Fixing issues now, before the release, helps you and helps millions of WordPress sites.

     
    • Jason 3:49 pm on July 28, 2016 Permalink | Log in to Reply

      I would dearly love it if you guys would update the custom menu widget to be “Multi-site” aware, so I could pull menus from other sites on the network and use them. We use Multisite to encapsulate departments but the overall site design requires some semi-static menus that span multiple sites.

      I wrote my own plugin that replicates the feature but if it was built in to the official version it’d be fantastic.

    • Jesse Petersen 2:25 pm on August 1, 2016 Permalink | Log in to Reply

      Thanks for the great field guide, @jorbin. The effort is appreciated.

    • Marlon Amancio 2:46 pm on August 1, 2016 Permalink | Log in to Reply

      Great overview! Thanks @jorbin

    • @mercime 1:26 am on August 3, 2016 Permalink | Log in to Reply

      Thanks for the good news @jorbin and to all the contributors for the very cool improvements this dev cycle!

    • sjmur 9:08 pm on August 16, 2016 Permalink | Log in to Reply

      WP_Term_Query is going to be awfully useful for me day to day. Thanks!

      Can’t wait to jump back into the core for 4.7

    • Kevin Vess 1:29 am on August 24, 2016 Permalink | Log in to Reply

      For Internationalization, you said, “You do not have to call load_plugin_textdomain() or load_theme_textdomain() anymore (if you distribute your theme/plugin via wordpress.org).”

      I didn’t include the load_plugin_textdomain() function in my plugin because of this; but since the release of WordPress 4.6 I’m still getting the “This plugin is not properly prepared for localization” message:
      https://translate.wordpress.org/projects/wp-plugins/wp-force-login

      Can you tell me what I need to do to make my plugin prepared for localization? Thanks!

  • Aaron Jorbin 8:52 pm on March 30, 2016 Permalink
    Tags: , , field guide   

    WordPress 4.5 Field Guide 

    WordPress 4.5 is the next major version of WordPress and with it come some bang bang changes. This guide will describe many of the developer-focused changes to help you test your themes, plugins, and sites. So grab a ☕️ ,🍷,🍵, or 🍺 and get ready for what’s coming soon.

    JavaScript! and CSS!

    Multiple external libraries have been updated with the two that require your attention being Backbone and Underscore. There were some‼️ breaking changes ‼️ with these two libraries, so make sure to test your code if you use either of these.  jQuery and jQuery Migrate have also been updated, please test with the unminified versions in order to ensure future compatibility with WordPress.

    The script loader has been updated with three big changes. The build process no longer creates wp-admin.min.css, wp_add_inline_script() joins the family of functions, and better support for multigenerational dependencies is included.

    Term Edit Page! –‼️ Backward Incompatible change‼️

    The term edit screen has been separated out from the term list screen. This brings greater consistency to how the admin generates screens for terms and posts but at the cost of the need to change how you register scripts and how you detect that you are on a term edit screen.

    Live Preview: Faster, Extensible, More Features!

    Live Preview (also known as “The Customizer”) once again has received attention this release with the addition of new controls, some performance improvements that require your attention to implement, and a two new user-facing features.

    Setting-less Controls, Device Previews, and Selective Refresh are the three biggest changes you’ll find. Setting-less controls make it easier for you to implement complex interfaces. Device Preview is a user facing feature that allows users to adjust the preview to match the screens on various devices.  This feature includes filters to change the devices users can choose. Selective Refresh allows for changes to appear quicker inside the preview, and you can do so with less code than before. Theme authors need to make changes to take advantage of selective refresh. Luckily, the change will generally result in fewer lines of code needed overall ( more 🍎 than 🍏 ).

    One area that selective refresh helps live preview function faster is with widgets.

    ‼️ If you offer sidebars or a widget in your theme or plugin, please update your code to implement selective refreshBoth themes and widgets need to indicate support, so please update your code accordingly.

    The final change to Live Preview involves a control for a new theme feature, and that is Custom Theme Logos.

    Custom Theme Logos!

    Themes can now offer support for custom logos. Custom Logos add an additional way for users to customize their site and theme developers can customize how custom logos are displayed.

    Image Performance!

    Following up on the introduction of responsive images in WordPress 4.4, WordPress 4.5 is making changes to improve image performance including improved compression settings and smarter handling of image metadata.

    Embed Templates! (and other iterations)

    Iterating on embeds has led to the ability to better customize embeds by adding new templates to the template hierarchy for embeds. Embeds have also had some performance improvements for autodiscovery, the ability to embed the front page of a site, and changes to the iframe of embedded content.

    Comments Component!

    The comments component has a few user-facing changes to make comments easier to moderate. For developers, the most notable change is the ability to adjust field lengths for your custom database schema. Additionally, the rel=nofollow attribute and value pair will no longer be added to relative or same domain links within comment_content.

    Multisite!

    Multisite once again has seen changes with the addition of new filters around site and user creation, and a WP_Site object.

    And more!

    Overall, 372 bugs have been marked as fixed in WordPress 4.5 (so far). There are also dozens of new hooks and dozens of hooks that have received additional parameters. It’s entirely possible that one or more has caused a regression, so please make sure to test your code deeply and report any issues you find.

     
  • Aaron Jorbin 4:18 pm on November 11, 2015 Permalink
    Tags: , , field guide   

    WordPress 4.4: Field Guide 

    WordPress 4.4 is the next major release of WordPress and is shaping up to be an amazing release. While you have likely discovered many of the changes from testing your plugins, themes, and sites (you have been testing, right?), this post highlights some of the exciting 🎉changes developers can look forward to. 💥

    Externally Embeddable

    New Embeds Feature in WordPress 4.4

    Using a handful of filters, you can customize how your site looks when it’s embedded elsewhere. As a part of the work around embeds, there are also a couple of new functions for retrieving and displaying embeddable content. The post above also links to a plugin which will remove the ability to embed your site elsewhere.

    REST API Infrastructure Introduction

    The infrastructure to create a REST API has landed in WordPress core.  Adding your own endpoints (or using the latest version of the REST API plugin) is now even easier.  The new embed feature mentioned above uses this new infrastructure.
    Note: If you are using v1 of the API plugin, it is incompatible with 4.4, however an update is planned before 4.4 ships. The update will not use the new REST API infrastructure, so you’ll want to update your REST API usage eventually. If you are using v2 of the API plugin, be sure you’re on beta 5 or later; previous versions do not support WordPress 4.4.

    Responsive Image Insertion

    Through the use of a display filter, image tags in WordPress now include srcset and sizes.  These two attributes to the <img> tag allow browsers to choose the most appropriate image size and download it, ignoring the others. This can save bandwidth and speed up page load times. There are new functions, filters, and an additional default image size available to help with the creation of responsive images.

    wp_title Deprecation Decision

    Since WordPress 4.1, add_theme_support( 'title-tag' ); has been the recommended way of outputing a title tag for themes.  Now, a year later the wp_title function has been officially deprecated. Take a look at this post if you want to see all the great new filters you can use to modify title tags.

    UPDATE 12 November – wp_title has been reinstated for the time being. It is a zombie function.  add_theme_support( 'title-tag' ); remains the recommended way to insert a title tag into your theme, however there were use cases for wp_title that were not accounted for in the original deprecation decison

    Term Taxonomy Tranquility

    WordPress 4.4 is the latest in a string of releases to feature major updates to the taxonomy system. This release introduces of term meta, a new WP_Term class, and a host of other under the hood changes.

    Comment Component Cultivation

    Comment Object and Query Features in 4.4

    Changes to fields output by comment_form in WordPress 4.4

    Comments received love both on the front end of sites and on the backend. On the front-end, the comment field will always appear first, before the name and email fields. This fixes a longstanding bug where the behavior was different for logged in and logged out users.

    Under the hood, comments are now represented by a WP_Comment class and comment queries are now considerably more powerful.

    Multisite Momentum

    Like taxonomy and comments, the multisite features gains a new class, WP_Network. Additionally, there are now *_network_option functions which make it easier to use multiple networks. The linked post also highlights new hooks, some notable bug fixes, and two newly-deprecated functions. If you use WordPress in a multisite environment, this is a must-read.

    Heading Hierarchy Happiness

    Headings on the admin screens are now more semantic. Be sure to update your custom admin screens to follow the proper heading structure. These changes help users of assistive technologies, such as screen readers.

    Twenty Sixteen

    Each year, WordPress releases a new default theme and this year is no exception. Twenty Sixteen is a brand new theme, bundled with WordPress 4.4. Default themes are incredibly popular; be sure to test your plugins to ensure they function well with Twenty Sixteen.

    Other Notes

    So far, this release has had over two thousand commits. There are many additional changes not outlined above including: the removal of support for my-hacks.php(Update Nov 20th: My Hacks support was added back), giving add_rewrite_rule support for an easier-to-read syntax, support for single-{post_type}-{post_name} in the template hierarchy, pretty permalinks for unattached media, and stronger enforcement of the show_ui argument in custom post types. As with every major update, it is very important to test every feature in your plugins and themes to ensure there are no regressions in their behavior.

    Closing

    If you haven’t been testing your themes, plugins, and sites with WordPress 4.4, now is a great time to start. You can grab a copy from svn (or git), download the nightly builds, or install it using the Beta Tester Plugin.

    WordPress 4.4 is not recommended for use on production servers until the final release has been announced on the WordPress News blog. The release is currently targeted for December 8, 2015. Get testing today!

     
    • Xavier Borderie 9:13 am on November 12, 2015 Permalink | Log in to Reply

      Very useful, thanks a lot Aaron!

    • Shah Alom 2:29 pm on November 12, 2015 Permalink | Log in to Reply

      Very helpful on the first look … Thanks!

    • Ahmad Awais 6:50 pm on November 12, 2015 Permalink | Log in to Reply

      Thanks for enlisting everything, Aaron! I’ve been fortunate enough to contribute to the REST API, Headings Hierarchy and Twenty Sixteen theme. Looking forward to WP 4.4 in December.

    • Nisha 12:55 pm on November 13, 2015 Permalink | Log in to Reply

      Thanks for the update Aaron. Looking forward to new features in WP 4.4.

    • jomarlipon 12:10 am on November 19, 2015 Permalink | Log in to Reply

      Looking forward to this update. 🙂

    • dawesi 4:54 am on November 20, 2015 Permalink | Log in to Reply

      So great seeing major breaking changes in a dot release. So glad you’re using professional standards and only releasing breaking changes in major versions… oh wait..

      Too many breaking changes, my clients want out of wordpress. It’s your reputation, 4.3 was the WORST software release of any company in the world in 2015, 4.4 better be PERFECT or you’ll be winning more shonkey awards.

      Our clients want OUT if 4.4 breaks ANYTHING out of the box. (2400 wordpress sites GONE overnight)

      Some great features here that should be in 5.0… goes to show this product is off the rails.

      • Samuel Sidler 3:18 pm on November 20, 2015 Permalink | Log in to Reply

        Hello,

        WordPress 4.4 is considered a major release, just as WordPress 4.3 was considered a major release. WordPress 5.0 will be another major release and no different than WordPress 4.9 or 5.1. More information about our versioning is available in the handbook.

        Regarding quality, note that 4.3 was one of the most solid WordPress releases we’ve had in years, only requiring minor fixes after its release and being adopted at a faster rate than any previous release in recent memory. What issues affected you?

      • demixpress 3:57 pm on November 27, 2015 Permalink | Log in to Reply

        The version numbering of WordPress is great, or it may be another Android in CMS.

    • wpsupporthq 4:06 am on November 29, 2015 Permalink | Log in to Reply

      Thanks Aaron! This is a great rundown of the upcoming changes.

  • Aaron Jorbin 4:15 am on April 23, 2015 Permalink
    Tags: , , field guide   

    WordPress 4.2 Field Notes 

    WordPress 4.2 includes both new and improved features. It also includes changes under the hood.  While I’m sure you’ve been testing your themes, plugins, and sites in preparation for the release, you may have missed the announcements of all the changes. Here is a quick rundown of developer related things you should know:

    Additionally, the bundled version of jQuery UI has been upgraded from 1.11.2 to 1.11.4 and jQuery to 1.11.2.  The team also fixed 231 defects reported againgst previous versions of WordPress.  Please continue testing in preparation for the imminent 4.2.0.   WordPress wouldn’t be where it is without you.

    UPDATE: Add information on spinners and admin notices.

     
  • Aaron Jorbin 7:49 pm on December 16, 2014 Permalink
    Tags: , , field guide   

    WordPress 4.1 Field Notes 

    The release of WordPress 4.1 is imminent. By now, you should have already been testing and preparing your plugins and themes. I wanted to highlight a couple of posts here over the last few months on changes in WordPress 4.1.  This is by no means a complete summary of everything that has changed, but will give you a sense of what you have coming to you in the next few days.

    This version of WordPress features some new template tags in a continued attempt to improve core’s Theme APIs.

    Taxonomy, Date, Meta and Comment queries all have been updated and improved.

    As a part of the taxonomy roadmap, When a term is created with a matching slug as an existing term, we now create a new entry in wp_terms.

    Distraction-free writing has received a full revamp.

    Themes now can have better support for the <title> tag

    There have been several improvements to the Customizer API, including contextual panels and sections, and JavaScript templates for controls.

    Please continue testing your sites, plugins and themes. WordPress wouldn’t be where it is without you.

     
  • Andrew Nacin 2:35 am on June 7, 2012 Permalink
    Tags: , field guide   

    WordPress 3.4 Field Guide for Developers 

    WordPress 3.4 Release Candidate 2 due to drop any moment, and we’re aim to do a final release of 3.4 early next week. Developers, this is your last pre-release opportunity to test your plugins and themes.

    For 3.3, I wrote up a field guide of things developers need to know. For 3.4, I get to crowd-source it:

    Custom Headers and Backgrounds. Chip Bennett posted a great summary of the API changes on the make/themes blog. Amy Hendrix posted about flexible custom headers. If you are a theme developer, I would strongly suggest you follow the make/themes P2.

    Live Previews (The Customizer). You’ll want to read Otto’s definitive post on the subject, How to leverage the Theme Customizer in your own themes.

    New WordPress XML-RPC API. If you’re interested in the new APIs for custom content types and taxonomies, check out the Codex page, put together by Max Cutler. Max also recapped the bug fixes, test coverage, and other changes on his blog.

    Internationalization/Localization Changes. There’s a document on the translators P2 that outlines the numerous changes here.

    That’s all we have for now! If there’s something we missed that deserves a writeup for developers, leave a comment and I’d be happy to make sure it gets written up here (under the field guide tag).

     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel
Skip to toolbar