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:
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.
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:
add_rewrite_rule()accepts an array of query vars in WordPress 4.4single-{post_type}-{post_name}.php: New theme template in WordPress 4.4
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_Termclass 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.savedWidgetIdsis 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 ofWP_INSTALLINGconstant. [34828] #31130 - Introduce
*_network_optionfunctions 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_idis first. [35024] #28290 - Multisite: Allow for a
blog_upload_spacesetting 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_formargument incomment_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_templatesfilterFilter 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
$idparameters inthe_permalink(),get_the_permalink(), andget_permalink()to$post. [35001] #34234 - Template: Pass the
$postparameter to thethe_permalinkfilter. [35002] #34234, #23882 - Template: Introduce a new
class_formargument incomment_form(), allowing customization of the form class attribute. [34871] #34170, #23851 - Terms: Don’t require a
$taxonomyto be specified inget_term_field(). [35028] #34245 - Terms: Return
WP_Postobjects fromwp_get_object_terms(). [34999] #14162 - Media: Introduce the
admin_post_thumbnail_sizefilter, 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
$idparameter tothe_permalink(), for consistency withget_permalink(). [34982] #23882 - Embeds: Rename the
$returnparameter inwp_filter_oembed_result()to$resultto provide better context on what is being filtered. [34974] #32522 - Embeds: Combine the
oembed_minwidthandoembed_maxwidthfilters into one, similar to how the existingoembed_defaultsworks for width and height. [34972] #32522, #34227 - Administration: Add the ability to pass an array of screen IDs to
add_meta_box()andremove_meta_box(). [34951] #15000 - Posts: Add the
pre_get_lastpostmodifiedfilter toget_lastpostmodified(). [34935] #34205 - Passwords: Move the code for creating password reset key into a new function,
get_password_reset_key(), and use it inretrieve_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#13382$postparameter to the_wp_post_revision_fieldsfilter. The_wp_post_revision_fields()function now also accepts aWP_Postobject as part of this change. [34917]- Revisions: Add a
wp_post_revision_title_expandedfilter. [34842] #9681 - Revisions: Also pass the
$revisionpost object to thewp_prepare_revision_for_jsfilter, introduced in [34541]. [34832] #28627 - Add an optional
$descriptionparameter tostatus_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_actionsalready exists. Pass$postto 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, likeHTTP/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
$errorsobject as a parameter to thelostpassword_posthook. [34885] #32116 - Transients: Add (then rename) new filters: [34865] [34877] #21330
expiration_pre_set_transient_$transient=>expiration_of_transient_$transientexpiration_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 receivesas a filter. [34860] #25406 - Installation: Introduce
wp_installing()and use it in place ofWP_INSTALLINGconstant. [34828] #31130 - Introduce ‘page_of_comment’ filter. [34808] #13939
- Users: Introduce the
users_list_table_query_argsfilter, for modifying theWP_User_Queryarguments used within theprepare_items()methods in the users list tables. [34796] #25360 - Plugins: Remove the unnecessary dynamic prefix used in the
plugin_action_linksfilter name, and in those of its brethren. This way,network_admin_plugin_action_linksgets listed as a separate filter. [34786] #34117 - Menus: Introduce the
wp_add_nav_menu_itemaction, 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, andtaxonomy. [34715] #32618 - Users: Introduce the
wp_dropdown_users_argsfilter, making it possible to filter the arguments forwp_dropdown_users()before the query is run. [34692] #19867 - Archives: Allow
wp_get_archives()to acceptpost_typeas 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
$instanceto thewidget_nav_menu_argsfilter 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_argsfilter, 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 forforce_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.jsto the2015-05-03version. [34863] #26913 - Use PHP7’s
random_int()CSPRNG functionality inwp_rand()with a fallback to therandom_compatlibrary for PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 7.4 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
termmetatable is found on database upgrade, convert it toutf8mb4collation. [34978] #34224 - WPDB: Allow
nullvalues 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_idexplicitly global. [34961] #34217 WP_User_Queryrole improvement redux. [34959] #22212- Search: Allow excluded keywords when searching posts. [34934] #33988
- Build Tools: upgrade
grunt-browserifyto~4.0.0and remove thewatchtask forbrowserify, which has its own internal watcher. Runnpm installto update. [34888] #31911 - Templates: Add
single-{post_type}-{post_name}.phpto the top of the template hierarchy for single posts. [34800] #18859 - Multisite: Provide better UIUI User interface when a main site’s
/blogprefix 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!