Commit Graph

19079 Commits

Author SHA1 Message Date
Peter Wilson
33b6697191 Formatting: Account for HTML entities in wp_extract_urls().
Prevent `wp_extract_urls()` trimming HTML entities within URLs. Correctly escaped URLs such as https://youtube.com/watch?v=dQw4w9WgXcQ&t=1 will now be extracted as https://youtube.com/watch?v=dQw4w9WgXcQ&t=1 rather than truncated.

Props trex005, voldemortensen, johnbillion, ironprogrammer, costdev, hellofromtonya.
Fixes #30580


Built from https://develop.svn.wordpress.org/trunk@53044


git-svn-id: http://core.svn.wordpress.org/trunk@52633 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-01 03:40:02 +00:00
Peter Wilson
be3aa9a149 Canonical: Include all public status in 404 redirects.
In `redirect_guess_404_permalink()` search for posts using all publicly queryable statuses rather than limiting options to the `publish` status.

Props goaroundagain, costdev, htdat, audrasjb, chaion07.
Fixes #47911.


Built from https://develop.svn.wordpress.org/trunk@53043


git-svn-id: http://core.svn.wordpress.org/trunk@52632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-01 03:25:01 +00:00
Peter Wilson
dc07d3ca67 Posts, Post Types: Set post filter in update_post_cache().
Ensure the post cache is primed with raw sanitized data. This resolves an inconsistency between how posts retrieved via `get_post()` vs `WP_Query` are cached.

This prevents `sanitize_post( $post, 'raw' )` being run multiple times on a cached post. This can happen over 20 times per post on some page loads so avoiding this will provide a noticeable performance boost.

Props Cybr, SergeyBiryukov, peterwilsoncc, hellofromTonya, costdev.
Fixes #50567.


Built from https://develop.svn.wordpress.org/trunk@53042


git-svn-id: http://core.svn.wordpress.org/trunk@52631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-01 03:18:05 +00:00
joedolson
9131d74641 Login and Registration: Add autocomplete attributes.
Set valid autocomplete attributes for registration and login fields for username, email, and current password. Autocomplete values are required in WCAG 2.1 at level AA for login forms.

Props johnjamesjacoby, dhanendran, rianrietveld, joedolson, peterwilsoncc.
Fixes #41136.

Built from https://develop.svn.wordpress.org/trunk@53041


git-svn-id: http://core.svn.wordpress.org/trunk@52630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-31 17:13:01 +00:00
Sergey Biryukov
18fd303a61 Docs: Add missing descriptions for WP_List_Table::get_items_per_page() parameters.
Follow-up to [53039].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #54729, #55327.
Built from https://develop.svn.wordpress.org/trunk@53040


git-svn-id: http://core.svn.wordpress.org/trunk@52629 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-31 15:25:03 +00:00
Sergey Biryukov
89a210a918 Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/class-wp-list-table.php.
While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.

This commit renames the `$default` parameter to `$default_value` in `WP_List_Table::get_items_per_page()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53039


git-svn-id: http://core.svn.wordpress.org/trunk@52628 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-31 15:21:04 +00:00
gziolo
01309e358d Themes: Add "title" key to i18n schema
This is related to Gutenberg changes in WordPress/gutenberg#39936 that marks the "title" key as translatable field in "theme.json" files.

See also #54336.

Props oandregal.




Built from https://develop.svn.wordpress.org/trunk@53038


git-svn-id: http://core.svn.wordpress.org/trunk@52627 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-31 10:53:04 +00:00
spacedmonkey
afcc5e64f4 Taxonomy: Improve performance by taxonomy queries by adding a limitting requested terms.
Add a limit to the number of terms requested in taxonomy queries. This improves the performance of the query and the likelihood of hitting an existing term query cache. 

Props Spacedmonkey, peterwilsoncc, flixos90. 
Fixes #55360. 


Built from https://develop.svn.wordpress.org/trunk@53037


git-svn-id: http://core.svn.wordpress.org/trunk@52626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-31 10:06:01 +00:00
spacedmonkey
1ad5807bb0 Comments: Improve performance of the wp_count_comments function.
Improve performance of the `wp_count_comments` function by replacing a complex query with multiple calls to the `get_comments` function. Passing the `count` parameter to the `get_comments` function results in a simple 
count query that returns quickly. Using `get_comments` also means that query is cached and run through filters. 


Props FolioVision, markjaquith, nacin, ryan, coffee2code, wonderboymusic, ComputerGuru, jb510, SergeyBiryukov, Znuff, Rahe, uday17035, spacedmonkey, peterwilsoncc.
Fixes #19901.


Built from https://develop.svn.wordpress.org/trunk@53036


git-svn-id: http://core.svn.wordpress.org/trunk@52625 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-31 09:09:07 +00:00
audrasjb
6a97b83d01 Docs: Typo correction in wp_fuzzy_number_match DocBlock.
Props costdev, kebbet.
Fixes #55493.

Built from https://develop.svn.wordpress.org/trunk@53035


git-svn-id: http://core.svn.wordpress.org/trunk@52624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-31 08:17:06 +00:00
Peter Wilson
18ace8bef4 KSES: Document HTML allow list is in lowercase.
Expand documentation of the `wp_kses_allowed_html` hook to indicate that developers must add permitted HTML tags and attributes in lowercase for KSES to recognise they are permitted.

Props r-a-y, SergeyBiryukov, peterwilsoncc.
Fixes #55407.
See #53399.


Built from https://develop.svn.wordpress.org/trunk@53034


git-svn-id: http://core.svn.wordpress.org/trunk@52623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-31 03:54:02 +00:00
Peter Wilson
147a936f33 Build/Test Tools: Add unit tests for feed_links_extra().
Props costdev, hellofromTonya.
Fixes #54713.
See #54725.


Built from https://develop.svn.wordpress.org/trunk@53033


git-svn-id: http://core.svn.wordpress.org/trunk@52622 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-31 00:57:04 +00:00
Sergey Biryukov
f99c38efd5 Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/class-wp-importer.php.
While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.

This commit renames the `$string` parameter to `$text` in `WP_Importer::min_whitespace()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53029


