Week in Core: Sept. 28 – Oct. 11, 2015

Welcome back to the latest issue of Week in CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress., covering changes from Sept. 28 – Oct. 11, 2015, changesets [34659][35029]. Here are the highlights:

https://make.wordpress.org/core/2015/10/07/%F0%9F%8E%89-one-more-committer-for-4-4/

See that ↑ right there? That’s an oEmbed. And it’s loaded from inside this site.

Feature Plugins Merged

The Responsive Images, oEmbed Provider, and the “baby” REST API feature plugins have been merged into core. Grab the latest version of trunktrunk A directory in Subversion containing the latest development code in preparation for the next major release cycle. If you are running "trunk", then you are on the latest revision. and test them out.

WordPress logo with wordmark below

Responsive images in your posts. Just upload and insert!

Potent Notables

These changes were big enough to merit their own blogblog (versus network, site) posts:

Deeper Reading

Some commits pack in a lot of info, from detailed background to best practices in using hooksHooks In WordPress theme and development, hooks are functions that can be applied to an action or a Filter in WordPress. Actions are functions performed when a certain event occurs in WordPress. Filters allow you to modify certain functions. Arguments used to hook both filters and actions look the same.. Here are a few worth reading the entire commit message:

  • WP_Term class introduced [34997] #14162
  • Fix scalability performance problem for previewing multidimensional settings in the CustomizerCustomizer Tool built into WordPress core that hooks into most modern themes. You can use it to preview and modify many of your site’s appearance settings.. [35007] #32103
  • Ensure that wp.customize.Widgets.savedWidgetIds is defined up front. [34883] #33901
  • The history and implementation of oEmbeds. [34903] #32522
  • Improve role-related arguments in WP_User_Query. [34875] #22212
  • Use wp_installing() instead of WP_INSTALLING constant. [34828] #31130
  • Introduce *_network_option functions for Multisitemultisite Used to describe a WordPress installation with a network of multiple blogs, grouped by sites. This installation type has shared users tables, and creates separate database tables for each blog (wp_posts becomes wp_0_posts). See also network, blog, site installs. [34777] #28290
  • Ensure that comment permalinks reflect pagination. [34735] #34068, #34073

Code Changes

