Welcome back 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 [38274-38345]. Here are the highlights:
- 72 commits
- 40 contributors
- 100 tickets created
- 9 tickets reopened
- 96 tickets closed
Ticketticket Created for both bug reports and feature development on the bug tracker. numbers based on trac timeline for the period above. The following is a summary of commits, organized by component.
Code Changes
Administration
- Allow for
.nav-tab-wrapperclass to be used on elements other thanh3to increase flexibility for custom settings pages. [38306] #37257
AJAX
- add a new function,
wp_doing_ajax(), which can replace… (wait for it…)DOING_AJAXchecks via the constant. [38334] #25669
Bootstrap/Load
- Include PluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party. APIAPI An API or Application Programming Interface is a software intermediary that allows programs to interact with each other and share data in limited, clearly defined ways. via
require_once. [38282] #37707
Cache
- in
WP_Object_Cache,$cache_missesis public, but$cache_hitsis private. They should both bepublic, because they’re useful for debugging purposes. [38335] #37726
Comments
- in
wp_handle_comment_submission(),$_wp_unfiltered_html_commentis passed as part of$comment_data, but is not used locally. [38313] #37771 - in
WP_Comment_Query::fill_descendants(),continueif there is an empty array in the loopLoop The Loop is PHP code used by WordPress to display posts. Using The Loop, WordPress processes each post to be displayed on the current page, and formats it according to how it matches specified criteria within The Loop tags. Any HTML or PHP code in the Loop will be processed on each post. https://codex.wordpress.org/The_Loop. [38298] #37416 - in
WP_Comment_Query::fill_descendants(), computecount()in the firstforexpression so that it does not run on each iteration. [38297] #37416
Customize
- Ensure a newly-added custom link nav menu item has the appropriate CSSCSS Cascading Style Sheets. class names. [38301] #37575
Database
WP_Network,WP_Network_Query, andWP_Site_Querycallwpdb::_escape(), thus requiring it to bepublic. It previously had no access modifier._at the beginning of a method, believe it or not, does not enforce visibility constraints. [38314] #37771
Docs
- Update jsdoc in
customize-nav-menus.jsto remove references to Menu 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. plugin. Also fix@paramforupdateAssignedLocationsInSectionTitle. [38300] #37520 - Update outdated phpdocPHPDoc (docblock, inline docs) for
WP_Customize_Manager::validate_setting_values()to reflect changes in [37942]. [38299] #37247, #37759 - Correct usage examples for
wpdb::prepare(), which should not be called statically. [38289] #37744 - Fix typo in
load_plugin_textdomain()parameter description. [38284] #37318
Embeds
- In
get_oembed_endpoint_url(), avoid inadvertent stomping of the$formatparameter passed tooembed_endpoint_urlfilterFilter 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.. [38321] #37751
External Libraries
- Update minified version of jquery.masonry.js. Merge of [38276] and [38281] to the 4.6 branchbranch A directory in Subversion. WordPress uses branches to store the latest development code for each major release (3.9, 4.0, etc.). Branches are then updated with code for any minor releases of that branch. Sometimes, a major version of WordPress and its minor versions are collectively referred to as a “branch”, such as “the 4.0 branch”.. [38339] #37720, #37666
- Update to Requests master (fb5b517) which corrects a logic inversion in the cURL transport checks. Merge of [38274] to the 4.6 branch. [38338] #37700
- Fix jshint of Gruntfile.js. Introduced in [38276] [38281] #37720
- Update Minified version of jquery.masonry.js [38276] #37720, #37666
General
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.
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.
- in
WP_HTTP_Response, the@paramdeclarations for$statusand$headerswere swapped. Let us correct this. [38315] #37771
I18Ni18n Internationalization, or the act of writing and preparing code to be fully translatable into other languages. Also see localization. Often written with a lowercase i so it is not confused with a lowercase L or the numeral 1. Often an acquired skill.
- Add translator comments for strings in
wp-includes/functions.wp-scripts.php. [38345] #37803 - Add translator comments for strings in
wp-includes/functions.php. [38344] #37802 - Add translator comments for strings in
wp-includes/deprecated.php. [38343] #37797 - Add translator comments for strings in
wp-includes/class-walker-comment.php. [38342] #37796 - Add translator comments for strings in
wp-includes/author-template.php. [38341] #37795 - Add translator comments for strings in
wp-includes/admin-bar.php. [38340] #37794 - Remove unnecessary context for two strings on “Add New User” screen. [38329] #37784
- Remove unnecessary context in
wp_post_revision_title_expanded(). [38327] #37781 - Use a consistent context for “Add New” submenu strings in adminadmin (and super admin) bar (Toolbar). [38326] #37780
- Allow for WordPress Plugin/Theme Directory URLs to be localized. [38325] #37501
- Replace unnecessary context with translator comments in
wp_post_revision_title()andwp_post_revision_title_expanded(). [38324] #37778 - Replace unnecessary context with a translator comment for
%s Sitesstring innetwork_step1(). [38323] #37777 - Replace unnecessary context with a translator comment for
%s KBstring on Networknetwork (versus site, blog) Settings screen. [38322] #37496 - Add translator comments for
Edit Site: %sstring in network admin. [38320] #37776
LocaleLocale A locale is a combination of language and regional dialect. Usually locales correspond to countries, as is the case with Portuguese (Portugal) and Portuguese (Brazil). Other examples of locales include Canadian English and U.S. English.
Login
- If post-by-email functionality is disabled,
wp-mail.phpshould return a403 Forbiddenstatus code instead if500 Internal Server Error. [38332] #37572 - Don’t set Sender field when setting From. Merges [38286] to the 4.6 branch. [38287] #37736
- Don’t set Sender field when setting From. [38286] #37736
Media
- remove
function_exists()call forini_get()in_load_image_to_edit_path(). [38333] #37681 - remove unnecessary variable assignment in
gallery_shortcode(). [38309] #37771 - add a function,
wp_get_additional_image_sizes(), that wraps the retrieval of the global$_wp_additional_image_sizes. Removes 6 global imports. [38303] #37699 - fix unit testunit test Code written to test a small piece of code or functionality within a larger application. Everything from themes to WordPress core have a series of unit tests. Also see regression. after [38296].
- use
wp_get_attachment_metadata()instead ofget_post_meta()where appropriate. [38296] #36246 wp_get_attachment_link()fails to output text for non-images if the attachment post doesn’t have a title and$text(argument #5) was not passed to the func. In this case, use the filename. [38295] #5, #37343- when calling
pathinfo(), also pass aPATHINFO_*constant to avoid array notices for unset keys. [38294] #37608 - Add some docs to
media-gallery.jsRIP. [38293] #37717
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
Nav Menus
Query
- use correct description in the docblockdocblock (phpdoc, xref, inline docs) for
$numberinWP_Comment_Query,WP_Network_Query, andWP_Site_Query. [38336] #37621 - Non-scalar and negative values for ‘p’ should always result in a 404. [38288] #33372
- use composition for
$dbinWP_Date_Query, removes need to importglobal $wpdbin multiple methods. [38280] #37699 - use composition for
$dbinWP_Query, removes need to importglobal $wpdbin multiple methods. [38279] #37699 - add a
protectedfield,$db, (composition, as it were) toWP_*_Queryclasses to hold the value for the database abstraction, instead of importing theglobal $wpdbinto every method that uses it. Reduces the number of global imports by 32. [38275] #37699
REST APIREST API The REST API is an acronym for the RESTful Application Program Interface (API) that uses HTTP requests to GET, PUT, POST and DELETE data. It is how the front end of an application (think “phone app” or “website”) can communicate with the data store (think “database” or “file system”)
https://developer.wordpress.org/rest-api/
TaxonomyTaxonomy A taxonomy is a way to group things together. In WordPress, some common taxonomies are category, link, tag, or post format. https://codex.wordpress.org/Taxonomies#Default_Taxonomies.
- in
get_terms(), do not assume that legacy args are being passed when the only params are top-levelmeta_*values. Add keys inWP_Term_Query::__construct(). Adds unit tests. [38337] #37568 - remove unnecessary
breakinWP_Term::__get(). [38312] #37771 - In
is_object_in_term(), return error object rather than caching it. [38277] #32044, #36814, #37721 - Allow attachment taxonomies to be fetched as objects. [38292] #37368
Tests
- Fix incorrect variable name from [38330]. [38331] #37630
- Attachment
create()method should match signature of othercreate()methods. Legacy argument format continues to be accepted. [38330] #37630 - Move some utility classes to their own files. [38285] #37523
- skip checking the value in
Tests_User:test_user_propertiesfordb. Casting toarrayis not the most elegant thing here, and various versions of PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 7.4 or higher key protected/private fields differently when objects are cast. [38278] #37699 - Introduce tests for
get_attachment_taxonomies(). [38291] #37368 - Introduce tests for
get_object_taxonomies(). [38290] #37368 - Add wordpress-importer tests demonstrating slashed data behavior. [38283] #21007
TinyMCE
- make sure the temporary id is removed when using the default image dialog and inserting an external image. [38328] #37467
Users
- after [38317], use a
@propertyannotation, instead of apublicfield. [38319] #37771 $user_levelhas been publicly-accessed on instances ofWP_Usersince version 2.0, but is has never been declared. [38317] #37771
Widgets
$option_nameand$alt_option_namehave been used as members ever sinceWP_Widgetbecame an object in 2.8, but never declared. [38318] #37771
Props
Thanks to @afercia, @Akeif, @azaozz, @bcole808, @boonebgorges, @Clorith, @codemovementpk, @danhgilmore, @danielbachhuber, @dd32, @deremohan, @dlh, @DrewAPicture, @flixos90, @fomenkoandrey, @Frank, @gma992, @henrywright, @iandunn, @imath, @JaworskiMatt, @jipmoors, @Jonnyauk, @jorbin, @JorritSchippers, @Klein, @kouratoras, @Mte90, @Presskopp, @ramiy, @rpayne7264, @sebastianpisula, @SergeyBiryukov, @swissspidy, @tivnet, @TJNowell, @tomdxw, @vishalkakadiya, @westonruter, and @wonderboymusic for their contributions!