git-svn-id: http://core.svn.wordpress.org/trunk@52618 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-30 10:45:06 +00:00
Felix Arntz
e2b654efe6 Media: Introduce wp_content_img_tag filter.
This filter allows modifying individual `img` tags within a blob of content that are by default processed by the `wp_filter_content_tags()` function. The addition of this filter facilitates plugins that tweak images to accomplish this goal without re-implementing duplicate content image parser logic, which furthermore can have a negative performance impact due to additional regular expressions.

In addition to the filterable `img` tag, the filter receives the context (typically the function or filter in which the content is parsed) and the attachment ID. The latter may be 0, in case the image is not an attachment (for example when it is an external image URL).

Props adamsilverstein, flixos90, pbearne, peterwilsoncc.
Fixes #55347.

Built from https://develop.svn.wordpress.org/trunk@53028


git-svn-id: http://core.svn.wordpress.org/trunk@52617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 23:58:18 +00:00
joedolson
34e9346967 Media: Preserve attachment properties on cropping custom logo.
Migrate the alternative text, title, description, and caption of an image over to the cropped copy of the image after cropping. Ensure that characteristics added to an image prior to cropping are not lost.

Props flixos90, Clorith, afercia, antonvlasenko, ironprogrammer, hellofromTonya.
Fixes #37750.

Built from https://develop.svn.wordpress.org/trunk@53027


git-svn-id: http://core.svn.wordpress.org/trunk@52616 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 21:48:14 +00:00
audrasjb
2f0cb02d07 Customizer: Accessibility fixes following [53024].
This changeset fixes a few issues spotted after [53024].

- Remove target blank on HelpHub link
- Remove duplicate information in `aria-label`
- Small i18n fixes

Follow-up to [53024].

Props joedolson, audrasjb, pbiron.
Fixes #54939.

Built from https://develop.svn.wordpress.org/trunk@53025


git-svn-id: http://core.svn.wordpress.org/trunk@52614 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 19:57:16 +00:00
audrasjb
fff6998023 Customizer: When a block theme is active, add an information about Site Editor in the Customizer.
This change adds an information notice to the customizer when a block theme is active and the customizer is also available (for example when a plugin activates it), to encourage people to use the Site Editor for the best full site customization experience.

Props ironprogrammer, antonvlasenko, Clorith, audrasjb, psmits1567, tobifjellner, costdev, webcommsat.
Fixes #54939.

Built from https://develop.svn.wordpress.org/trunk@53024


git-svn-id: http://core.svn.wordpress.org/trunk@52613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 19:10:14 +00:00
joedolson
6732d37abf Quick/Bulk Edit: Position action buttons in close proximity.
Move the Submit and Cancel buttons in quick edit forms to be next to each other and change the order of the buttons. Improve accessibility for low vision and cognitive impairments for quick editing. 

Props afercia, marybaum.
Fixes #55364.

Built from https://develop.svn.wordpress.org/trunk@53023


git-svn-id: http://core.svn.wordpress.org/trunk@52612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 19:08:19 +00:00
audrasjb
31c9e9452a Administration: Do not specify menu order for the Widgets menu when the active theme is a block theme.
When using a block theme that declares Widgets support, it's better to not specify a menu order for the Widgets menu to avoid conflicts between menu items order.

Props Rufus87, ironprogrammer, audrasjb, hellofromTonya, davidbaumwald.
Fixes #54916.

Built from https://develop.svn.wordpress.org/trunk@53020


git-svn-id: http://core.svn.wordpress.org/trunk@52609 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 15:59:22 +00:00
Sergey Biryukov
8dc9fafcb6 Users: Move get_user_count() and related functions to wp-includes/user.php.
The new location is next to the pre-existing `count_users()` function, along with other user-specific functions, and should be a more appropriate place in terms of consistency.

This affects:
* `get_user_count()`
* `wp_maybe_update_user_counts()`
* `wp_update_user_counts()`
* `wp_schedule_update_user_counts()`
* `wp_is_large_user_count()`

Follow-up to [53011], [53016].

See #38741.
Built from https://develop.svn.wordpress.org/trunk@53018


git-svn-id: http://core.svn.wordpress.org/trunk@52607 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 13:53:14 +00:00
Sergey Biryukov
cd8db5e05f I18N: Move code out of a translatable string in get_user_count() and related functions.
Follow-up to [53011].

See #38741.
Built from https://develop.svn.wordpress.org/trunk@53016


git-svn-id: http://core.svn.wordpress.org/trunk@52605 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 13:38:09 +00:00
audrasjb
25fafd4c44 Editor: Change location of block support styles in wp_head.
Backports changes from https://github.com/WordPress/gutenberg/pull/39164.

Props ndiego, alexstine, cbravobernal, mamaduka.
See #55474.

Built from https://develop.svn.wordpress.org/trunk@53015


git-svn-id: http://core.svn.wordpress.org/trunk@52604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 13:28:08 +00:00
Sergey Biryukov
1aaf68db85 Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/class-wp-filesystem-base.php.
While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.

This commit renames the `$echo` parameter to `$verbose` in `WP_Filesystem_Base::find_base_dir()` and `::get_base_dir()`, and updates the documentation accordingly. This matches the class property of the same name.

Follow-up to [52946], [52996], [52997], [52998], [53003].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53014


git-svn-id: http://core.svn.wordpress.org/trunk@52603 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 13:21:08 +00:00
audrasjb
3306061aa3 Editor: Use wp_unique_id() instead of uniqid() to generate CSS class names.
Backports changes from https://github.com/WordPress/gutenberg/pull/38891.
See https://github.com/WordPress/gutenberg/issues/38889.

Props westonruter, mamaduka.
See #55474.

Built from https://develop.svn.wordpress.org/trunk@53012


git-svn-id: http://core.svn.wordpress.org/trunk@52601 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 13:06:07 +00:00
spacedmonkey
e2e15f1876 Users: Introduce the concept of a large site to single site installations.
Currently in WordPress multisite there is a concept of large networks. The function `wp_is_large_network` is used to determine if a network has a large number of sites or users. If a network is marked as large, then 
expensive queries to calculate user counts are not run on page load but deferred to scheduled events. However there are a number of places in a single site installation where this functionality would also be useful, as 
expensive calls to count users and roles can make screens in the admin extremely slow.

