Week in Core, February 22nd – 28th, 2017

Welcome back the latest issue of Week in Core, covering changes [40101-40141]. Here are the highlights:

  • 41 commits
  • 46 contributors
  • 76 tickets created
  • 21 tickets reopened
  • 71 tickets closed

Ticket numbers based on trac timeline for the period above. The following is a summary of commits, organized by component.

Code Changes

Administration

Build/Test Tools

Comments

  • When commenting on a draft post, display a friendly error message if the user can view the post. [40128] #39650

Mail

  • Ensure entities in the site title are decoded when used in the body of the new user email. [40127] #39446

Media

Misc

  • Bump the version after the 4.7.3-RC1 packaging. [40141] #
  • Version bump for WordPress 4.7.3-RC1 [40140] #

Networks and Sites

  • Multisite: Use WP_Network_Query in WP_Network::get_by_path(). [40102] #37217

Posts, Post Types

  • Docs: Update the description of is_singular() and WP_Query::is_singular() to be parsed correctly by developer.wordpress.org. [40103] #39948

REST API

Themes

  • Enable browser history support in add new theme screen. [40107] #36613

TinyMCE

Upload

Thanks to @adamsilverstein, @afercia, @ajoa, @azaozz, @blobfolio, @codegeass, @davidakennedy, @dd32, @desrosj, @Drivingralle, @flixos90, @gitlost, @grapplerulrich, @iandunn, @ipstenu, @iseulde, @jazbek, @jeremyfelt, @jnylen0, @joehoyle, @joemcgill, @johnbillion, @johnjamesjacoby, @JPry, @markoheijnen, @MatheusGimenez, @mayurk, @mikeschroder, @milindmore22, @mnelson4, @netweb, @ocean90, @rachelbaker, @reldev, @ryelle, @sagarprajapati, @sanchothefat, @SergeyBiryukov, @spacedmonkey, @swissspidy, @triplejumper12, @welcher, @westonruter, and @xknown for their contributions!

Providing a REST API sites endpoint for multisite

One of the objectives for multisite is to determine how sites can be managed with the REST API. This has been an agenda item for the last two weeks and quite a bit has been processed. This will continue to be a topic, so please stop in for #core-multisite office hours on Tuesday 17:00 UTC and please leave your feedback in the comments on this post.

January 17 chat log and January 24 chat log in #core-multisite

Attendees: @kenshino, @vizkr, @danhgilmore, @iamfriendly, @flixos90, @schlessera, @sergeybiryukov, @pbearne, @paaljoachim, @streetlamp, @jnylen0, @loreleiaurora, @maximeculea

The requirements for the /sites/ endpoint can be summed up with these assertions:

  • The /sites/ endpoint should provide a useful set of data for each site without requiring the use of switch_to_blog().
  • It should be possible to query /sites/ for something other than ID, domain, and path.

In its current state, any /sites/ endpoint is limited to the fields in the wp_blogs table. Data such as a site’s name and description are stored in each individual site’s wp_#_options table.

Given a list of 20 sites, switch_to_blog() will be used 20 times so that get_option() can be used to retrieve things like home, siteurl, blogname, and blogdescription. An example of how inefficient this is can be found in the generation of the My Sites menu. Caching has gotten better with the introduction of WP_Site and WP_Site_Query, but there is an opportunity to change how the information is stored.

In #37923, @johnjamesjacoby suggests the introduction of a wp_blogmeta table that provides access to some site information in a common table. After discussing this in the January 17 chat, @iamfriendly and @flixos90 agreed to each take a look at core’s default options stored in wp_options and determine which made sense in a shared wp_blogmeta table. Richard’s results can be found in a comment on the ticket and Felix’s in the Slack discussion.

After some discussion in the January 24 chat, that list can be pared down a bit more.

  • home
  • siteurl
  • blogname
  • blogdescription
  • admin_email

The creation of a new table, wp_blogmeta, and migration of data for each site from wp_#_options is something that needs feedback. Without this change, a /sites/ endpoint is still possible, but may be limited. With the change, a /sites/ endpoint is much more useful, but requires a careful migration process.

#multisite, #networks-sites, #rest-api

Week in Core, January 11th – 17th, 2017

Welcome back the latest issue of Week in Core, covering changes [39759-39923]. Here are the highlights:

  • 165 commits
  • 44 contributors
  • 87 tickets created
  • 9 tickets reopened
  • 83 tickets closed

Ticket numbers based on trac timeline for the period above. The following is a summary of commits, organized by component.

Code Changes

Administration

  • List Tables: Pass the $which parameter to restrict_manage_posts filter instance in WP_Media_List_Table, missed in [37422]. [39917] #38772
  • Improve tab character width in Plugins and Themes editor. [39897] #38684

Build/Test Tools

  • Add assertNotFalse() method to WP_UnitTestCase and use it where appropriate. [39919] #39219
  • Correctly reference function names in @covers entries. [39918] #39235
  • After [29858], update .jsintrc to use spaces, not tabs. [39898] #39359

Bundled Theme

  • Twenty Seventeen: Remove duplicate global $post declaration in twentyseventeen_front_page_section(). [39909] #39590
  • Twenty Seventeen: Correct @param entries for twentyseventeen_custom_colors_css filter. [39901] #39575
  • Twenty Seventeen: Remove extra asterisk from a translator comment so the comment could be parsed correctly. [39894] #39116