Functions, hooks, and parameters, oh my!

  • Multisite: Adjust _network_option() parameter order, $network_id is first. [35024] #28290
  • Multisite: Allow for a blog_upload_space setting of 0 to restrict uploads. [35016] #19538, #34037
  • Multisite: Introduce get_subdirectory_reserved_names(), which returns a filterable list of reserved subdirectory site names. [34854] #33615
  • Template: Introduce a new class_form argument in comment_form(), allowing customization of the form class attribute. [34871] #34170, #23851
  • Template: Make it possible to both add and remove items from the page templates list using the theme_page_templates filterFilter Filters are one of the two types of Hooks https://codex.wordpress.org/Plugin_API/Hooks. They provide a way for functions to modify data of other functions. They are the counterpart to Actions. Unlike Actions, filters are meant to work in an isolated manner, and should never have side effects such as affecting global variables and output.. [34995] #13265, #25879
  • Template: Rename the $id parameters in the_permalink(), get_the_permalink(), and get_permalink() to $post. [35001] #34234
  • Template: Pass the $post parameter to the the_permalink filter. [35002] #34234, #23882
  • Template: Introduce a new class_form argument in comment_form(), allowing customization of the form class attribute. [34871] #34170, #23851
  • Terms: Don’t require a $taxonomy to be specified in get_term_field(). [35028] #34245
  • Terms: Return WP_Post objects from wp_get_object_terms(). [34999] #14162
  • Media: Introduce the admin_post_thumbnail_size filter, which enables manipulation of the image size used to display the post thumbnail in the ‘Featured ImageFeatured image A featured image is the main image used on your blog archive page and is pulled when the post or page is shared on social media. The image can be used to display in widget areas on your site or in a summary list of posts.metaMeta Meta is a term that refers to the inside workings of a group. For us, this is the team that works on internal WordPress sites like WordCamp Central and Make WordPress. box. [35022] #28512
  • Media: New and updated media functions as part of Responsive Images feature pluginFeature Plugin A plugin that was created with the intention of eventually being proposed for inclusion in WordPress Core. See Features as Plugins. merge: [34855] #12, #33641
    • wp_get_attachment_image_srcset_array()
    • wp_get_attachment_image_srcset()
    • wp_get_attachment_image_sizes()
    • wp_make_content_images_responsive()
    • wp_img_add_srcset_and_sizes()
    • wp_make_content_images_responsive()
    • wp_get_attachment_image()
    • get_media_embedded_in_content()
  • Permalinks: Add $id parameter to the_permalink(), for consistency with get_permalink(). [34982] #23882
  • Embeds: Rename the $return parameter in wp_filter_oembed_result() to $result to provide better context on what is being filtered. [34974] #32522
  • Embeds: Combine the oembed_minwidth and oembed_maxwidth filters into one, similar to how the existing oembed_defaults works for width and height. [34972] #32522, #34227
  • Administration: Add the ability to pass an array of screen IDs to add_meta_box() and remove_meta_box(). [34951] #15000
  • Posts: Add the pre_get_lastpostmodified filter to get_lastpostmodified(). [34935] #34205
  • Passwords: Move the code for creating password reset key into a new function, get_password_reset_key(), and use it in retrieve_password(). [34923] #34180
  • RevisionsRevisions The WordPress revisions system stores a record of each saved draft or published update. The revision system allows you to see what changes were made in each revision by dragging a slider (or using the Next/Previous buttons). The display indicates what has changed in each revision.: Pass the $post parameter to the _wp_post_revision_fields filter. The _wp_post_revision_fields() function now also accepts a WP_Post object as part of this change. [34917] #13382
  • Revisions: Add a wp_post_revision_title_expanded filter. [34842] #9681
  • Revisions: Also pass the $revision post object to the wp_prepare_revision_for_js filter, introduced in [34541]. [34832] #28627
  • Add an optional $description parameter to status_header() so custom HTTPHTTP HTTP is an acronym for Hyper Text Transfer Protocol. HTTP is the underlying protocol used by the World Wide Web and this protocol defines how messages are formatted and transmitted, and what actions Web servers and browsers should take in response to various commands. status descriptions can be provided. [34914] #21472
  • Meta Boxes: add an action, post_submitbox_minor_actions. post_submitbox_misc_actions already exists. Pass $post to both for context – avoids having to check for a global post. [34895] #26267
  • Introduce wp_get_server_protocol() to DRY protocol parsing logic and make adding more protocols, like HTTP/2, easier. [34894] #34131
  • List Tables/WP_Screen: in WP_Screen, add methods to store, retrieve, and render screen reader text, primarily used by list table screens. [34891] #32147
  • Login: Pass the $errors object as a parameter to the lostpassword_post hook. [34885] #32116
  • Transients: Add (then rename) new filters: [34865] [34877] #21330
    • expiration_pre_set_transient_$transient => expiration_of_transient_$transient
    • expiration_pre_set_site_transient_$transient => expiration_of_site_transient_$transient
  • Shortcodes: Pass the name as context for shortcode_atts_{$shortcode}. [34868] #34167
  • XML-RPC: allow wp_xmlrpc_server::wp_getPosts() to receive s as a filter. [34860] #25406
  • Installation: Introduce wp_installing() and use it in place of WP_INSTALLING constant. [34828] #31130
  • Introduce ‘page_of_comment’ filter. [34808] #13939
  • Users: Introduce the users_list_table_query_args filter, for modifying the WP_User_Query arguments used within the prepare_items() methods in the users list tables. [34796] #25360
  • Plugins: Remove the unnecessary dynamic prefix used in the plugin_action_links filter name, and in those of its brethren. This way, network_admin_plugin_action_links gets listed as a separate filter. [34786] #34117
  • Menus: Introduce the wp_add_nav_menu_item action, fired immediately after a new nav menu item has been added. [34769] #30983
  • Menus: Add 'submenu_file' filter for the file of an adminadmin (and super admin) menu sub-menu item. [34722] #24531
  • Themes: Introduce three new arguments for get_the_post_navigation(): in_same_term, excluded_terms, and taxonomy. [34715] #32618
  • Users: Introduce the wp_dropdown_users_args filter, making it possible to filter the arguments for wp_dropdown_users() before the query is run. [34692] #19867
  • Archives: Allow wp_get_archives() to accept post_type as an arg. [34686] #21596
  • Authors: Introduce get_the_author_posts_link(), which returns the HTMLHTML HyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. link to the author page for the current post’s author. [34677] #30355
  • Widgets: Pass $instance to the widget_nav_menu_args filter in the Custom Menu widgetWidget A WordPress Widget is a small block that performs a specific function. You can add these widgets in sidebars also known as widget-ready areas on your web page. WordPress widgets were originally created to provide a simple and easy-to-use way of giving design and structure control of the WordPress theme to the user.. [34662] #33944
  • Dashboard: Introduce the dashboard_recent_drafts_query_args filter, making it possible to manipulate the post query arguments used in the ‘Recent Drafts’ dashboard widget. [35003] #8243
  • Deprecate force_ssl_login(), which is simply a wrapper for force_ssl_admin() and is not used in core. [34700] #34011
  • Deprecate create_empty_blog() which has never been used in core. [34753] #34120