In this change, the `get_user_count` function and related functionality around it is ported to be available in a single site context. This means that expensive calls to the `count_users` function are replaced with 
calls to `get_user_count`. This change also includes a new function called `wp_is_large_user_count` and a filter of the same name, to mark if a site is large.

Props johnbillion, Spacedmonkey, Mista-Flo, lumpysimon, tharsheblows, obenland, miss_jwo, jrchamp, flixos90, macbookandrew, pento, desrosj, johnjamesjacoby, jb510, davidbaumwald, costdev. 
Fixes #38741.


Built from https://develop.svn.wordpress.org/trunk@53011


git-svn-id: http://core.svn.wordpress.org/trunk@52600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 12:42:13 +00:00
spacedmonkey
c220f23155 Menus: Convert wp_get_nav_menu_items function to use a taxonomy query.
Change the `wp_get_nav_menu_items` function to replace the call to `get_objects_in_term` with a simple taxonomy query. This change improves performance as it results in one fewer query to retrieve menu items from the 
database. 

Props Spacedmonkey, peterwilsoncc.
Fixes #55372.




Built from https://develop.svn.wordpress.org/trunk@53010


git-svn-id: http://core.svn.wordpress.org/trunk@52599 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 11:07:11 +00:00
Helen Hou-Sandí
1de43a471c Build/Test Tools: First pass at a .git-blame-ignore-revs file.
This suppresses certain commits from Git blame views, notably in the GitHub UI as well as the command line. These commits are purely stylistic and excluding them from these views helps to reduce the noise when doing code archaeology.

Still to come: More coding standards commits as they are reviewed.

Props helen, costdev, peterwilsoncc.
See #55422

Built from https://develop.svn.wordpress.org/trunk@53007


git-svn-id: http://core.svn.wordpress.org/trunk@52596 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 03:22:09 +00:00
audrasjb
1c07680a7a Plugins: Avoid stomping of some variables in wp-settings.php.
This changeset decreases the chance of accidentally overwriting some variables located in `wp-settings.php`, as the chance of overriding a variable called `$_wp_plugin_file` would be lower than for `$plugin`, `$mu_plugin` or `$network_plugin`.

Props stevegrunwell, joyously, peterwilsoncc, ocean90, SergeyBiryukov, jrf, azouamauriac.
Fixes #55432.

Built from https://develop.svn.wordpress.org/trunk@53004


git-svn-id: http://core.svn.wordpress.org/trunk@52593 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-28 13:59:02 +00:00
Sergey Biryukov
8761c4cefd Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/class-wp-debug-data.php.
While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.

This commit renames the `$var` parameter to `$mysql_var` in `WP_Debug_Data::get_mysql_var()`.

Additionally, `$type` is renamed to `$data_type` in `WP_Debug_Data::format()` for clarity.

Follow-up to [51522], [52946], [52996], [52997], [52998].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53003


git-svn-id: http://core.svn.wordpress.org/trunk@52592 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-28 13:24:01 +00:00
audrasjb
c3a76d012d Docs: Use third-person singular verbs for function descriptions in wp-admin/includes/theme.php and wp-admin/includes/theme-install.php, per the documentation standards.
See #54729.

Built from https://develop.svn.wordpress.org/trunk@53002


git-svn-id: http://core.svn.wordpress.org/trunk@52591 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-28 13:17:05 +00:00
audrasjb
e92dc36129 Options, Meta APIs: Rephrase the description of the "Avatars" section.
This changeset clarifies the description of the "Avatars" section in Discussion Settings screen.

Props johnjamesjacoby, helen, netweb, GaryJ, sabernhardt, costdev, audrasjb, webcommsat, peterwilsoncc.
Fixes #32998.

Built from https://develop.svn.wordpress.org/trunk@53001


git-svn-id: http://core.svn.wordpress.org/trunk@52590 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-28 10:56:04 +00:00
John Blackbourn
0a1310b60d Docs: Correct the documented return types for date and time related functions and filters.
See #54729

Built from https://develop.svn.wordpress.org/trunk@53000


git-svn-id: http://core.svn.wordpress.org/trunk@52589 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-28 10:25:01 +00:00
audrasjb
1abfa45554 Docs: Use third-person singular verbs for function descriptions in wp-includes/template.php, per the documentation standards.
See #54729.

Built from https://develop.svn.wordpress.org/trunk@52999


git-svn-id: http://core.svn.wordpress.org/trunk@52588 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-28 09:45:06 +00:00
Sergey Biryukov
407a9bebe4 Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/class-theme-upgrader.php.
While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.

This commit renames the `$return` variable in `Theme_Upgrader` class methods to `$response` and updates the documentation accordingly.

Follow-up to [47409], [52946], [52996], [52997].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@52998


git-svn-id: http://core.svn.wordpress.org/trunk@52587 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-27 14:55:02 +00:00
Sergey Biryukov
0cde19b503 Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/class-plugin-upgrader.php.
While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.

This commit renames the `$return` variable in `Plugin_Upgrader` class methods to `$response` and updates the documentation accordingly.

Follow-up to [47409], [52946], [52996].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@52997


git-svn-id: http://core.svn.wordpress.org/trunk@52586 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-27 14:45:04 +00:00
Sergey Biryukov
6ada28a47b Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/class-ftp.php.
While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.

This commit renames the `$string` parameter of `ftp_base::glob_pattern_match()` to `$subject`.

Follow-up to [52946].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@52996


git-svn-id: http://core.svn.wordpress.org/trunk@52585 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-26 15:28:08 +00:00
audrasjb
f0d2ba5be0 Editor: Optimize preload paths for post and site editors.
This patch optimizes preload paths in post and site editors so that they match the real requests:

- Remove the `/` preload as the payload is very big and the response is not needed on any critical path.
- Modify the preloaded path for `/wp/v2/taxonomies` so that it corresponds to what `loadTaxonomyEntities` requests. After Gutenberg PR 37685 was merged to core, these preloads need to be modified to use `context=view` instead of `context=edit`.
- Modify the `/wp/v2/users/me path` so that it matches the real request (no query params).
- Add a preload of `/wp/v2/settings` because it is requested on critical path (editor boot). Site editor already preloads this, the changeset is only adding it to the post editor.

This is related to Gutenberg PR 39256 which introduces compatibility code to modify the preload paths with a filter, when the Gutenberg plugin is active.