Cache API

  • Docs: Add missing @param type for wp_cache_get_last_changed(). [39900] #39571

Database

  • dbDelta: Ignore index subparts when checking for duplicate indices. [39921] #34870

Editor

External Libraries

Formatting

  • Tests: wpautop() should not add extra before. [39914] #39307
  • Fix wpautop() to stop adding paragraph tags around “. [39912] #39307

I18N

  • Move “Site Language” setting above “Timezone”. [39885] #38562

Media

  • Use a consistent error message for file type errors on uploading. [39891] #33242

Misc

  • Post-4.7.1 version bump for 4.7 branch. [39883]
  • Only show major version in readme.html for 4.7 branch [39871]
  • Media: Fix exif_imagetype check in wp_get_image_mime [39851-39861]
  • Tests: Replace broken codeispoetry.png file. [39848-39849]
  • Use plural string ‘Maintenance and Security Releases’ since we have two now [39847]
  • REST API: Change which users are shown in the users endpoint. [39844]
  • Media: Improve image filetype checking. [39832-39842]
  • Updates: Translate plugin data on the Updates screen. [39808]
  • Themes: Fix markup for theme name fallbacks. [39807]
  • Multisite: Use wp_rand() in signup key creation. [39795-39806]
  • Mail: Disable wp-mail.php when mailserver_url is mail.example.com. [39772-39782][39784]

Plugins

  • Docs: Use a consistent description for $plugin parameter in various plugin API functions. [39890] #36333
  • Docs: Improve the DocBlock for validate_plugin(). [39889] #36333

Posts, Post Types

  • Increase the height of post slug input to prevent certain characters from being cut in Firefox on Windows. [39905] #28084

REST API

Taxonomy

  • Docs: In wp_set_object_terms(), add a note that passing an empty value as $terms argument will remove all related terms. [39893] #36690

Text Changes

  • Taxonomy: Add an explanation for “Parent” dropdown for hierarchical custom taxonomies. [39895] #23447