Potpourri

  • External Libraries: update plupload to 2.1.8. [35019] #34251, #22403
  • External Libraries: update json2.js to the 2015-05-03 version. [34863] #26913
  • Use PHP7’s random_int() CSPRNG functionality in wp_rand() with a fallback to the random_compat library for PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 5.6.20 or higher 5.x. [34981] #28633
  • Multisite: Make “Create a New Site” link consistent with other “Add New” links. [34979] #34179
  • Database: After [34529], if a compatible termmeta table is found on database upgrade, convert it to utf8mb4 collation. [34978] #34224
  • WPDB: Allow null values in the CRUDCRUD Create, read, update and delete, the four basic functions of storing data. (More on Wikipedia.) functions. [34737] #15158
  • Users: On the Users list table, show all the roles of a user in a comma-separated list if they have more than one role. This prevents role obfuscation in situations where a user has had more than one role programmatically assigned to them. [34963] #22959
  • Make $blog_id explicitly global. [34961] #34217
  • WP_User_Query role improvement redux. [34959] #22212
  • Search: Allow excluded keywords when searching posts. [34934] #33988
  • Build Tools: upgrade grunt-browserify to ~4.0.0 and remove the watch task for browserify, which has its own internal watcher. Run npm install to update. [34888] #31911
  • Templates: Add single-{post_type}-{post_name}.php to the top of the template hierarchy for single posts. [34800] #18859
  • Multisite: Provide better UIUI User interface when a main site’s /blog prefix is changed. [34749] #12002
  • Comments: TrashTrash Trash in WordPress is like the Recycle Bin on your PC or Trash in your Macintosh computer. Users with the proper permission level (administrators and editors) have the ability to delete a post, page, and/or comments. When you delete the item, it is moved to the trash folder where it will remain for 30 days. blacklisted comments by default. [34726] #7051
  • Permalinks: Add pretty permalinks for unattached attachments. [34690] #1914
  • Rewrite: Redirect attachment URLs when their slug changes. [34685] #34043
  • Rewrite: When redirecting old slugs, include URLURL A specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org endpoints. [34659] #33920
  • RSS Widget: add a class, rss-widget-icon, to the RSS icon to allow devs to hide it. Not going to remove to not break visual BC. [34683] #22010
  • Edit: Remove the redundant “View Post” button-link and link the sample permalink. [34670] #18306

Props

Thanks to @adamsilverstein, @afercia, @akibjorklund, @alecuf, @alisspers, @amandato, @ankit-k-gupta, @austinginder, @azaozz, @barryceelen, @barrykooij, @benjaminpick, @bobbingwide, @boonebgorges, @bpetty, @ch1902, @ChaseWiseman, @chipbennett, @chriscct7, @chriscoyier, @ChrisMKindred, @chrisvendiadvertisingcom, @Clorith, @cmmarslender, @codebykat, @codfish, @coffee2code, @coliff, @danielbachhuber, @davidbhayes, @davidbinda, @dboulet, @dd32, @Denis-de-Bernard, @desrosj, @DH-Shredder, @dimadin, @dipeshkakadiya, @dlh, @dmchale, @dmenard, @drebbitsweb, @DrewAPicture, @eliorivero, @ericjuden, @ericlewis, @ericpedia, @extendwings, @F4rkie, @flixos90, @frozzare, @fsylum, @GaryJ, @gezamiklo, @gounder, @GregLone, @gwinhlopez, @hakre, @helen, @hubdotcom, @hugobaeta, @hurtige, @iamfriendly, @igmoweb, @ironpaperweight, @iseulde, @janhenckens, @japh, @jaredcobb, @jaspermdegroot, @jdgrimes, @jdolan, @JeffMatson, @jeremyfelt, @jim912, @jjeaton, @jmayhak, @jmusal, @joedolson, @joehoyle, @joemcgill, @johnbillion, @JohnDittmar, @johnjamesjacoby, @jonathanbardo, @joostdevalk, @jorbin, @joshkadis, @jrfnl, @juliobox, @justdaiv, @justinsainton, @kadamwhite, @karinedo, @kawauso, @kellbot, @kingkool68, @kokarn, @kraftbj, @kwight, @laceous, @lessbloat, @madalinungureanu, @markoheijnen, @matrixik, @mattbagwell, @mattheu, @maxcutler, @mazurstas, @mdgl, @mdmcginn, @mehulkaklotar, @melchoyce, @meloniq, @mgibbs189, @micahmills, @michael-arestad, @MikeHansenMe, @miqrogroove, @misterunknown, @mordauk, @mrahmadawais, @nacin, @natewr, @nbachiyski, @neoscrib, @netweb, @nikv, @norcross, @obenland, @ocean90, @oso96_2000, @paulwilde, @pavelevap, @pento, @peterwilsoncc, @pfefferle, @phh, @pkevan, @pollyplummer, @pushred, @quasel, @QWp6t, @rachelbaker, @ramay, @redsweater, @rilwis, @rmccue, @ryanmarkel, @ryelle, @sabreuse, @sarciszewski, @scribu, @SergeyBiryukov, @serpent7776, @shelob9, @shprink, @side777, @simonlampen, @sirbrillig, @smerriman, @solarissmoke, @sorich87, @spacedmonkey, @spmlucas, @stephenharris, @swissspidy, @tapsboy, @tevko, @tfrommen, @thenbrent, @thiago-negri, @tivnet, @tlovett1, @tobych, @Toddses, @tomsommer, @tott, @traversal, @tryon, @tyxla, @umeshnevase, @utkarshpatel, @walterbarcelos, @webord, @welcher, @westonruter, @wonderboymusic, @wpsmith, @wturrell, and @zrothauser for your contributions!

#4-4, #week-in-core