See https://github.com/WordPress/gutenberg/pull/39256.

Props jsnajdr, noisysocks.
Fixes #55337.

Built from https://develop.svn.wordpress.org/trunk@52995


git-svn-id: http://core.svn.wordpress.org/trunk@52584 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-25 21:50:03 +00:00
audrasjb
e2bf0e9edf Docs: Use third-person singular verbs for function descriptions in wp-includes/rewrite.php, per the documentation standards.
See #54729.

Built from https://develop.svn.wordpress.org/trunk@52994


git-svn-id: http://core.svn.wordpress.org/trunk@52583 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-25 21:34:01 +00:00
audrasjb
876dde2def Twenty Nineteen: Override flex order in comment form.
This change updates Twenty Nineteen bundled theme to fix the DOM order in the comment form, and to add a new `.comment-form-wrapper` class to change `flex` display to `block` for this specific area.

Props garrett-eclipse, audrasjb, sabernhardt.
Fixes #46600.

Built from https://develop.svn.wordpress.org/trunk@52993


git-svn-id: http://core.svn.wordpress.org/trunk@52582 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-25 21:20:04 +00:00
Sergey Biryukov
746f1146c9 Docs: Use third-person singular verbs for function descriptions in wp-includes/taxonomy.php, per the documentation standards.
See #54729.
Built from https://develop.svn.wordpress.org/trunk@52992


git-svn-id: http://core.svn.wordpress.org/trunk@52581 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-25 16:53:01 +00:00
Sergey Biryukov
05dfeab45e Docs: Adjust the term_exists_default_query_args filter docs per the documentation standards.
Follow-up to [52987].

See #55439.
Built from https://develop.svn.wordpress.org/trunk@52991


git-svn-id: http://core.svn.wordpress.org/trunk@52580 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-25 16:48:01 +00:00
spacedmonkey
ff1e74602d Query: Ensure that sticky post query returns all sticky posts.
Ensure that the `posts_per_page` parameter submit to sticky post query matches the number of sticky posts requested. 

Follow-up to [52982]

Props Spacedmonkey, peterwilsoncc.
See #36907.


Built from https://develop.svn.wordpress.org/trunk@52990


git-svn-id: http://core.svn.wordpress.org/trunk@52579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-25 09:56:05 +00:00
davidbaumwald
31dede34c1 External Libraries: Update Jcrop to version 0.9.15.
For a full list of changes, see https://github.com/tapmodo/Jcrop/compare/v0.9.12...v0.9.15.

This change also adds a comment in `script-loader.php` indicating that this library is no longer used by core.

Follow-up to [10846], [10863], [11015], [21633], [25549].

Props hareesh-pillai, karpstrucking, SergeyBiryukov.
Fixes #54035.
Built from https://develop.svn.wordpress.org/trunk@52989


git-svn-id: http://core.svn.wordpress.org/trunk@52578 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-24 20:07:05 +00:00
Sergey Biryukov
89439a7f83 Upgrade/Install: Update sodium_compat to v1.17.1.
The latest version of sodium_compat includes further improvements for PHP 8.1 compatibility.

Release notes:
https://github.com/paragonie/sodium_compat/releases/tag/v1.17.1

A full list of changes in this update can be found on GitHub:
https://github.com/paragonie/sodium_compat/compare/v1.17.0...v1.17.1

Follow-up to [49741], [51002], [51591].

Props jrf, paragoninitiativeenterprises.
Fixes #55453.
Built from https://develop.svn.wordpress.org/trunk@52988


git-svn-id: http://core.svn.wordpress.org/trunk@52577 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-24 15:20:08 +00:00
spacedmonkey
e0570e5753 Taxonomy: Introduce term_exists_default_query_args filter.
In [52921] `term_exists` was converted to use `get_terms`. This change adds a filter called `term_exists_default_query_args` 
to the `term_exists` function to allow developers to modify the arguments passed to `get_terms` before the query is run.

Props Chouby, Spacedmonkey, peterwilsoncc.
Fixes #55439.



Built from https://develop.svn.wordpress.org/trunk@52987


git-svn-id: http://core.svn.wordpress.org/trunk@52576 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-24 10:26:06 +00:00
davidbaumwald
fabc5db7fe Upgrade/Install: Fix the docs for the default value of $clear_working in WP_Upgrader::run.
The current docblock for `WP_Upgrader::run` indicates the default value for the `clear_working` key of the `$options` argument is `false`.  However, in the code directly below, the default is shown to be `true.  This change updates the docblock to correct the default.

This commit also reorders the `$defaults` to match the order they appear in the docblock.

Props paulkevan.
Fixes #55450.
Built from https://develop.svn.wordpress.org/trunk@52986


git-svn-id: http://core.svn.wordpress.org/trunk@52575 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-23 18:04:05 +00:00
Sergey Biryukov
4499c7a17f Tests: Use a more descriptive name for the sticky posts test that verifies the parameters from the main query.
Reorder the parameters of the `get_posts()` call for consistency with similar calls elsewhere.

Follow-up to [52982].

See #36907.
Built from https://develop.svn.wordpress.org/trunk@52985


git-svn-id: http://core.svn.wordpress.org/trunk@52574 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-23 16:28:06 +00:00
Sergey Biryukov
b3f614f962 Docs: Adjust documentation in get_post_galleries() tests per the documentation standards.
Follow-up to [52190], [52797].

Props azouamauriac, SergeyBiryukov.
See #54725, #54729.
Built from https://develop.svn.wordpress.org/trunk@52984


git-svn-id: http://core.svn.wordpress.org/trunk@52573 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-23 15:03:05 +00:00
Sergey Biryukov
efcc58a31e Tests: Remove some unused variables in phpunit/tests/filters.php.
Follow-up to [29422], [31014].

Props azouamauriac.
See #54725.
Built from https://develop.svn.wordpress.org/trunk@52983


git-svn-id: http://core.svn.wordpress.org/trunk@52572 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-23 14:50:07 +00:00
spacedmonkey
e8bf92cf76 Query: Improved sticky post query
Ensure that the parameters `update_post_meta_cache`, `update_post_term_cache`, `cache_results`, `suppress_filters` and 
`lazy_load_term_meta` that are passed to WP_Query, are also passed down to the secondary query used to get sticky 
posts. 

Props Spacedmonkey, peterwilsoncc, rehanali, uday17035. 
Fixes #36907.


Built from https://develop.svn.wordpress.org/trunk@52982


git-svn-id: http://core.svn.wordpress.org/trunk@52571 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-23 10:39:06 +00:00
audrasjb
dcd54244a6 Administration: Remove a duplicate sentence after [52980].
Follow-up to [52980], [52979], [52978].

Props SergeyBiryukov.
Fixes #38913.

Built from https://develop.svn.wordpress.org/trunk@52981


git-svn-id: http://core.svn.wordpress.org/trunk@52570 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-22 21:11:01 +00:00
audrasjb
108af2ee64 Administration: Rephrase some sentences after [52978].
Follow-up to [52978], [52979].

Props SergeyBiryukov.
Fixes #38913.

Built from https://develop.svn.wordpress.org/trunk@52980


git-svn-id: http://core.svn.wordpress.org/trunk@52569 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-22 21:07:01 +00:00
audrasjb
6f39380c34 Administration: Replace contracted verb forms for better consistency.
This changeset replaces contracted verb forms like `doesn't`, `can't`, or `isn't` with non-contracted forms like `does not`, `cannot`, or `is not`, for better consistency across the WordPress administration. It also updates some corresponding unit tests strings.