Themes

  • Add a unit test for get_theme_feature_list() to make sure that the list of theme features pulled from the WordPress.org API returns the expected data structure. [39906] #28121
  • Docs: After [37083], change “HEX format” to “3- or 6-digit hexadecimal form” for clarity. [39888] #36336
  • Use curly braces for variables inside strings in `get_page_template() to explicitly specify the end of the variable name. [39884] #38625

TinyMCE

  • Strip browser inserted <u> and <font> tags from inside links when copying and pasting in IE and Edge. [39916] #39570
  • Ensure the inline toolbar is shown and properly positioned when there are several wpview blocks in the editor and the user selects one after the other. [39910] #38849
  • Prevent the inline toolbar from appearing on partially selected wpview nodes. This can happen when HTML is initially loaded in the editor and wpview is the first node, or sometimes on repeatedly pasting the same wpview. [39904] #38849
  • When inserting a wpview, place the caret after is so the user can continue typing without interruption. [39903] #39337
  • Improve removal of spaces from empty paragraphs when loading HTML in the editor. [39902] #39437

Upload

Users

  • Introduce signup_site_meta and signup_user_meta for filtering signup metadata in wpmu_signup_blog() and wpmu_signup_user(), respectively. [39920] #39223
  • User Query: Cast $user_total as an int. [39915] #39297
  • I18N: Reference correct placeholder in a translator comment added in [30333]. [39908] #30264
  • Display the name of user being edited on Edit User screen. [39907] #28182
  • Docs: Make $meta parameter description in multisite signup and registration functions more consistent. [39887] #38781
  • In wpmu_signup_blog() and wpmu_signup_user(), pass unserialized signup meta data to after_signup_site and after_signup_user filters introduced in [34112], to match the documented value. [39886] #38781

Widgets

  • In unregister_sidebar(), rename the $name parameter to $sidebar_id for consistency with is_registered_sidebar(). [39892] #35147
  • Add nonce for widget accessibility mode. [39760-39771] #23328

Thanks to @aaroncampbell, @afercia, @afzalmultani, @Ankit K Gupta, @azaozz, @barryceelen, @ccprog, @dd32, @diddledan, @DrewAPicture, @dspilka, @F J Kaiser, @gitlost, @iandunn, @iseulde, @ixkaito, @jackreichert, @jblz, @jeremyfelt, @jnylen0, @joemcgill, @johnjamesjacoby, @kuck1u, @MaximeCulea, @Mista-Flo, @netweb, @ocean90, @pavelevap, @pbearne, @pento, @peterwilsoncc, @Presskopp, @rachelbaker, @raggedrobins, @rmccue, @runciters, @seanchayes, @SergeyBiryukov, @Soean, @swissspidy, @theMikeD, @tmatsuur, @vortfu, and @wpsmith for their contributions!

#4-8, #week-in-core

Improving the REST API users endpoint in multisite

One of the objectives for multisite is sorting how users are managed with the REST API. This was one of the agenda items for last week’s #core-multisite office hours and generated some good discussion. Here’s a wrap-up of the ideas and thoughts from that discussion.

Chat log in #core-multisite

Attendees: @iamfriendly, @johnjamesjacoby, @nerrad, @florian-tiar, @mikelking, @earnjam, @jeremyfelt

Users in multisite exist globally and are shared among sites on one or more networks. Users are associated with sites in the user meta table with a wp_#_capabilities key.

The current state of the wp-json/wp/v2/users endpoint for multisite is:

  • A POST request for a new global user to the main site creates the user and associates them with the main site only.
  • A POST request for a new global user to a sub site creates the user and associates them with the sub site only.
  • A POST request for an existing global user results in an error.
  • A PUT request for an existing global user to a sub site updates the user’s meta with a capability for that sub site.
  • A DELETE request on multisite is invalid and results in an error. See #38962.

It is not possible to remove a user from an individual site or to delete the user from the network.

Previous tickets: #38526, #39155, #38962, #39000

The following are a few thoughts expressed separately from the above summary.

  • The right way to associate existing objects over the REST API is with a PUT request.
  • The right way to disassociate existing objects is with a PUT request.
  • Linked previous discussion – “Deleting an item should always delete an item
  • We already have functions like remove_user_from_blog() and add_user_to_blog() available to us.
  • Does “add” invite or literally add? This can probably be included as data in the PUT request.
  • What happens if an API client is built for single site and then that site gets switched to multisite?
  • Handling bulk actions on an endpoint would be nice. (e.g. Add a user to multiple sites) No endpoint has implemented batch handling yet though.

Initial tasks:

  • It should be possible to remove a user from a site with a PUT request to the wp-json/wp/v2/users/# endpoint.
  • It should be possible to delete a global user with a DELETE request to the wp-json/wp/v2/users/# endpoint once all sites have been disassociated.

New tickets will be created soon for these tasks. Please leave any initial feedback in the comments on this post covering the assumptions and conclusions made above. There will be another round of discussion during tomorrow’s #core-multisite office hours at Tuesday 17:00 UTC.

/cc @rmccue and @kadamwhite

#multisite, #networks-sites, #rest-api, #users

Multisite Office Hours Recap (December 13, 2016)

Multisite office hours are held every Tuesday at 17:00 UTC in #core-multisite. The next will be Tuesday 17:00 UTC.

The weekly agenda was to discuss long-term goals for multisite and prioritize tickets to work on related to one of the three new focuses, particularly the REST API.

Today’s chat log

Attendees: @iamfriendly, @mista-flo, @johnjamesjacoby, @loreleiaurora, @johnbillion, @jeremyfelt, @flixos90

Chat Summary:

  • @jeremyfelt, @flixos90, @johnjamesjacoby, and @johnbillion sat down for a chat at WCUS to discuss multisite topics and possible future focuses. @jeremyfelt shared his notes from that session. Items of particular interest in today’s chat were:
    • Identify statistics for multisite usage, size of multisites: Possibly sending more general multisite-related metrics during core updates could be helpful and should be further discussed. In addition to whether multisite is enabled and the count of sites (on the main network) it could be helpful for future decisions to know how many sites there are in total, how many networks exist and whether user / site registration is open or not.
    • Implementation of network user roles: A ticket is in place at #39174. @flixos90 requested feedback: Everyone interested is asked to read through the ticket description and provide an elaborate response with how they think network roles should work. Then a discussion based on these approaches can start.
    • Network administrators should be able to enable themes on the site level: It is currently not very convenient for a network administrator to switch back to the network admin to enable a theme when currently working within the site admin.
    • Disable plugins per site in the network admin: Sometimes not all plugins should be visible on all networks or all sites, which is currently not possible. However, even for a disabled theme a network administrator should still be able to “silently” activate it on a site. Plugins would need to be enabled by default, so it would be the opposite way of how themes are currently handled. This also ensures there are no concerns with backward-compatibility. UI-wise an improved flow should be investigated instead of simply pursuing a similar approach to how enabling themes works: Having all the functionality inside the Network > Plugins screen would be helpful, with row and bulk actions for “Network Disable” as well as “Disable for Site…” with the latter having some kind of popover with an autocomplete field for sites. A related ticket to take into account for the implementation is #38652 which @johnbillion opened to introduce singular capabilities for managing plugins.
    • Whichever flow is agreed on for disabling plugins per site or network, once this functionality is implemented, it will probably make sense to “back-port” the behavior to improve the existing theme and maybe even user handling in a multisite.
  • At this point, the highest priority is multisite support for the REST API.
    • The users endpoint should be improved, particularly the implementation of DELETE for a user on a multisite as well as removing a user from a site or setting their capabilities per site via PUT (see #39000 and #38962 for related tickets).
    • A sites endpoint should be added.
    • A networks endpoint is not as important and should for now only live in a standalone plugin if there is interest to implement it.
  • A general question raised was how No-JS fallbacks for REST API functionality in the admin should be handled. Should JavaScript become a requirement to use such new functionality or should the REST API only be used to improve existing PHP-only features? These questions should be discussed in a broader scope than just multisite since they affect all of WP Admin.
  • Possible usage for a REST API sites endpoint:
    • Replacing “My Sites” in the toolbar with a menu that doesn’t load until needed and pulls all sites from the API.
    • The possible autocomplete field for disabling plugins for a specific site (see above) could pull sites from the API.
  • @mista-flo brought up #13743 and asked for feedback. Everyone in the chat agreed that the ability to set a default theme for a network would be a valuable enhancement over the existing constant. For the approach, introducing a new row action “Set default theme” the Network > Themes list table was suggested, alongside an indicator “Default Theme” in that same table. This is an enhancement that can be worked on beside the other important REST API features.
  • A Google document was opened a while ago to gather input for a future multisite roadmap, as a follow-up to 2013’s post. @jeremyfelt highlighted that this document should continue to move forward in order to hopefully be able to publish an actual roadmap in early January.

#4-8, #multisite, #network-sites

Week in Core, September 28 – Oct 5, 2016

Welcome back the latest issue of Week in Core, covering changes [38673-38735]. Here are the highlights:

  • 62 commits
  • 48 contributors
  • 57 tickets created
  • 9 tickets reopened
  • 77 tickets closed

Ticket numbers based on trac timeline for the period above. The following is a summary of commits, organized by component.

Code Changes

Accessibility

  • Remove target=_blank from the help tab links on several admin screens. [38725] #38145, #23432
  • Remove target=_blank from the Users and Widgets screens help tabs links. [38723] #38217, #23432
  • Remove target=_blank from the Plugins, Themes, Media, Update, and Tools screens help tabs links. [38722] #38215, #23432
  • Remove target=_blank from the Network screens help tabs links. [38721] #38159, #23432
  • Remove target=_blank from the Settings screens help tabs links. [38720] #38143, #23432
  • Remove target=_blank from the old custom background/header help tabs links. [38719] #38141, #23432
  • Remove target=_blank from the comment/edit-comments help tabs links. [38718] #38140, #23432
  • Editor, Publish meta box: remove a stray label and redundant CSS. [38700] #28411

Admin Bar

  • Remove unused ID ab-awaiting-mod from comment count. [38683] #37901

Build/Test

Comments

Customize

Editor

Embeds

Emoji

Docs

  • Improve description for term_exists() $term param. [38716] #37224
  • Correct default value for next_text in paginate_links(). [38701] #38212
  • Correct ‘Since’ version number for Cloudup in oembed_providers filter description. [38675] #38188

HTTP

HTTP API

  • Simplify wp_parse_url() to ensure consistent results. [38726] #36356
  • Add a $component parameter to wp_parse_url() to give it parity with PHP’s parse_url() function. [38694] #36356

I18N

Import

  • Fix plugin activation link after installing an importer on multisite. [38704] #37943

Media

Meus

Meta

  • Improve ID casting when getting, updating or deleting meta data. [38699] #37746

Multisite

Options

Plugins

  • Display ‘Less Than 10’ active installs of a plugin rather than ‘0+’ active installs. [38729] #37509
  • Fix odd typo introduced in [38703]. [38706] #37973
  • Fix checkbox selection when searching for installed plugins. [38703] #37973

Query

REST API

  • Add filters to allow creating REST API middleware plugins. [38689] #35590

Role/Capability

  • Add more complete capability and role assertions to existing user capability tests. Also reuses one more user account fixtures. [38732] #38236, #38235
  • Reuse some user account fixtures in the user capability tests. [38731] #38235
  • Introduce tests that assert the primitive and meta capability tests test the correct capabilities. [38697] #38191
  • Correct some meta capabilities that were incorrectly listed as primitive capabilities in the role and capability tests. [38696] #38191
  • Add explicit cases to map_meta_cap() for various meta capabilities that are used in core. This will allow more complete meta and primitive capability unit tests in #38191. [38695] #38191, #38201

Shortcodes

Taxonomy

  • Remove the popular tag cloud from edit-tags.php. [38735] #36964
  • Introduce more fine grained capabilities for managing taxonomy terms. [38698] #35614
  • Use WP_Term_Query in get_term_by(). [38677] #21760

Tests

Themes

  • Account for uppercase chars when managing themes. [38710] #37924

Toolbar

  • Be more strict about adding a ‘View Posts’ link to the toolbar. [38708] #34113

Unit Tests

  • Remove unused variable in Tests_oEmbed::dataShouldNotMatchOembedRegex(). [38714] #38187

wpLists

  • Pass the current element to process() to properly register event handlers. [38711] #38174
  • Add ‘urn’ to the list of URI protocols whitelisted by default. [38686] #37300
  • Add test for each whitelisted URI protocol in wp_allowed_protocols(). Move test from [25301] to the new file. [38685] #38198

Props

Thanks to @adamsilverstein, @afercia, @boonebgorges, @chrisjean, @dd32, @dlh, @DrewAPicture, @dshanske, @earnjam, @feedback, @flixos90, @for, @frankiet, @geekysoft, @gma992, @helen, @ipm-frommen, @iseulde, @jeremyfelt, @jnylen0, @joehoyle, @joelcj91, @joemcgill, @johnbillion, @johnjamesjacoby, @jorbin, @jrf, @Kenshino, @melchoyce, @mrahmadawais, @obenland, @ocean90, @ovann86, @pento, @peterwilsoncc, @Presskopp, @rachelbaker, @ramiy, @rianrietveld, @rmccue, @ryankienstra, @ryanplas, @SergeyBiryukov, @spacedmonkey, @sudar, @swissspidy, @truongwp, and @westonruter for their contributions!

Week in Core, September 7 – 20, 2016

Welcome back the latest issue of Week in Core, covering changes [38571-38636]. Here are the highlights:

  • 66 commits
  • 61 contributors
  • 171 tickets created
  • 15 tickets reopened
  • 106 tickets closed

Ticket numbers based on trac timeline for the period above. The following is a summary of commits, organized by component.

Code Changes

Administration

Bootstrap/Load

  • Docs: Use a third-person singular verb for wp_doing_ajax filter added in [38334]. [38607] #25669
  • Bootstrap: Use dirname() when loading class-wp-hook.php from plugin.php. [38589] #37707

Charset

  • Database: Fall back to utf8 when utf8mb4 isn’t supported. [38580] #37982

Customize

  • Add wp-util as a dependency for customize-controls. [38628] #38107
  • Remove IE8 access to customizer to discontinue support. [38627] #38021
  • Let static_front_page section be contextually active based on whether there are any published pages. [38624] #34923, #38013
  • Ensure nav menu items lacking a label use the title from the original object. [38618] #38015
  • CBetter hover/focus state for section titles and available widgets. [38602] #29158
  • Implement previewing of form submissions which use the GET method. [38587] #20714
  • Prevent widget previewing logic from building invalid jQuery selectors when sidebars are registered without a class name in before_widget. [38577] #37993

Database

  • Normalise index names in dbDelta(). [38591] #34874
  • Increase the size of wp_posts.post_password to 255 characters. [38590] #881

Formatting

  • Docs: Use a third-person singular verb for smilies filter added in [38504]. [38608] #35905
  • Update autop() to match wpautop(). [38594] #4857, #4857
  • Docs: Fix an outdated comment. [38593] #4857
  • Add an extra line break before block elements in wpautop(). [38592] #4857
  • Don’t send an HTTP status code in wp_send_json() by default. This avoids clobbering an HTTP status code that may have been set prior to calling this function. [38576] #35666

General

I18N

  • Correct context for Next/Previous strings in get_the_posts_pagination(). [38611] #37952

Media

Menus

Networks and Sites

  • Multisite: Show always domain and path when deleting a site. [38633] #37309
  • Multisite: Use get_networks() in get_main_network_id(). [38632] #37218
  • Multisite: Provide $join as a possible SQL clause to the sites_clauses filter. [38631] #37922
  • Multisite: Add annotations for extended WP_Site properties. [38630] #37932
  • Docs: Synchronize docblocks for WP_Site_Query::__construct() and get_sites() after the changes in [37735], [38008], [38103], and [38336]. [38596] #38039
  • Docs: Correct description for domain and path arguments in WP_Network_Query::__construct(). [38595] #32504

Options, Meta APIs

  • Options: Build out register_setting like register_meta. [38635] #37885

Permalinks

  • Ensure Pending Review Posts permalink posts link to the draft [38572] #37423

Plugins

  • Style the primary action link in the non-js “Installing Plugin” page. [38617] #36430
  • Tests: Use add_filter() when it’s available. [38582] #17817
  • Docs: Fix minor formatting for inline docs in WP_Hook following its introduction in [38571]. [38573] #17817
  • Hooks: Add the new class WP_Hook, and modify hook handling to make use of it. [38571] #17817

Posts, Post Types

REST API

Shortcodes

Taxonomy

  • Docs: Correct the description of {$taxonomy}_term_new_form_tag hook, making it more consistent with other *_form_tag hooks. [38629] #38104
  • Pass taxonomy name to actions in term-relationship CRUD functions. [38621] #38006
  • Query: Eliminate unnecessary wp_list_filter() call in get_queried_object(). [38586] #37962
  • Query: Avoid PHP notice in get_queried_object() when query contains NOT EXISTS tax query. [38585] #37962

Themes

  • Docs: Correct two references to plugins in the $args parameter description for themes_api(). [38623] #37939
  • Docs: Use a third-person singular verb for {$type}_template_hierarchy filter added in [38385]. [38609] #14310
  • Docs: Use a third-person singular verb in the DocBlock summary for get_theme_file_uri(), get_parent_theme_file_uri(), get_theme_file_path(), and get_parent_theme_file_path(), introduced in [38578]. [38606] #18302
  • Docs: Use a third-person singular verb for theme_file_uri, parent_theme_file_uri, theme_file_path, and parent_theme_file_path filters added in [38578]. [38605] #18302
  • Add the non-encoded form of the queried item slug to the template hierarchy when the slug contains non-ASCII characters. [38583] #37655
  • Taxonomy: Revert accidental changes introduced in [38578]. [38579] #18302
  • Improve child theme file inheritance by introducing functions for locating and fetching the URL or path to files within child and parent themes. [38578] #18302

Toolbar

  • Add a ‘View Posts’ link to the toolbar when on the post listing screen. [38634] #34113

Upgrade/Install

  • Docs: Correct a comment and @return entry in WP_Upgrader::create_lock(). [38622] #38089
  • Automatically log users in after installation. [38619] #34084

XML-RPC

  • Avoid a PHP notice in ::pingback_ping() if page title was not found. [38620] #36727
  • Check the minimum number of arguments in ::wp_getUsersBlogs() and ::blogger_getUsersBlogs(). [38600] #29750

Thanks to @aaroncampbell, @adamsilverstein, @afercia, @akibjorklund, @DMing, @BjornW, @boonebgorges, @celloexpressions, @curdin, @danielpietrasik, @dd32, @DrewAPicture, @eliorivero, @enshrined, @ericlewis, @FlorianBrinkmann, @folletto, @georgestephanis, @gma992, @helen, @hideokamoto, @hugobaeta, @ian.edington, @iandunn, @jbrinley, @jeremyfelt, @joehoyle, @joemcgill, @johnbillion, @johnjamesjacoby, @jorbin, @karmatosed, @kitchin, @knutsp, @markshep, @MaximeCulea, @melchoyce, @monikarao, @nacin, @nazgul, @obenland, @ocean90, @paulwilde, @pento, @peterwilsoncc, @RedSand, @rmccue, @rnoakes3rd, @rommelxcastro, @ryankienstra, @ryanplas, @SergeyBiryukov, @skippy, @spacedmonkey, @swissspidy, @Takahashi_Fumiki, @websupporter, @welcher, @westonrute, @westonruter, and @wonderboymusic for their contributions!

#4-7, #week-in-core

Week in Core, August 31 – September 7, 2016

Welcome back the latest issue of Week in Core, covering changes [38456-38570]. Here are the highlights:

Ticket numbers based on trac timeline for the period above. The following is a summary of commits, organized by component.

Code Changes

Accessibility

Administration

Bootstrap

Comments

Customize

  • Fix php warning due to WP_Customize_Manager::prepare_setting_validity_for_js() incorrectly assuming that WP_Error will only ever have arrays in its $error_data. [38513] #37890
  • Introduce paneVisible state and ensure pane is visible when a construct is expanded (or focused). Fixes #36678. [38492] #27403, #36678
  • Fix i18n by re-using the add_new_item post type label instead of using a post type name in a generic string. [38479] #34923, #37895
  • Use new $status_code parameter for wp_send_json_error() instead of calling status_header() separately. [38478] #35666, #37897
  • Improve handling of active state for dynamically-created controls/sections/panels. [38464] #37270

Database

  • Find the correct table names in DELETE queries with table aliases [38507] #37660

Docs

  • Update the $message parameter for _default_wp_die_handler() to notate that it can also accept a WP_Error object. [38518] #37770
  • Correct @since entry for the smilies filter added in [38504]. [38505] #35905
  • Move term_description() reference from filter docblock to get_the_archive_description() function docblock. [38495] #37259

Editor

  • fix jumpiness on pressing backspace and delete in the Text editor. Merge of [38426] to the 4.6 branch. [38487] #37690

Embeds

  • Clarify some assertion failure messages and correct a test URL for Twitter timelines. [38514] #32360
  • Update the oEmbed provider test suite. [38512] #32360

Formatting

HTTP

  • Handle an edgecase within the URI parsing library included in Requests, where if a double slash exists at the start of the path the URL is passed to cURL malformed. Merge of [38429] to the 4.6 branch. [38485] #37733
  • Accept non-string values in cookies, fixing a regression since 4.5. Merges [38430] to the 4.6 branch. [38461] #37768

HTTP API

  • Revert changes to wp_parse_url() while PHP 5.2 errors are investigated. [38456] #36356

General

  • revert [38386], functions.php was probably too tempting for some people to not load by itself. [38469] #36335
  • revert [38467], wp_is_IE() should not exist. [38468] #37699
  • use a new function, wp_is_IE(), instead of the $is_IE global in a number of places. [38467] #37699
  • use get_bloginfo( 'version' ) instead of global $wp_version in several locations – excluding those locations which reload version.php mid-flight. [38459] #37699

Help/About

  • Remove an outdated help sentence on “My Sites” screen. [38474] #37896

I18N

  • Add translator comments for XML-RPC strings with placeholders. [38510] #37792

Login and Registration

  • Change login label to Username or Email Address for clarity. [38477] #37871

Media

  • Sanitize upload filename. [38538] #

Menus

Multisite

  • Deprecate wp_get_network(). [38515] #37553
  • use get_current_site() instead of $GLOBALS['current_site'] (stop yelling!) in a few remaining spots. [38458] #37699
  • use get_current_blog_id() where applicable, in lieu of plucking the $blog_id global from outer space. [38457] #37699

Post Thumbnails

  • Prevent post thumbnail previews from spilling into other images. Merge of [38433] to the 4.6 branch. [38476] #37697

Press This

  • don’t check for already-hoisted global in press-this.php. [38466] #37699
  • in wp_ajax_press_this_save_post() and wp_ajax_press_this_add_category(), don’t check for a global instance. WP_Press_This is a Controller, but not really a Singleton. This also keeps it from being a pluggable class, which it is right now. [38465] #37699
  • in get_shortcut_link(), just check a class constant on WP_Press_This instead of instantiating the object and reading an instance prop. [38462] #37699

Query

  • ‘orderby=include’ should support comma-separated lists. [30052] assumed that ‘include’ would be an array. [38500] #37904
  • Use AND in a SQL query rather than &&. [38491] #37903
  • r38356, you were not long for this world. [38471] #37830
  • in wp_old_slug_redirect(), use get_query_var() instead of importing and touching the global $wp_query directly. [38463] #37699

Role/Capability

Script Loader

Shortcodes

Smilies

Taxonomy

  • Introduce some taxonomy capability tests in preparation for introducing more fine grained capabilities for terms. [38516] #35614
  • Introduce wp_insert_term_data and wp_update_term_data filters for altering term data before it is inserted/updated in the database. [38484] #22293
  • Correct the function description for wp_ajax_add_link_category(). [38490] #37770
  • Update various docs for parameters which are now WP_Term objects. See #14162 [38489] #37770, #14162

Template

  • After [38486], actually use the $description variable in get_the_archive_description(). [38493] #37259
  • In get_the_archive_description(), add support for author archives. [38486] #37259

Text Changes

  • Improve Error messages in XML-RPC [38509] #37792
  • Improve the timezone setting description in General Settings. Makes more clear users can set either a city or a UTC timezone offset. [38483] #34789

TinyMCE

  • fix toolbars alignment in RTL. Merge of [38349] to the 4.6 branch. [38488] #37760
  • change the default font for the vi locale to the same stack as he_IL. Merge of [38427] to the 4.6 branch. [38472] #37755

Toolbar

Upgrade/Install

  • After [37687], fix the number of params passed to the upgrade hooks. Merge of [38415] to the 4.6 branch. [38475] #37731
  • Sanitize file name in File_Upload_Upgrader. [38524] #

Upload

Users

  • After [33766], don’t reset the password when clicking “Show Password” and then “Cancel” on Add New User screen. [38494] #37902, #33419

Pass $profileuser parameter to user_profile_picture_description filter on “Edit User” screen. [38481] #37379

Widgets

  • Make the Delete/Remove links red. For consistency and accessibility, all the UI controls that perform destructive actions should be red. [38536] #35622, #37016

## Props

Thanks to @afercia, @Akeif, @akibjorklund, @andrewp, @atimmer, @azaozz, @batmoo, @boonebgorges, @celloexpressions, @Chaos, @curdin, @dd32, @deremohan, @dlh, @DrewAPicture, @Engine, @flixos90, @Frank, @fronaldaraujo, @GaryJ, @geminorum, @gitlost, @GrantDerepas, @henrywright, @ibachal, @ideag, @ionutst, @jeremyfelt, @joemcgill, @johnbillion, @johnjamesjacoby, @johnpgreen, @jorbin, @Klein, @lukecavanagh, @monikarao, @mte90, @netweb, @nmt90, @patilswapnilv, @pento, @peterwilsoncc, @PieWP, @Presskopp, @ramiy, @Rarst, @sayedwp, @scrappy@…, @SergeyBiryukov, @smerriman, @swissspidy, @TimothyBlynJacobs, @turtlepod, @westonruter, and @wonderboymusic for their contributions!

#4-1, #week-in-core

Bootstrap/Load updates in 4.6

Alert: A change was made to remove protection for overloading Plugin API related global variables in advanced-cache.php

#4-6, #bootstrap-load, #dev-notes

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 than this article is for you!

Load plugin.php earlier in wp-settings.php

plugin.php contains the functions such as add_filter() and add_action() that form the foundation of the WordPress plugin system. The file (and thus those functions) are now being loaded earlier in wp-settings.php. This allows for some hooks to be placed earlier, but also for advance-cache.php drop-ins to use the plugins API rather than directly manipulating global variables. For more information, see #36819.

Reconcile wp-settings-cli.php with wp-settings.php

Any time WordPress made a change to wp-settings.php, it inevitably broke WP-CLI. In order to allow WP-CLI to no longer need to maintain a custom fork, a handful of new hooks were added to the bootstrap process. These hooks happen before plugins load. They are designed more for non-web uses such as WP-CLI. For more information about these hooks, see #34936.

is_ssl() is now located in wp-includes/load.php

Many advanced-cache.php drop-ins duplicate is_ssl(). They will no longer need to do that as it will be available earlier in the bootstrap process. See #35844 for more info on this change.

ABSPATH can now be safely defined before WordPress is loaded

Defining ABSPATH in an auto_prepend_file will no longer cause notices to be generated. This can lead to less complexity for some WordPress specific hosts. See #26592 for more info on this change.

In conclusion

The bootstrap process provides the foundation for WordPress. It’s not pure, but dang zimit, it works. These changes are all expected to be backward compatible. Please test and report any regressions on Trac.

Thanks to the following people who contributed to the Bootstrap component this release. @jorbin @danielbachhuber @DrewAPicture @ocean90 @barry @SergeyBiryukov @johnjamesjacoby

#4-6, #bootstrap-load, #dev-notes

Week In Core, June 7 – June 15 2016

Welcome back the latest issue of Week in Core, covering changes [37659-37720]. Here are the highlights:

  • 62 commits
  • 67 contributors
  • 61 tickets created
  • 15 tickets reopened
  • 80 tickets closed

Ticket numbers based on trac timeline for the period above. The following is a summary of commits, organized by component.

Code Changes

Accessibility

Administration

  • Set a defined line-height for number type inputs to fix display issue in Safari. [37693] #37024

Bootstrap/Load

Bundled Theme

  • Twenty Ten: Revert pot changes after update test.[37715]

Canonical

Comments

  • Do not flag a comment as a duplicate if the comment_author_email is provided but not a match. [37713] #37093
  • Fix pagination totals in the response of the inline delete actions when filtering the List Table by comment_type. [37664] #36991

Customize

  • Ensure MediaControl fetches the necessary attachment data for rendering when dynamically added via JS. [37701] #36521
  • Update server-sent setting validation notifications as changes are entered. [37700] #36944

Editor

  • Prevent jumping when using the backspace button in the Text editor in Firefox and IE. [37684] #37072
  • quickTags: when the user selects some text by triple-clicking, then wraps it in a tag, and the last selected char is \n, insert the closing tag before the line break. [37661] #29571
  • Adjust the sidebar position when moving a postbox from one column to another. [37659] #35230

Embeds

Formatting

  • Docs: Add extensive documentation to the remove_accents() DocBlock outlining the accented characters core replaces. 37669] #34677

General

  • After [37702], correct the expected result in test_size_format(). [37705] #37037
  • In size_format() and wp_convert_bytes_to_hr(), replace kB with KB for consistency with other units. [37702] #37037
  • Docs: Replace HTTP links with HTTPS. [37674] #36993
  • Docs: Improve the DocBlock summary for add_theme_support(). [37673] #32246
  • Docs: Add documentation for the variadic second parameter, $args, accepted by add_theme_support(). [37672] #37067
  • Docs: Improve documentation for the $feature parameter in the DocBlock for add_theme_support(). [37671] #32246, #37067

HTTP API

I18N

  • Revert the test added in [37716], as it causes errors when running the full suite. [37718] #36790
  • Adjust the regex in wp_maybe_decline_date() to handle word boundaries correctly. [37717] #36790
  • Add a unit test for wp_maybe_decline_date(). [37716] #36790
  • Add context and translator comments to Back to %s strings. [37703] #37095
  • In remove_accents(), add support for de_CH and de_CH_informal. [37698] #37076
  • Simplify the WordPress update notice for translators. [37675] #35721

Login and Registration

  • Fire wp_no_robots() in wp_die() only if function exists. This covers cases where wp_die() is used before general-template.php is loaded. [37689] #34401

Media

Networks and Sites

  • Docs: Update the documentation for get_site() and the get_site filter following the removal of the $output parameter in [37652]. [37699] #35791
  • Use to_array() method on WP_Site objects in wp_get_sites(). [37667] #36717
  • Introduce get_current_network_id(). [37670] #33900
  • Tests: Split get_blog_details() test into individual tests [37666] #36566
  • Tests: Move get_blog_details() tests to their own file [37665] #36566
  • Tests: User a data provider for wp_get_sites() tests. [37662] #36566
  • Tests: Move wp_get_sites() tests to their own file [37660] #36566
  • Avoid a PHP notice in get_permalink() if default category is unavailable. [37707] #36529

Plugins

  • Normalize WP_PLUGIN_DIR in the test added in [37332], otherwise it fails on Windows. [37719] #29154
  • Fix edge-case where the tab=upload page can be accessed directly. [37681] #35429

Posts, Post Types

  • Docs: Improve the return description for wp_get_post_categories() to include more information about possible return values. [37686] #37002

Query

  • After [37692], don’t skip set_found_posts() when no posts are found. [37712] #36687
  • Allow plugins to supply post results instead of having WP_Query fetch them from the database. [37692] #36687
  • Docs: Improve first-order clause documentation for the $meta_query parameter in the constructor for WP_Meta_Query. [37688] #32659

Taxonomy

  • Introduce a redirect_term_location filter to change the redirect on term editing. [37696] #36367
  • More specific cap check when processing category data on post save. [37691] #36379
  • Introduce term_taxonomy_id parameter for WP_Term_Query. [37683] #37074
  • Tests: Move WP_Tax_Query tests to a more appropriate file. [37682] #37074

Text Changes

  • Text Changes: Simplify two strings in wp_password_change_notification(). [37704] #35736

Themes

  • Make default “read more” link more accessible. [37706] #36572

TinyMCE

Upgrade/Install

Users

  • Embeds: In WP_oEmbed::get_provider() and WP_oEmbed::get_html(), parse the $args string to an array, as we treat it as an array later. [37720] #37071
  • wp_signon() expects an array as the $credentials argument, not a string. [37697] #37071
  • Stop WP_List_Table notices from persisting on pagination navigation. [37663] #35620

Thanks to @flixos90, @adamsilverstein, @AdamSoucie, @afercia, @afragen, @alexvandervegt, @azaozz, @boonebgorges, @dashaluna, @dd32, @dlh, @DrewAPicture, @EFAREM, @ethitter, @flixos90, @grapplerulrich, @Ipstenu, @iseulde, @j-falk, @jeherve, @jeremyfelt, @jipmoors, @jnylen0, @joelwills, @joemcgill, @john_schlick, @johnbillion, @johnjamesjacoby, @johnpgreen, @joostdevalk, @jorbin, @JoshuaGoodwin, @azaozz, @jpdavoutian, @Kau-Boy, @khag7, @kraftbj, @mapk, @melchoyce, @michael-arestad, @obenland, @ocean90, @odysseygate, @pansotdev, @paulwilde, @pento, @peterwilsoncc, @Presskopp, @rachelbaker, @ramiy, @ramiy, @rmccue, @ronalfy, @ryelle, @semil, @SergeyBiryukov, @simonvik, @spacedmonkey, @stephdau, @svovaf, @swissspidy, @TimothyBlynJacobs, @tlovett1, @westonruter, and @zakb8 for their contributions!

#4-6, #week-in-core