Follow-up to [52978].

See #38913.

Built from https://develop.svn.wordpress.org/trunk@52979


git-svn-id: http://core.svn.wordpress.org/trunk@52568 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-22 19:59:04 +00:00
audrasjb
223cda987f Administration: Replace contracted verb forms for better consistency.
This changeset replaces contracted verb forms like `doesn't`, `can't`, or `isn't` with non-contracted forms like `does not`, `cannot`, or `is not`, for better consistency across the WordPress administration. It also updates some corresponding unit tests strings.

Props Presskopp, socalchristina, aandrewdixon, francina, SergeyBiryukov, JeffPaul, audrasjb, hellofromTonya.
Fixes #38913.
See #39176.

Built from https://develop.svn.wordpress.org/trunk@52978


git-svn-id: http://core.svn.wordpress.org/trunk@52567 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-22 16:25:03 +00:00
Sergey Biryukov
6f5f187574 Coding Standards: Use multi-line strings for the $this->request property in wp-includes/class-wp-*-query.php.
This further improves the readability by replacing `implode()` calls with string interpolation.

Follow-up to [52973].

Props jrf.
See #54728.
Built from https://develop.svn.wordpress.org/trunk@52977


git-svn-id: http://core.svn.wordpress.org/trunk@52566 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-22 14:56:05 +00:00
spacedmonkey
51d4723691 Build/Test Tools: Make comment cache group persistent in object-cache.php.
After the comment cache group was made persistent in [37613], also make 
persistent in object-cache.php used for PHPUnit tests. 

See #54725 


Built from https://develop.svn.wordpress.org/trunk@52976


git-svn-id: http://core.svn.wordpress.org/trunk@52565 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-22 11:36:01 +00:00
spacedmonkey
7613aaf9b1 Menus: Improve cache priming in the wp_get_nav_menu_items function.
In `wp_get_nav_menu_items` multiple function calls to `get_terms` and `get_posts` were being used to load post/term objects into 
memory. This change replaces calls to `get_terms` and `get_posts` with calls to `_prime_post_caches` and 
`_prime_term_caches`. These functions are designed to prime object caches and do not have the overhead of a query object. This 
change also replaces multiple queries with a single query, saving many SQL queries per page load. 

Props Spacedmonkey, peterwilsoncc. 
Fixes #55428.
 --This line, and those below, 
will be ignored--

M    src/wp-includes/nav-menu.php

Built from https://develop.svn.wordpress.org/trunk@52975


git-svn-id: http://core.svn.wordpress.org/trunk@52564 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-22 09:58:07 +00:00
Sergey Biryukov
41de51364a Coding Standards: Remove a one-time $pieces variable in wp-includes/class-wp-*-query.php.
Use the existing `$clauses` variable instead for consistency.

See #54728.
Built from https://develop.svn.wordpress.org/trunk@52974


git-svn-id: http://core.svn.wordpress.org/trunk@52563 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-21 12:22:01 +00:00
Sergey Biryukov
38dbd506e7 Coding Standards: Wrap the $this->request property in wp-includes/class-wp-*-query.php.
This aims to improve readability by fitting the values on a single screen to avoid horizontal scrolling. 

See #54728.
Built from https://develop.svn.wordpress.org/trunk@52973


git-svn-id: http://core.svn.wordpress.org/trunk@52562 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-21 12:05:04 +00:00
Sergey Biryukov
83c4cdf92b Coding Standards: Simplify some long conditions in wp-includes/class-wp-term-query.php.
This aims to improve readability and make the logic easier to parse at a glance.

Follow-up to [40293], [52970].

See #55352, #54728.
Built from https://develop.svn.wordpress.org/trunk@52972


git-svn-id: http://core.svn.wordpress.org/trunk@52561 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-21 11:56:04 +00:00
audrasjb
7fda1f8e69 Menus: Improve padding on bulk action labels for small screens.
Props sumitsingh, sabernhardt, ryokuhi, priyank9033, audrasjb, pbiron.
Fixes #54855.

Built from https://develop.svn.wordpress.org/trunk@52971


git-svn-id: http://core.svn.wordpress.org/trunk@52560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-21 10:32:03 +00:00
Peter Wilson
284308048e Taxonomy: Increase cache hits in WP_Term_Query.
Increase the number of cache hits in `WP_Term_Query` by normalizing data included in the cache key.

Arguments that do not affect the SQL query, eg `update_term_meta_cache`, are removed from cache key generation. Arguments that are accepted in multiple formats, eg a string and an array, are normalized for both the cache key and the SQL query.

Props spacedmonkey.
Fixes #55352.


Built from https://develop.svn.wordpress.org/trunk@52970


git-svn-id: http://core.svn.wordpress.org/trunk@52559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-21 03:55:03 +00:00
Sergey Biryukov
dcf9c33bc6 KSES: Add support for <ruby> and related elements.
`<ruby>` element and its friends are used to attach annotation text onto a piece of text. This is especially commonly used in Japanese content, but it can also been seen in content of other languages like Chinese.

The set of elements to enable such functionality consists of `<ruby>`, `<rt>`, and `<rp>` in the [https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-ruby-element HTML Standard], while some browsers (like Firefox) additionally support `<rb>` and `<rtc>` for more advanced formatting, which are not yet included in the official HTML spec, but can be found in a [https://www.w3.org/TR/html-ruby-extensions/ W3C extension].

Props upsuper, mukesh27, SergeyBiryukov.
Fixes #54698.
Built from https://develop.svn.wordpress.org/trunk@52969


git-svn-id: http://core.svn.wordpress.org/trunk@52558 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-21 00:30:04 +00:00
Peter Wilson
d89f6097c4 KSES: Allow lang, xml:lang, dir attributes globally.
Globally permit the `lang`, `xml:lang`, and `dir` attributes on all elements rather than a subset in accordance with the HTML specification.

Props upsuper, SergeyBiryukov, mukesh27, audrasjb.
Fixes #54699.

Built from https://develop.svn.wordpress.org/trunk@52968


git-svn-id: http://core.svn.wordpress.org/trunk@52557 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-21 00:13:05 +00:00
Sergey Biryukov
799d6d616c Coding Standards: Escape the comment post URL in _wp_dashboard_recent_comments_row().
Follow-up to [6705].

Props kebbet.
See #54728.
Built from https://develop.svn.wordpress.org/trunk@52967


git-svn-id: http://core.svn.wordpress.org/trunk@52556 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-20 17:39:01 +00:00
Sergey Biryukov
0fc4e7d73a Coding Standards: Use strict comparison in wp-includes/class-wp-http-curl.php.
Follow-up to [17692], [25303], [29968].

See #54728.
Built from https://develop.svn.wordpress.org/trunk@52966


git-svn-id: http://core.svn.wordpress.org/trunk@52555 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-20 16:24:03 +00:00
Sergey Biryukov
b30c9f51c0 Coding Standards: Rename the $theBody variable to $body in WP_Http_Curl::request().
This fixes a `Variable "$theBody" is not in valid snake_case format` WPCS warning.

Follow-up to [8516], [51825], [51929], [51931], [51940], [52025], [52960], [52961], [52962], [52963], [52964].

Props azouamauriac.
See #54728.
Built from https://develop.svn.wordpress.org/trunk@52965


git-svn-id: http://core.svn.wordpress.org/trunk@52554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-20 16:12:06 +00:00
Sergey Biryukov
010c5d4f89 Coding Standards: Rename the $strResponse variable to $response in WP_Http_Streams::request().
This fixes a `Variable "$strResponse" is not in valid snake_case format` WPCS warning.

For consistency, this commit also renames the `WP_Http::processResponse()` argument to `$response`.

Follow-up to [8516], [51825], [51929], [51940], [52025], [52960], [52961], [52962], [52963].

Props azouamauriac.
See #54728.
Built from https://develop.svn.wordpress.org/trunk@52964


git-svn-id: http://core.svn.wordpress.org/trunk@52553 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-20 16:02:04 +00:00
Sergey Biryukov
0c8714dcda Coding Standards: Rename the $headerValue variable to $header_value in WP_Http_Streams::request().
This fixes a `Variable "$headerValue" is not in valid snake_case format` WPCS warning.

Follow-up to [8516], [51825], [51929], [51940], [52960], [52961], [52962].

Props azouamauriac.
See #54728.
Built from https://develop.svn.wordpress.org/trunk@52963


git-svn-id: http://core.svn.wordpress.org/trunk@52552 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-20 15:52:06 +00:00
Sergey Biryukov
6c3ea94f97 Coding Standards: Rename the $strHeaders variable to $headers in WP_Http_Streams::request().
This fixes a `Variable "$strHeaders" is not in valid snake_case format` WPCS warning.

Follow-up to [8516], [51825], [51929], [51940], [52960], [52961].

Props azouamauriac.
See #54728.
Built from https://develop.svn.wordpress.org/trunk@52962


git-svn-id: http://core.svn.wordpress.org/trunk@52551 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-20 15:50:06 +00:00
Sergey Biryukov
236e1d4ee3 Coding Standards: Rename the $requestPath variable to $request_path in WP_Http_Streams::request().
This fixes a `Variable "$requestPath" is not in valid snake_case format` WPCS warning.

Follow-up to [8516], [51825], [51929], [51940], [52960].

Props azouamauriac.
See #54728.
Built from https://develop.svn.wordpress.org/trunk@52961


git-svn-id: http://core.svn.wordpress.org/trunk@52550 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-20 15:43:04 +00:00
Sergey Biryukov
47d2a73beb Coding Standards: Rename the $bodyStarted variable to $body_started in WP_Http_Streams::request().
This fixes a `Variable "$bodyStarted" is not in valid snake_case format` WPCS warning.

Follow-up to [17555], [51825], [51929], [51940].

Props azouamauriac.
See #54728.
Built from https://develop.svn.wordpress.org/trunk@52960


git-svn-id: http://core.svn.wordpress.org/trunk@52549 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-20 15:37:06 +00:00
Sergey Biryukov
60ca4af9e1 Docs: Correct variable references in get_category_feed_link() and get_term_feed_link() @return tags.
The `$cat_id` and `$term_id` variables were replaced by `$cat` and `$term`, respectively.

Follow-up to [52180].

See #54729.
Built from https://develop.svn.wordpress.org/trunk@52959


git-svn-id: http://core.svn.wordpress.org/trunk@52548 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-20 15:05:05 +00:00
Sergey Biryukov
845f4f00fd Coding Standards: Rename the $cat_ID argument to $cat_id in get_the_category_by_ID().
This fixes a `Variable "$cat_ID" is not in valid snake_case format` WPCS warning.

Props azouamauriac.
See #54728.
Built from https://develop.svn.wordpress.org/trunk@52958


git-svn-id: http://core.svn.wordpress.org/trunk@52547 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-20 14:57:07 +00:00
Sergey Biryukov
8cdec43675 Coding Standards: Use esc_url() instead of esc_attr() for some URLs.
Follow-up to [2063], [2182], [4656], [6952], [9098], [11109], [11204], [17887], [22505], 

Props kebbet.
See #54728.
Built from https://develop.svn.wordpress.org/trunk@52957


git-svn-id: http://core.svn.wordpress.org/trunk@52546 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-19 20:31:12 +00:00
John Blackbourn
280aabee27 I18N: Avoid translating wp_locale strings several times.
This avoids 26 unnecessary duplicate translations.

Props Chouby

Fixes #54564

Built from https://develop.svn.wordpress.org/trunk@52956


git-svn-id: http://core.svn.wordpress.org/trunk@52545 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-18 21:18:03 +00:00
John Blackbourn
7f9c9dc731 Formatting: Add support for formatting sizes as PB, EB, ZB, and YB.
Props henry.wright, Presskopp

Fixes #40875

Built from https://develop.svn.wordpress.org/trunk@52955


git-svn-id: http://core.svn.wordpress.org/trunk@52544 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-18 20:48:02 +00:00
davidbaumwald
35c5e74706 Users: Check maximum length of user_nicename after filters are applied.
Similar to other checks on `user_login` and `user_url`, this change moves the maximum length check on `user_nicename` after the `pre_user_nicename` filter has been applied, to account for any changes to the value prior to saving.

Props SergeyBiryukov, ravipatel, muhammadfaizanhaidar, mukesh27, csesumonpro, azouamauriac.
Fixes #54987.
Built from https://develop.svn.wordpress.org/trunk@52954


git-svn-id: http://core.svn.wordpress.org/trunk@52543 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-18 20:44:01 +00:00
davidbaumwald
ee85a17cf2 Taxonomy: Consider HTML5 input types when resetting form values after adding a new tag.
When adding a new tag, the form is reset by clearing values for `input[type=text]` and `textarea`s.  However, the reset doesn't account for any HTML5 input types, like `number` or `url`, that may be added by plugins or themes.

This change updates the form resetting jQuery to clear any values from `input` types that are not hidden and neither a `checkbox` nor `radio` type.

Props stevegrunwell.
Fixes #48030.
Built from https://develop.svn.wordpress.org/trunk@52953


git-svn-id: http://core.svn.wordpress.org/trunk@52542 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-18 20:12:06 +00:00
John Blackbourn
6571e44299 Plugins: Convert apply_filters() into a proper variadic function.
This makes its signature more correct by implementing the spread operator, and adjusts the internal logic correspondingly without affecting performance.

Props jrf, SergeyBiryukov, davidbaumwald, mauriac, johnbillion

Fixes #53218

Built from https://develop.svn.wordpress.org/trunk@52952


git-svn-id: http://core.svn.wordpress.org/trunk@52541 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-18 18:23:04 +00:00
davidbaumwald
92a1067f1d Comments: Disable "close on escape" for inline replies when using an IME.
When using an Input Method Editor(IME), pressing escape to perform actions in the IME is common.  However, if this was done while replying to a comment, the "close on escape" feature was also triggered which cleared the current textarea and closed it.

This change checks if an IME is in use by binding the `compositionstart` event to the reply text box and setting a flag if it's triggered.  The "close on escape" feature will now only be triggered if this new flag is not set after typing a reply.

Props BettyJJ, sabernhardt, alexstine, konradyoast, audrasjb, rafiahmedd, afercia.
Fixes #54548.
Built from https://develop.svn.wordpress.org/trunk@52951


git-svn-id: http://core.svn.wordpress.org/trunk@52540 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-18 18:14:02 +00:00
davidbaumwald
df3dae33cc Administration: Add a media_date_column_time filter to the media list table date column.
Similar to the existing `post_date_column_time` filter in the posts list table, this change adds a new hook to filter the "Date" column output in the media list view.

Props ivanlutrov, lopo, audrasjb.
Fixes #42942.
Built from https://develop.svn.wordpress.org/trunk@52950


git-svn-id: http://core.svn.wordpress.org/trunk@52539 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-18 16:39:02 +00:00
Sergey Biryukov
fc469e56ca Themes: Use esc_url() for theme screenshots on the Themes screen.
This brings consistency with how screenshots are escaped elsewhere.

Follow-up to [52020], [52947].

See #53370.
Built from https://develop.svn.wordpress.org/trunk@52949


git-svn-id: http://core.svn.wordpress.org/trunk@52538 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-18 13:44:03 +00:00
audrasjb
775ae0b5f6 Themes: Add version to theme screenshot URL in WP_Themes_List_Table.
Follow-up to [52947].

See #53370.


Built from https://develop.svn.wordpress.org/trunk@52948


git-svn-id: http://core.svn.wordpress.org/trunk@52537 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-18 12:44:04 +00:00
audrasjb
a32545f854 Themes: Add version to theme screenshot URL for better browser cache handling.
This change appends the theme version number to the URL of screenshots that appear in various place of the WordPress Admin. As a result, browsers will be able to refresh the screenshot as needed when the theme is updated.

Props codente, desrosj, audrasjb, SergeyBiryukov.
Fixes #53370.


Built from https://develop.svn.wordpress.org/trunk@52947


git-svn-id: http://core.svn.wordpress.org/trunk@52536 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-17 22:21:07 +00:00
Sergey Biryukov
d6589948ca Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/class-custom-image-header.php.
While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.

This commit renames the `$object` variable in `Custom_Image_Header` class methods to `$attachment` for clarity and consistency, as the variable type is actually an array, and updates the documentation accordingly.

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@52946


git-svn-id: http://core.svn.wordpress.org/trunk@52535 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-17 20:19:10 +00:00
Peter Wilson
5c2f80f60f Registration/Login: Coding standards fixes for wp-login.php.
Props alkesh7, Presskopp, audrasjb.
Fixes #54746.
See #54728.

Built from https://develop.svn.wordpress.org/trunk@52945


git-svn-id: http://core.svn.wordpress.org/trunk@52534 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-17 04:57:03 +00:00
Peter Wilson
e24bf8c2c9 Themes: Use pointer when hovering on theme details button.
Use the pointer cursor when hovering over the theme details button for consistency with the theme card. Clicking in either area performs the same action.

Props multidots1896, rehanali, ravipatel, sabernhardt, ryokuhi.
Fixes #54971.

Built from https://develop.svn.wordpress.org/trunk@52944


git-svn-id: http://core.svn.wordpress.org/trunk@52533 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-17 04:34:01 +00:00
Peter Wilson
88e428a2e1 Editor/Docs: Add blockTypes argument to WP_Block_Patterns_Registry::register() docblock.
Add the optional `blockTypes` argument in the patten properties for `WP_Block_Patterns_Registry::register()`.

Props vlad.olaru.
Fixes #55303.
See #54729.

Built from https://develop.svn.wordpress.org/trunk@52943


git-svn-id: http://core.svn.wordpress.org/trunk@52532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-17 04:13:07 +00:00
noisysocks
d2c2dc1c10 Add WP_Block_Editor_Context::$name
Adds a new `WP_Block_Editor_Context::$name` and field. This allows plugin
developers to tell which block editor is being loaded when using filters such as
`allowed_block_types_all` and `block_editor_rest_api_preload_paths`.

Fixes #55301.
Props talldanwp, gziolo, andraganescu.

Built from https://develop.svn.wordpress.org/trunk@52942


git-svn-id: http://core.svn.wordpress.org/trunk@52531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-17 03:37:05 +00:00
Sergey Biryukov
7e6d939911 Docs: Add a @since note about Twenty Twenty-Two for WP_Theme::$default_themes.
Follow-up to [51328], [52093].

See #54729.
Built from https://develop.svn.wordpress.org/trunk@52941


git-svn-id: http://core.svn.wordpress.org/trunk@52530 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-16 19:32:03 +00:00
Sergey Biryukov
0538720bba Themes: Allow block themes to be activated without index.php.
This removes the requirement for block themes to have an unused `index.php` template just for activation, as they use a `templates/index.html` file instead.

The updated requirements are as follows:

* Standalone themes need to have a `templates/index.html` or `index.php` template file.
* Child themes need to have a `Template` header in the `style.css` stylesheet.

Follow-up to [52069], [52247].

Props poena, sabbirshouvo, scruffian, manfcarlo, overclokk, andraganescu, SergeyBiryukov.
Fixes #54272.
Built from https://develop.svn.wordpress.org/trunk@52940


git-svn-id: http://core.svn.wordpress.org/trunk@52529 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-16 18:30:03 +00:00
gziolo
54bdc31c99 Editor: Fix broken asset URLs when using WP outside of the regular directory
Both CSS and JS URLs were totally broken for some of the newer blocks (e.g. the navigation block in the 2022 theme) when WP core is outside of the current directory using a different prefix.

Props pgpagely, Mamaduka.
Fixes #55311.



Built from https://develop.svn.wordpress.org/trunk@52939


git-svn-id: http://core.svn.wordpress.org/trunk@52528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-16 10:22:03 +00:00
Peter Wilson
65d06b7cdc Tests: Include special characters in term names for wp_set_term_objects().
Test `wp_set_term_objects()` using terms with special characters in the name, for example ampersand, bullet and other symbols and punctuation.

Props kapacity, costdev.
Fixes #53152.
See #54725.


Built from https://develop.svn.wordpress.org/trunk@52938


git-svn-id: http://core.svn.wordpress.org/trunk@52527 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-16 03:06:06 +00:00
Dominik Schilling
14f7f05190 I18N, Script Loader: Don't register empty locale data objects.
For `wp.i18n` the library [https://github.com/messageformat/Jed Jed] was initially used which was throwing an error if a domain was not registered but used in a translate function. Later, the library was replaced by [https://github.com/aduth/tannin Tannin] which no longer requires the domain to be registered and thus we can avoid printing an empty-ish translations script that doesn't add any translations.

Props jsnajdr.
Fixes #55250.
Built from https://develop.svn.wordpress.org/trunk@52937


git-svn-id: http://core.svn.wordpress.org/trunk@52526 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-15 16:00:02 +00:00
Sergey Biryukov
0e95737d10 Plugins: Move the introduction text from install_dashboard() to display_plugins_table().
This brings some consistency to how the introduction is displayed for the Beta Testing, Featured, and Recommended tabs of the Add Plugins screen.

This commit also reorders the `switch` cases for the text in the same order as they are displayed.

Follow-up to [9141], [30889], [36297].

Props sabbir1991, kapilpaul.
Fixes #55389.
Built from https://develop.svn.wordpress.org/trunk@52936


git-svn-id: http://core.svn.wordpress.org/trunk@52525 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-15 15:58:02 +00:00
audrasjb
1cd42e3cbe Docs: Misc. fixes in wp-includes/post-template.php and wp-includes/post-thumbnail-template.php.
Props azouamauriac, audrasjb.
See #54729.

Built from https://develop.svn.wordpress.org/trunk@52935


git-svn-id: http://core.svn.wordpress.org/trunk@52524 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-15 15:22:05 +00:00
Sergey Biryukov
3d5b1eac13 Docs: Further clarify the description for install_dashboard().
Follow-up to [52931].

See #54729.
Built from https://develop.svn.wordpress.org/trunk@52934


git-svn-id: http://core.svn.wordpress.org/trunk@52523 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-14 18:14:00 +00:00
Sergey Biryukov
0d747500ba I18N: Move wp_get_list_item_separator() to a more appropriate place.
Follow-up to [52929].

See #39733.
Built from https://develop.svn.wordpress.org/trunk@52933


git-svn-id: http://core.svn.wordpress.org/trunk@52522 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-14 18:01:02 +00:00
hellofromTonya
316aa2544f Media: Relocate wp_filesize() function for use in frontend and backend.
A new function `wp_filesize()` was added with [52837]. The function lived in the `wp-admin/includes/file.php` file. However, this admin specific function is not loaded into memory when hitting `media/edit` endpoint. The result was a `500` Internal Server Error. Why? The function is invoked with that endpoint, but the function does not exist in memory.

This commit relocates the new function to the `wp-includes/functions.php` file. In doing so, the function is available for both the frontend and backend.

Follow-up to [52837].

Props talldanwp, spacedmonkey, costdev, antonvlasenko.
Fixes #55367.
Built from https://develop.svn.wordpress.org/trunk@52932


git-svn-id: http://core.svn.wordpress.org/trunk@52521 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-14 16:32:06 +00:00