Commit Graph

20849 Commits

Author SHA1 Message Date
desrosj
11511cea38 Bundled Themes: Update NPM dependencies for Twenty Twenty and Twenty Nineteen.
There are no changes to any built files after updating.

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53762


git-svn-id: http://core.svn.wordpress.org/trunk@53321 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-22 17:11:08 +00:00
desrosj
4d35a8e4b4 Twenty Twenty-One: Update NPM dependencies.
This updates the NPM dependencies for the Twenty Twenty-One theme to the latest versions.

Modifications to the built files are included in this commit, which are a result of updating the `sass` dependency to the latest version.

Previously, trailing loud comments (`/* ... */`) were pushed to the next line,. Now the comment location is preserved, resulting in the built CSS files more closely resembling the theme’s SCSS files.

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53761


git-svn-id: http://core.svn.wordpress.org/trunk@53320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-22 16:42:08 +00:00
spacedmonkey
16dfb05173 REST API: Avoid unnecessarily preparing item links.
Do not call the `prepare_links` methods in core REST API controllers, unless the `_links` or `_embedded` fields are requested. There is no need to prepare links if they are never returned in the response. This saves resources, as many calls to `prepare_links` methods perform database queries. 

Props Spacedmonkey, timothyblynjacobs, rachelbaker, desrosj, dlh, hellofromTonya.
Fixes #52992.
Built from https://develop.svn.wordpress.org/trunk@53760


git-svn-id: http://core.svn.wordpress.org/trunk@53319 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-22 14:00:12 +00:00
spacedmonkey
ee12e8acc0 REST API: Use wp_get_lastest_revision_id_and_total_count function in WP_REST_Posts_Controller class.
Add new function called `wp_get_lastest_revision_id_and_total_count`, that performs an optimized query to get the last revision and total and use it in `WP_REST_Posts_Controller` class. 

Props Spacedmonkey, timothyblynjacobs, furi3r, peterwilsoncc.
Fixes #55857.
Built from https://develop.svn.wordpress.org/trunk@53759


git-svn-id: http://core.svn.wordpress.org/trunk@53318 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-22 13:24:20 +00:00
Sergey Biryukov
acbd857a4c Administration: Correct the escaping in documentation lookup for plugin and theme editor.
This brings consistency to similar code fragments that evolved in slightly different ways over the years:

* A check that the list of functions is not empty now exists in both editors.
* "Function Name..." is an option label, not an attribute, so `esc_html__()` is the correct function here.
* `esc_attr( urlencode( $function ) )` in the theme editor is replaced with `esc_attr( $function )`.
* `htmlspecialchars( $function )` in the theme editor is replaced with `esc_html( $function )`.

Follow-up to [10607], [10879], [11110], [11173], [11204], [11671], [14989].

Props aristath, justinahinon, poena, audrasjb, pratiweb, SergeyBiryukov.
Fixes #56007.
Built from https://develop.svn.wordpress.org/trunk@53758


git-svn-id: http://core.svn.wordpress.org/trunk@53317 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-22 11:33:10 +00:00
audrasjb
d217368c6a Docs: Provide a more accurate description for wp_is_theme_directory_ignored().
This function doesn't filter theme directories, it rather determines whether a directory should be ignored during export.

Props audrasjb, nareshbheda.
Fixes #56257.
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53316 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-22 07:18:13 +00:00
Sergey Biryukov
30d9a61fe2 Coding Standards: Use __DIR__ instead of ABSPATH in wp-db.php.
If the file is included directly outside of WordPress core, `ABSPATH` may not be defined.

Follow-up to [53749], [53750], [53755].

See #56268, #55647.
Built from https://develop.svn.wordpress.org/trunk@53756


git-svn-id: http://core.svn.wordpress.org/trunk@53315 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-21 22:45:11 +00:00
Sergey Biryukov
1cf37b12ae Coding Standards: Check if the _deprecated_file() function exists in wp-db.php.
This avoids a fatal error if the file is included directly outside of WordPress core, e.g. by HyperDB.

Additionally, replace `WPINC` with `wp-includes`, as the constant may not be defined yet in that context.

Follow-up to [53749], [53750].

See #56268, #55647.
Built from https://develop.svn.wordpress.org/trunk@53755


git-svn-id: http://core.svn.wordpress.org/trunk@53314 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-21 21:39:08 +00:00
audrasjb
f7921555ca Formatting: Normalize to Unicode NFC encoding before converting accent characters in remove_accents().
This changeset adds Unicode sequence normalization from NFD to NFC, via the `normalizer_normalize()` PHP function which is available with the recommended `intl` PHP extension.

This fixes an issue where NFD characters were not properly sanitized. It also provides a unit test for NFD sequences (alternate Unicode representations of the same characters).

Props NumidWasNotAvailable, targz, nacin, nunomorgadinho, p_enrique, gitlost, SergeyBiryukov, markoheijnen, mikeschroder, ocean90, pento, helen, rodrigosevero, zodiac1978, ironprogrammer, audrasjb, azaozz, laboiteare, nuryko, virgar, dxd5001, onnimonni, johnbillion.
Fixes #24661, #47763, #35951.
See #30130, #52654.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53313 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-21 21:11:12 +00:00
Adam Silverstein
0bbca2a3ab Upgrade/Install: track php extensions and image library support for WebP and AVIF.
Add the loaded php extensions as well as whether the server's image libraries support WebP and AVIF image formats to the data payload sent during upgrade checks. Collecting this data with the WordPress.org API will help the project make more data driven decisions about feature support. Note that all data can still be filtered with the `core_version_check_query_args` filter for privacy reasons.

Props dd32, SergeyBiryukov, mikeschroder, pbiron. 
Fixes #48116.


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


git-svn-id: http://core.svn.wordpress.org/trunk@53312 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-21 20:22:09 +00:00
audrasjb
6b06b2cc25 Application Passwords: Link a more accurate documentation page in User profile edit screen.
This changeset replaces a HelpHub link with more accurate DevHub link about environment types in User profile edit screen.

Props greg24, whaze.
Fixes #56267.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53311 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-21 19:32:12 +00:00
Adam Silverstein
71ca314193 Media: enable generating multiple mime types for image uploads; specifically WebP versions for JPEG images by default.
This changeset adds the capability for core media uploads to generate sub sized images in more than a single mime type. The output formats for each mime type can be controlled through a filter. WebP is used as an additional output format for JPEG images by default to improve front end performance.

When generating additional mime types, only images which are smaller than the respective original are retained. By default, additional mime type images are only generated for the built-in core image sizes and any custom sizes that have opted in.

Image meta is updated with a new 'sources' array containing file details for each mime type. Each image size in the 'sizes' array also gets a new 'sources' array that contains the image file details for each mime type.

This change also increases image upload retries to accommodate additional image sizes. It also adds a `$mime_type` parameter to the `wp_get_missing_image_subsizes` function and filter.

This change adds three new filters to enable full control of secondary mime image generation and output:

* A new filter `wp_image_sizes_with_additional_mime_type_support` that filters the sizes that support secondary mime type output. Developers can use this to control the output of additional mime type sub-sized images on a per size basis.
* A new filter `wp_upload_image_mime_transforms` that filters the output mime types for a given input mime type. Developers can use this to control generation of additional mime types for a given input mime type or even override the original mime type.
* A new filter `wp_content_image_mimes` which controls image mime type output selection and order for frontend content. Developers can use this to control the mime type output preference order for content images. Content images inserted from the media library will use the available image versions based on the order from this filter.

Thanks to the many contributors who helped develop, test and give feedback on this feature.

A haiku to summarize:

Upload a JPEG
Images of all sizes
Output as WebPs

Props flixos90, MatthiasReinholz, studiolxv, markhowellsmead, eatingrules, pbiron, mukesh27, joegrainger, mehulkaklotar, tweetythierry, akshitsethi, peterwilsoncc, eugenemanuilov, mitogh, shetheliving, clarkeemily, codekraft, mikeschroder, clorith, kasparsd, spacedmonkey, trevorpfromsandee, jb510, scofennellgmailcom, seedsca, cagsmith, karinclimber, dainemawer, baxbridge, grapplerulrich, sobatkras, chynnabenton, tonylocalword, barneydavey, kwillmorth, garymatthews919, olliejones, imarkinteractive, jeffpaul, feastdesignco, webbeetle, masteradhoc.

See #55443.


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


git-svn-id: http://core.svn.wordpress.org/trunk@53310 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-21 18:03:13 +00:00
Sergey Biryukov
23e60ed765 Coding Standards: Replace the old wp-db.php filename in phpcompat.xml.dist.
This ensures the correct file is allowlisted for use of `mysql_` extension in PHP < 7.0.

Follow-up to [53749].

See #56268, #55647.
Built from https://develop.svn.wordpress.org/trunk@53750


git-svn-id: http://core.svn.wordpress.org/trunk@53309 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-21 16:09:12 +00:00
Sergey Biryukov
8484c7babb Coding Standards: Move wp-includes/wp-db.php to wp-includes/class-wpdb.php.
This renames the file containing the `wpdb` class to conform to the coding standards.

This commit also includes:
* A new `wp-db.php` that loads the new file, for anyone that may have been including the file directly.
* Replacing references to the old filename with the new filename.

Fixes #56268. See #55647.
Built from https://develop.svn.wordpress.org/trunk@53749


git-svn-id: http://core.svn.wordpress.org/trunk@53308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-21 16:00:15 +00:00
audrasjb
0ccc01839a Docs: Update do_action() docblock code example.
This changeset fixes an issue with the code example provided: `do_action()` doesn't return any value.

Props leogermani, thakkarhardik.
Fixes #55977.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53307 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-21 14:32:12 +00:00
Sergey Biryukov
ee4f7d7415 Coding Standards: Adjust the logic slightly in wp_ajax_replyto_comment().
This aims to bring more consistency to the function logic by separating the comment content and type checks from the user existence check.

Follow-up to [8720], [9098], [29758].

See #55647.
Built from https://develop.svn.wordpress.org/trunk@53747


git-svn-id: http://core.svn.wordpress.org/trunk@53306 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-21 10:59:10 +00:00
audrasjb
49dd15fb6b Docs: Add missing function description in wp-admin/includes/template.php.
This changeset also includes a few docblock standards fixes in the same file.

See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53305 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-21 09:24:10 +00:00
audrasjb
70f9851fda Administration: Add labels to read-only form fields.
This changeset improves admin forms accessibility by adding labels to the following read-only form fields:

- Network setup screen: new visible label to the four textareas for code users need to paste into their wp-config file and the server configuration file (web.config or .htaccess).
- `setup-config.php`: new visible label to one textarea for code to include in the `wp-config` file manually.
- Admin toolbar: adds an `arial-label` attribute to the old "shortlink" feature (not used anymore but still activable by plugins).

Props sabernhardt, audrasjb, ryokuhi, joedolson.
Fixes #54302.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53304 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-21 09:04:14 +00:00
Peter Wilson
02f3628e20 Embeds: Add Pocket Casts as a trusted oEmbed provider.
Props mattwondra, peterwilsoncc, pento, audrasjb.
Fixes #55860.


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


git-svn-id: http://core.svn.wordpress.org/trunk@53303 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-21 04:25:13 +00:00
audrasjb
4770e926ab Docs: Use third-person singular verbs for function descriptions in wp-admin/includes/comment.php, as per docblocks standards.
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53302 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-20 22:15:10 +00:00
audrasjb
0df025d2bd Docs: Add missing function description in wp-admin/includes/comment.php.
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53301 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-20 22:12:09 +00:00
audrasjb
bcf4ff0c3f Themes: Add a hook to filter theme header image URL.
This changeset introduces the `get_header_image` filter, which can be used to modify header image URL returned by `get_header_image()`, in themes that support the Header Image feature. 

Props hztyfoon, audrasjb, mukesh27, SergeyBiryukov, costdev.
Fixes #56180.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53300 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-20 21:13:09 +00:00
audrasjb
63d113e62c Docs: Use third-person singular verbs for function descriptions in general-template.php, as per docblocks standards.
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53299 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-20 20:37:07 +00:00
desrosj
3e1fd05600 Twenty Twenty-One: Rebuild the IE specific stylesheet.
This was missed in [53517].

See #55989.
Built from https://develop.svn.wordpress.org/trunk@53739


git-svn-id: http://core.svn.wordpress.org/trunk@53298 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-20 19:20:11 +00:00
desrosj
8e91a8f995 Build/Test Tools: Add tag pattern matching for the testing NPM workflow.
This workflow was missed in [50298].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53737


git-svn-id: http://core.svn.wordpress.org/trunk@53296 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-20 18:52:10 +00:00
desrosj
44412840a8 Build/Test Tools: Make the GitHub Action pattern matching for tags more specific.
This improves the tag pattern matching for GitHub Action workflows to be more specific. The `*` wildcard in the current patterns matches any character except slash (`/`). While this correctly matches a version like `X.Y.Z`, it could also match non-numeric characters.

This changes patterns to use the `+` character, which matches one or more of the preceding characters (`[0-9]` in this case).

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53736


git-svn-id: http://core.svn.wordpress.org/trunk@53295 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-20 18:41:11 +00:00
desrosj
cfe7d795f5 Build/Test Tools: Correctly detect the first workflow run for a branch or tag.
When trying to determine the outcome of the previous run for a GitHub Action workflow, the current run is included in the list fetched from the GitHub API.

This adjusts the logic checking for the previous run to account for that and fixes notifications for the first workflow runs of a new branch or tag.

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53735


git-svn-id: http://core.svn.wordpress.org/trunk@53294 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-20 17:43:13 +00:00
Sergey Biryukov
486602cfca Docs: Add a @since note for get_post_permalink() returning false on failure.
Follow-up to [53733].

See #45329.
Built from https://develop.svn.wordpress.org/trunk@53734


git-svn-id: http://core.svn.wordpress.org/trunk@53293 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-20 15:46:09 +00:00
Sergey Biryukov
4bfc1358a0 Posts, Post Types: Correct the check for non-existing post in get_post_permalink().
The function was erroneously calling `is_wp_error()` on the result of a `get_post()` call, which returns `null` on failure, and never returns a `WP_Error` object.

Previously, passing a non-existing post ID to the function would result in a home URL being returned and a few `Attempt to read property "post_type, post_name, hierarchical..." on null` PHP warnings.

This commit ensures `get_post_permalink()` returns `false` on failure, which brings parity with `get_permalink()`.

Includes a unit test to confirm the correct behavior.

Follow-up to [12923], [13023], [32606].

Props renegeuze, manzoorwani.jk.
Fixes #45329.
Built from https://develop.svn.wordpress.org/trunk@53733


git-svn-id: http://core.svn.wordpress.org/trunk@53292 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-20 15:41:09 +00:00
Sergey Biryukov
d77d8384ad Tests: Correct the test for passing all expected parameters to the preprocess_comment filter.
Previously, `assertSame()` was replaced with `assertSameSets()`, which does not preserve the array keys. `assertSameSetsWithIndex()` should have been used instead.

Follow-up to [36038], [48937], [53729], [53730].

See #55647, #56244.
Built from https://develop.svn.wordpress.org/trunk@53732


git-svn-id: http://core.svn.wordpress.org/trunk@53291 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-20 14:49:12 +00:00
desrosj
04cea1d615 Administration: Remove unused CSS selectors related to old format menu icons.
This removes all CSS definitions related to the `.icon16` class. Research shows that current ecosystem usage of this class is extremely minimal.

This selector was used for the Welcome Panel and Welcome Screen in WordPress 3.3 (see [19163] and [19197]. The icons were removed for WordPress 3.5 in [22018], but the related CSS remained, and were also included when the MP6 admin re-skinning was merged in [26072].

Props afercia, mmaumio, isabel_brison, sabernhardt, audrasjb, desrosj.
Fixes #35717.
Built from https://develop.svn.wordpress.org/trunk@53731


git-svn-id: http://core.svn.wordpress.org/trunk@53290 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-20 14:39:09 +00:00
Sergey Biryukov
c0065475f3 Coding Standards: Remove extra comma in a compact() call.
This fixes a PHP compatibility error in `wp_handle_comment_submission()`:

* `Trailing comma's are not allowed in function calls in PHP 7.2 or earlier`

Follow-up to [53729].

See #55647, #56244.
Built from https://develop.svn.wordpress.org/trunk@53730


git-svn-id: http://core.svn.wordpress.org/trunk@53289 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-20 14:22:08 +00:00
Sergey Biryukov
e2a5b8684e Coding Standards: Standardize on user_id when passing data to comment functions.
The `wp_new_comment()`, `wp_update_comment()`, and `wp_filter_comment()` functions already normalize the `user_ID` parameter internally to `user_id`, which matches the database field name.

This commit aims to bring some consistency when passing the parameter in core.

The corresponding `$user_ID` variable is also renamed to `$user_id` to match the other variables when not referring to the `$user_ID` global, which has an exception in the WordPress coding standards.

Follow-up to [8543], [8720], [12267], [12300], [26491], [28915], [28922], [34799], [49303].

See #55647, #56244.
Built from https://develop.svn.wordpress.org/trunk@53729


git-svn-id: http://core.svn.wordpress.org/trunk@53288 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-20 14:14:09 +00:00
audrasjb
917e850008 Docs: Use third-person singular verbs for function descriptions in block-template.php and block-template-utils.php.
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53287 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-20 13:21:08 +00:00
audrasjb
6d9424f138 Docs: Fix indentation issues in block-template-utils.php docblocks, as per docs standards.
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53286 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-20 13:14:10 +00:00
audrasjb
79c4babf39 Plugins: Improve color contrast on plugins screen when recovery mode is activated.
This changeset replaces `#d63638` (contrast ratio: 4.40) with `#b32d2e` (contrast ratio: 5.87) in Plugins screen row action links when the site is in recovery mode.

Props kebbet, mukesh27, joedolson, audrasjb.
Fixes #56190.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53285 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-20 11:37:15 +00:00
desrosj
866abfda9f External Libraries: Update the Moment library to version 2.29.4.
This is a minor bug fix release.

Props dilipbheda.
Fixes #56031.
Built from https://develop.svn.wordpress.org/trunk@53725


git-svn-id: http://core.svn.wordpress.org/trunk@53284 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-19 19:43:25 +00:00
Sergey Biryukov
81b7b229ed Coding Standards: Use consistent placement for ::prepare_links() methods.
This moves the `::prepare_links()` methods in REST API classes next to `::prepare_item_for_response()` where they are used, to bring some consistency across the classes and make code navigation easier.

Includes wrapping some long lines for better readability.

Follow-up to [52079], [52051], [52342], [53721], [53722].

See #55647.
Built from https://develop.svn.wordpress.org/trunk@53724


git-svn-id: http://core.svn.wordpress.org/trunk@53283 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-19 16:22:09 +00:00
Sergey Biryukov
69a8ecce33 Coding Standards: Rename $comment_post_ID and $comment_author_IP variables in various files.
This fixes two WPCS warnings:
* `Variable "$comment_post_ID" is not in valid snake_case format`
* `Variable "$comment_author_IP" is not in valid snake_case format`

While matching the database fields of the same name, these variables did not follow the WordPress coding standards, and are now renamed to address that.

Note: The name change only affects internal variables and parameters for a few actions receiving a comment post ID:

* `edit_comment`
* `comment_id_not_found`
* `comment_closed`
* `comment_on_trash`
* `comment_on_draft`
* `comment_on_password_protected`
* `pre_comment_on_post`

The change does not affect parameters for functions receiving an array of comment data:

* `wp_insert_comment()`
* `wp_new_comment()`
* `wp_update_comment()`
* `wp_handle_comment_submission()`

The associated array keys still match the database fields: `comment_post_ID` and `comment_author_IP`.

Follow-up to [1706], [2894], [8720], [28427], [28437], [28457], [34799], [53720],

See #55647, #56244.
Built from https://develop.svn.wordpress.org/trunk@53723


git-svn-id: http://core.svn.wordpress.org/trunk@53282 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-19 16:19:11 +00:00
spacedmonkey
31c061e89d REST API: Add prepare_links method to WP_REST_Taxonomies_Controller class.
Move logic to from `prepare_item_for_response` to `prepare_links` method to bring `WP_REST_Taxonomies_Controller` class inline with other REST API controllers.

Props Spacedmonkey, timothyblynjacobs, dlh.
Fixes #56020.
Built from https://develop.svn.wordpress.org/trunk@53722


git-svn-id: http://core.svn.wordpress.org/trunk@53281 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-19 14:54:08 +00:00
spacedmonkey
070bc9b5ea REST API: Add prepare_links method to WP_REST_Post_Types_Controller class.
Move logic to from `prepare_item_for_response` to `prepare_links` method to bring `WP_REST_Post_Types_Controller` class inline with other REST API controllers.

Props Spacedmonkey, timothyblynjacobs, dlh.
Fixes #56019.
Built from https://develop.svn.wordpress.org/trunk@53721


git-svn-id: http://core.svn.wordpress.org/trunk@53280 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-19 14:49:08 +00:00
Sergey Biryukov
9fbd3b5403 Coding Standards: Remove unused variable in wp-trackback.php.
This was present in the initial import of b2 files, but appears to have never been used in WordPress core.

Follow-up to [3], [636], [637], [1616].

See #55647.
Built from https://develop.svn.wordpress.org/trunk@53720


git-svn-id: http://core.svn.wordpress.org/trunk@53279 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-19 14:17:09 +00:00
Sergey Biryukov
f14f6a162a Coding Standards: Improve variable names in wp-trackback.php.
This fixes a `Variable "$comment_post_ID" is not in valid snake_case format` WPCS warning.

`$comment_post_ID`, while matching the database field of the same name, does not follow the WordPress coding standards, so the variable is now renamed to `$comment_post_id`.

Additionally, these variables are renamed for clarity:

* `$tb_id` to `$post_id` (this was not the trackback ID)
* `$tb_url` to `$trackback_url`

Follow-up to [172], [637], [1616], 

See #55647, #56244.
Built from https://develop.svn.wordpress.org/trunk@53719


git-svn-id: http://core.svn.wordpress.org/trunk@53278 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-19 14:02:10 +00:00
gziolo
fdcb34fad3 Editor: Fix register_block_type does not recognise ancestor block setting
When registering block through PHP, using `register_block_type` function, newly introduced `ancestor` block setting in `block.json` was not recognised. It worked though, when block is registered from JavaScript.

Props lovor, annezazu.
Fixes #56184.



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


git-svn-id: http://core.svn.wordpress.org/trunk@53277 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-19 13:24:12 +00:00
audrasjb
31a5eaf174 Upgrade/Install: Improve plugin update icon alignment.
This changeset improves the vertical alignment of the plugin update button in the Plugins screen.

Props Presskopp, sabernhardt, costdev, eherman24.
Fixes #56123.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53276 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-19 09:25:13 +00:00
audrasjb
e1dfa87a88 Twenty Twenty-One: Add block type suggestions to block patterns.
When using a given block, patterns which use that block can be suggested. This changeset adds `blockType` suggestion for several Twenty Twenty-One bundled patterns.

Props ryelle, poena, audrasjb.
Fixes #53647.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-19 08:56:14 +00:00
Sergey Biryukov
1069ac4afd Posts, Post Types: Standardize on $post parameter name where appropriate.
This renames the `$post_id` or `$id` parameters to `$post` for functions that accept a post ID or post object:

* `get_sample_permalink()`
* `get_sample_permalink_html()`
* `wp_check_post_lock()`
* `wp_set_post_lock()`
* `get_the_tags()`
* `comment_class()`
* `get_comment_class()`
* `get_comments_link()`
* `get_comments_number()`
* `comments_number()`
* `get_comments_number_text()`
* `comments_open()`
* `pings_open()`
* `comment_form()`
* `do_trackbacks()`
* `pingback()`
* `post_permalink()`
* `get_post_permalink()`
* `get_edit_post_link()`
* `edit_post_link()`
* `get_delete_post_link()`
* `post_class()`
* `get_post_class()`
* `the_attachment_link()`
* `wp_get_attachment_link()`
* `wp_list_post_revisions()`
* `check_and_publish_future_post()`
* `add_ping()`
* `get_pung()`
* `get_to_ping()`
* `wp_get_post_revisions()`
* `wp_get_post_revisions_url()`

Additionally, `$revision_id` is renamed to `$revision` in:

* `wp_restore_post_revision()`
* `wp_delete_post_revision()`

Includes minor documentation improvements for consistency and code layout fixes for better readability.

Follow-up to [1599], [1794], [2881], [3303], [3851], [5302], [6633], [6716], [6985], [7103], [7149], [7747], [8011], [8638], [8643], [8695], [9138], [9273], [11425], [11922], [11956], [12284], [12810], [12923], [13023], [13171], [25567], [27156], [27473], [28558], [28602], [33659], [38852], [47276], [47366], [48622], [49544], [49597], [52095].

See #56243, #55647.
Built from https://develop.svn.wordpress.org/trunk@53715


git-svn-id: http://core.svn.wordpress.org/trunk@53274 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-18 17:37:17 +00:00
Sergey Biryukov
4e0b801910 Coding Standards: Use MINUTE_IN_SECONDS where appropriate.
This aims to clarify the time units for some timeout or expiration values.

Follow-up to [11823], [13177], [21996], [37747].

See #55647.
Built from https://develop.svn.wordpress.org/trunk@53714


git-svn-id: http://core.svn.wordpress.org/trunk@53273 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-17 02:18:09 +00:00
Sergey Biryukov
0eff79af37 Coding Standards: Use a single input array on Permalink Settings screen.
This reduces the amount of code to edit in case of any changes to the default permalink structures.

Follow-up to [53706], [53710].

See #55647, #55498.
Built from https://develop.svn.wordpress.org/trunk@53713


git-svn-id: http://core.svn.wordpress.org/trunk@53272 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-17 01:38:08 +00:00
Sergey Biryukov
74b2659ce4 Permalinks: Use home_url() to set the URL base on Permalink Settings screen.
This brings more consistency with how the home URL is retrieved elsewhere in the admin.

Follow-up to [1567], [1664], [2746], [3029], [4144], [53710].

Props sabernhardt.
Fixes #56235.
Built from https://develop.svn.wordpress.org/trunk@53712


git-svn-id: http://core.svn.wordpress.org/trunk@53271 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-17 01:06:13 +00:00
Sergey Biryukov
82ee734e8b Permalinks: Add a guiding paragraph on the Permalink Settings screen.
This is intended as an introduction to permalink structure selection.

Props kebbet, costdev, hasanuzzamanshamim, mukesh27.
Fixes #55947.
Built from https://develop.svn.wordpress.org/trunk@53711


git-svn-id: http://core.svn.wordpress.org/trunk@53270 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-16 20:13:10 +00:00
Sergey Biryukov
033728a0b7 Coding Standards: Improve readability of wp-admin/options-permalink.php.
Includes: 
* Wrapping longer lines and reducing alignment levels to fit more data on the screen.
* Restoring `esc_attr()` for input values, which may include translatable parts.
* Adding comments to closing `</div>` tags and PHP `endif` statements.
* Reducing the context switching between HTML and PHP.
* Balancing PHP conditionals to better reflect the structure.
* Removing repeated function calls to improve performance.
* Renaming some variables for clarity and consistency.

Follow-up to [470], [601], [963], [1227], [1664], [2746], [3029], [6976], [7230], [11350], [14051], [14553], [21891], [34691], [34749], [37747], [38066], [41182], [41986], [42343], [43571], [48710], [50830], [51892], [53706].

See #55647.
Built from https://develop.svn.wordpress.org/trunk@53710


git-svn-id: http://core.svn.wordpress.org/trunk@53269 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-16 16:20:10 +00:00
joedolson
a65abecc15 Administration: Audible messages on AJAX error cases.
Issues appropriate audible messages via `wp.a11y.speak()` when `ajax-response.js` generates an error via `wp_die()`.

Props afercia, alexstine.
Fixes #54483.
Built from https://develop.svn.wordpress.org/trunk@53709


git-svn-id: http://core.svn.wordpress.org/trunk@53268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-16 01:08:10 +00:00
joedolson
9f851abc3f Coding Standards: Missed space in code indentation in [53707].
Fixes code style issue from [53707].

Follow up to [53707].

See #54483.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53267 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-15 23:59:09 +00:00
joedolson
38a13f94ba Login: Explicitly associate errors with input fields.
Add an `aria-describedby` relationship between login email/password input fields and displayed login error messages.

Props patrickgroot, rollybueno, afercia.
Fixes #54483.
Built from https://develop.svn.wordpress.org/trunk@53707


git-svn-id: http://core.svn.wordpress.org/trunk@53266 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-15 23:40:10 +00:00
joedolson
1d101bada0 Permalinks: Label and describe permalink settings fields.
Restructure the permalink settings fields so URL formats are communicated to screen readers through `aria-describedby` relationships, avoid the usage of implicitly labeled input fields, labeling the custom permalink format correctly, and clarifying values. Make settings `table` element presentational.

Props rishishah, sabernhardt, kebbet.
Fixes #55498.
Built from https://develop.svn.wordpress.org/trunk@53706


git-svn-id: http://core.svn.wordpress.org/trunk@53265 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-15 22:42:10 +00:00
Sergey Biryukov
35c65333bd Docs: Correct @since tags introduced in WordPress 6.0.1.
The associated changes were backported to the 6.0 branch, so the version should be 6.0.1 instead of 6.1.0.

This affects:
* `@since` tag for the `block-templates` feature in `create_initial_theme_features()`.
* `@since` tag for the `show_on_front`, `page_on_front`, and `page_for_posts` options on the REST API settings endpoint.

Follow-up to [53590], [53661].

Props tommusrhodus, johnbillion.
Fixes #56225.
Built from https://develop.svn.wordpress.org/trunk@53704


git-svn-id: http://core.svn.wordpress.org/trunk@53263 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-15 16:00:10 +00:00
Sergey Biryukov
cd6e4451f1 Docs: Document that allowed_tags() is no longer used in core as of WordPress 4.4.
Previously, it was used in core and older bundled themes to display the list of allowed tags in the comment form.

Follow-up to [709], [2009], [2012], [2032], [2040], [13030], [14365], [32858], [34316], [34351].

See #55646.
Built from https://develop.svn.wordpress.org/trunk@53703


git-svn-id: http://core.svn.wordpress.org/trunk@53262 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-15 14:15:08 +00:00
Sergey Biryukov
0eb9abd1fe Coding Standards: Rename the $user_id parameter of get_user_locale() to $user for accuracy.
Since the parameter accepts not only a user's ID, but also a `WP_User` object, `$user` is a more appropriate name, which better aligns with the `$post` parameter of functions that accept a post ID or a `WP_Post` object.

The pre-existing internal `$user` variable which contained a `WP_User` object is renamed to `$user_object` for clarity.

Follow-up to [38955].

Props aristath, poena, afercia, SergeyBiryukov.
See #55647.
Built from https://develop.svn.wordpress.org/trunk@53702


git-svn-id: http://core.svn.wordpress.org/trunk@53261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-15 13:45:11 +00:00
Sergey Biryukov
ccba239e04 Tests: Use a consistent way of setting the Administrator role in Ajax tests.
This removes some duplicate code in favor of calling the `WP_Ajax_UnitTestCase::_setRole()` method created specifically for this purpose and used in other tests.

Follow-up to [500/tests], [37288].

Props martin.krcho.
See #56203.
Built from https://develop.svn.wordpress.org/trunk@53701


git-svn-id: http://core.svn.wordpress.org/trunk@53260 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-14 14:28:09 +00:00
Sergey Biryukov
749720d897 Text Changes: Improve consistency of punctuation in some strings.
* Move the colon inside the `<strong>` tags in some `Error:` prefixes, to match other strings.
* Move the full stop at the end of some sentences outside of the `<strong>` tags used for individual phrases.

Follow-up to [11669], [23844], [53118], [53458], [53476].

Props NekoJonez, Presskopp.
Fixes #56027.
Built from https://develop.svn.wordpress.org/trunk@53700


git-svn-id: http://core.svn.wordpress.org/trunk@53259 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-14 14:10:11 +00:00
Sergey Biryukov
5a59007323 I18N: Remove code from a translatable string in wp-includes/ms-default-constants.php.
This replaces the `VHOST` and `SUBDOMAIN_INSTALL` constant names in a message in `ms_subdomain_constants()` with placeholders, as they don't need to be translated.

Follow-up to [36773].

Props weboccults, hztyfoon, pratiweb.
Fixes #56216.
Built from https://develop.svn.wordpress.org/trunk@53699


git-svn-id: http://core.svn.wordpress.org/trunk@53258 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-14 13:35:13 +00:00
John Blackbourn
5dc1150ea2 Users: Allow conditional supression of the email notifications that are sent when a new user account is registered.
This introduces the following new filters:

* `wp_send_new_user_notification_to_admin`
* `wp_send_new_user_notification_to_user`

Props janthiel, costdev, audrasjb, peterwilsoncc

Fixes #54874

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


git-svn-id: http://core.svn.wordpress.org/trunk@53257 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-12 21:05:16 +00:00
Sergey Biryukov
2cc9f73523 Editor: Include user's name in the wp_refresh_post_lock() response.
This ensures that the post lock data returned by the Heartbeat API is consistent.

Previously, `wp_check_locked_posts()` was updated to return the name of the user currently editing the post, but the `wp_refresh_post_lock()` response did not get a similar change.

Follow-up to [53070].

Props nathan.noom.
Fixes #56197.
Built from https://develop.svn.wordpress.org/trunk@53692


git-svn-id: http://core.svn.wordpress.org/trunk@53251 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-11 18:18:13 +00:00
Sergey Biryukov
a5cc224b3c Docs: Correct the type of the $number parameter in ngettext* filters.
This applies to:
* `ngettext`
* `ngettext_{$domain}`
* `ngettext_with_context`
* `ngettext_with_context_{$domain}`

Follow-up to [25565], [48136].

Props cyrillbolliger.
Fixes #56187.
Built from https://develop.svn.wordpress.org/trunk@53691


git-svn-id: http://core.svn.wordpress.org/trunk@53250 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-10 00:07:16 +00:00
Sergey Biryukov
9177df1ee7 Docs: Improve description for wp_plugin_update_rows() and wp_theme_update_rows().
Follow-up to [53689].

See #55646.
Built from https://develop.svn.wordpress.org/trunk@53690


git-svn-id: http://core.svn.wordpress.org/trunk@53249 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-09 12:59:11 +00:00
audrasjb
4f41d38512 Docs: Add missing function descriptions in wp-admin/includes/update.php.
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53248 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-08 20:13:12 +00:00
gziolo
4e3b22546f Tools: Automate backporting core blocks from Gutenberg to Core
Syncing stable blocks from the Gutenberg repository to wordpress-develop was a manual process, but it got automated with the script that runs together with syncing WordPress packages changed in the Gutenberg package.

Props zieladam.
Fixes #56179.



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


git-svn-id: http://core.svn.wordpress.org/trunk@53247 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-08 12:34:14 +00:00
Sergey Biryukov
b50ec525ac Tests: Remove @uses tags from the test suite.
* These were not used consistently, with only four instances across all the tests.
* Using this tag in combination with the `beStrictAboutCoversAnnotation="true"` setting will mark a test as "Risky" if code is executed during the test which is not annotated via `@covers` or `@uses` tags. That would make the maintainance of the tags very fiddly, while adding little additional value for the test code base.

Follow-up to [32995], [39914], [42636], [53682].

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


git-svn-id: http://core.svn.wordpress.org/trunk@53246 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-08 00:13:12 +00:00
Sergey Biryukov
ef2bce73e2 Tests: Separate the tests in basic.php for clarity.
There were two kinds of tests in this file:

* Tests for content of some files in the root directory:
 * `license.txt`
 * `SECURITY.md`
 * `package.json`
* Tests for some utility functions of the test framework itself:
 * `strip_ws()`
 * `test_mask_input_value()`

The latter are now moved to their own file, `utils.php`.

Follow-up to [22/tests], [81/tests], [103/tests], [25240], [26940], [28064], [28480], [28493], [28523], [28631], [42381], [47403], [53683].

See #39265, #55652.
Built from https://develop.svn.wordpress.org/trunk@53686


git-svn-id: http://core.svn.wordpress.org/trunk@53245 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-07 23:57:13 +00:00
Andrew Ozz
8091de83b5 Media:
- Deprecate `wp_get_attachment_thumb_file()`.
- Make `wp_get_attachment_thumb_url()` an alias of `wp_get_attachment_image_url()`. This fixes it to return the proper thumbnail URL and fall back to returning the URL to `image_meta['thumb']` if only that exists.

Props: markhowellsmead, mukesh27, csesumonpro, SergeyBiryukov, mikeschroder, killua99, joemcgill, mashukushibiki, mfgmicha, swissspidy, romulodl, nacin, JoshuaAbenazer, wonderboymusic, lonnylot, azaozz.
Built from https://develop.svn.wordpress.org/trunk@53685


git-svn-id: http://core.svn.wordpress.org/trunk@53244 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-07 23:32:11 +00:00
Andrew Ozz
b8b2693bdb Build/Test Tools: Add @covers tags to the taxonomy and category test groups.
Props pbeane, hellofromTonya, ironprogrammer, antonvlasenko, SergeyBiryukov, costdev.
See #39265.
Built from https://develop.svn.wordpress.org/trunk@53684


git-svn-id: http://core.svn.wordpress.org/trunk@53243 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-07 23:02:09 +00:00
Andrew Ozz
9a7c53ac4c Build/Test Tools: Add @coversNothing tags to the tests for some content in documentation and settings files.
Props pbeane, hellofromTonya, ironprogrammer, antonvlasenko, SergeyBiryukov, costdev.
See #39265.
Built from https://develop.svn.wordpress.org/trunk@53683


git-svn-id: http://core.svn.wordpress.org/trunk@53242 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-07 22:55:10 +00:00
Andrew Ozz
48dbe8c3f0 Build/Test Tools: Add @covers tags to the url test group.
Props pbeane, hellofromTonya, ironprogrammer, antonvlasenko, SergeyBiryukov, costdev.
See #39265.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53241 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-07 22:45:11 +00:00
Andrew Ozz
bdc1bbac2d Tests: Remove duplicate testcase test_get_privacy_policy_url_should_return_empty_when_privacy_policy_page_not_set() from Tests_Url_GetPrivacyPolicyUrl.
See: #39265.
Built from https://develop.svn.wordpress.org/trunk@53681


git-svn-id: http://core.svn.wordpress.org/trunk@53240 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-07 22:22:11 +00:00
Andrew Ozz
590b9278ff Build/Test Tools: Add and fix @covers tags to the attachments and block-supports test groups.
Props pbeane, hellofromTonya, ironprogrammer, antonvlasenko, SergeyBiryukov, costdev.
See #39265.
Built from https://develop.svn.wordpress.org/trunk@53680


git-svn-id: http://core.svn.wordpress.org/trunk@53239 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-07 21:08:13 +00:00
audrasjb
a5f489189d Docs: Misc. docblock enhancements in WP_REST_Menu_Items_Controller class, as per docblock standards.
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53238 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-07 12:32:12 +00:00
audrasjb
e17247c78b REST API: Consolidate menu item type_label schema declaration.
This changeset removes a duplicate definition of the `type_label` property and consolidates the description of this property.

Props dlh, SergeyBiryukov.
Fixes #56072.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53237 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-07 12:21:14 +00:00
desrosj
b5a14f47bb Themes: Properly escape home_url() when changing and updating themes.
Props obayedmamur, hurayraiit, costdev, shraboni, msnewas.
Fixes #56145.
Built from https://develop.svn.wordpress.org/trunk@53677


git-svn-id: http://core.svn.wordpress.org/trunk@53236 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-06 19:46:10 +00:00
desrosj
7f43cc5d3a Coding Standards: Apply some alignment fixes after composer format.
Follow up to [53485].

See #55674.
Built from https://develop.svn.wordpress.org/trunk@53676


git-svn-id: http://core.svn.wordpress.org/trunk@53235 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-06 19:31:14 +00:00
audrasjb
8de9cf1d8b Docs: Convert "Application Passwords" to lowercase in WP_Application_Passwords docblocks, for better consistency.
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53232 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-06 11:55:11 +00:00
audrasjb
09f8333b0b Docs: Typo correction in WP_Application_Passwords docblocks.
Props im_niloy.
Fixes #56155.
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53231 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-06 10:38:07 +00:00
Sergey Biryukov
3796360ba0 Coding Standards: Simplify the logic for setting DB host and port in wpdb::parse_db_host().
This removes an extra `foreach` loop and the only variable variable (`$$component`) in core.

Follow-up to [20088,28342,28736-28747], [41629], [41820], [42226], [53670].

Props johnjamesjacoby.
See #54877, #55647.
Built from https://develop.svn.wordpress.org/trunk@53671


git-svn-id: http://core.svn.wordpress.org/trunk@53230 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-06 10:32:12 +00:00
Peter Wilson
d7d9adbf02 Database: Ensure MySQL port numbers are numeric in wpdb.
Ensure the database port number is recorded as an integer or `null` (the default port) when parsing the database host.

This is to prevent PHP/MySQLi throwing an exception caused by ports represented as numeric strings.

Props audrasjb, azouamauriac, chaion07, costdev, johnjamesjacoby, jrf, sergeybiryukov.
Fixes #54877.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53229 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-06 05:33:17 +00:00
Peter Wilson
1ace1a4d2b Taxonomy: Retain default term option when unregistering taxos.
No longer delete the default term option in `unregister_taxonomy()` to improve database performance.

Since taxonomies are registered at runtime and can't be unregistered unless they're already registered, prior to this 
change the option was created and deleted on each request.

Deleting the option should occur on a one-time opperation such as plugin deactivation.

Follow up to [48480].

Props dlh.
Fixes #54472.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53228 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-06 05:11:12 +00:00
Sergey Biryukov
228bbf3f7f Block Patterns: Update the value used for keywords.
Patterns on the [https://wordpress.org/patterns/ Pattern Directory] can have keywords for better discoverability while searching. The way these are stored [69548ff1f0 was changed from a taxonomy to meta value], but the `/wp/v2/pattern-directory/patterns` endpoint was still pulling from that old value.

The correct property to use for this field is `meta.wpop_keywords`, which returns a single string with comma-separated keywords.

Props ryelle, TimothyBlynJacobs.
See #56126.
Built from https://develop.svn.wordpress.org/trunk@53665


git-svn-id: http://core.svn.wordpress.org/trunk@53224 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-05 16:03:13 +00:00
Sergey Biryukov
3d05e52827 Themes: Revert the change of theme preview width on Add Themes screen.
The intention was for the preview ratio to remain accurate for the user's screen size when the sidebar is open, but this appears to have caused unintended side effects to the preview alignment.

Follow-up to [52647].

Props superbthemescom, Presskopp.
Fixes #56097. See #54764.
Built from https://develop.svn.wordpress.org/trunk@53663


git-svn-id: http://core.svn.wordpress.org/trunk@53222 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-05 15:36:12 +00:00
desrosj
3ff86728e5 External Libraries: Update the Moment library to version 2.29.3.
This is a minor bug fix release.

Props dilipbheda.
Fixes #56031.
Built from https://develop.svn.wordpress.org/trunk@53662


git-svn-id: http://core.svn.wordpress.org/trunk@53221 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-05 15:21:26 +00:00
desrosj
2ab810d14c External Libraries: Update the Underscore library to version 1.13.4.
This is a minor documentation and bug fix release.

Props christinavoudouris, dilipbheda.
Fixes #56030.
Built from https://develop.svn.wordpress.org/trunk@53660


git-svn-id: http://core.svn.wordpress.org/trunk@53219 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-05 15:01:25 +00:00
Sergey Biryukov
f9e979a74c Themes: Register the block-templates theme feature.
This ensures the feature is included in the `theme_supports` REST API data for the active theme.

Follow-up to [48171].

Props grantmkin, TimothyBlynJacobs, addiestavlo.
Fixes #55681.
Built from https://develop.svn.wordpress.org/trunk@53659


git-svn-id: http://core.svn.wordpress.org/trunk@53218 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-05 14:59:16 +00:00
Sergey Biryukov
6d78a736ee Editor: Update block editor packages for WordPress 6.0.1.
This brings a new version of the Gutenberg code from the [https://github.com/WordPress/gutenberg/tree/wp/6.0 wp/6.0 branch] into core.

Original PR from Gutenberg repository:
* #GB42131 Post Comments Form: Fix warning i18n

The following packages were updated:
* `@wordpress/block-directory` to `3.4.13`
* `@wordpress/block-library` to `7.3.13`
* `@wordpress/customize-widgets` to `3.3.13`
* `@wordpress/edit-post` to `6.3.13`
* `@wordpress/edit-site` to `4.3.13`
* `@wordpress/edit-widgets` to `4.3.13`

Props zieladam, bernhard-reiter, tobifjellner.
See #56058.
Built from https://develop.svn.wordpress.org/trunk@53657


git-svn-id: http://core.svn.wordpress.org/trunk@53216 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-05 14:38:33 +00:00
desrosj
9635543e0f General: Properly escape home_url() links in wp_page_menu().
Props sabbirmc, tushar284, costdev.
Fixes 56148.
Built from https://develop.svn.wordpress.org/trunk@53656


git-svn-id: http://core.svn.wordpress.org/trunk@53215 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-05 14:14:21 +00:00
spacedmonkey
6e619966a6 Users: Prime user meta in WP_User_Query class.
When querying 'fields' equal to 'all' using the `WP_User_Query` class, this returns an array of `WP_User` objects. A `WP_User` object requires user meta to be primed, as the user's role is stored in user meta. Ensure that all users meta is primed in a single request by calling the `cache_users` function when querying 'fields' equal to 'all'. Soft deprecate fields equal to `all_with_meta` as it now acts the same as 'fields' equal to 'all'.

Props Spacedmonkey, peterwilsoncc, mehulkaklotar, timothyblynjacobs, furi3r.
Fixes #55594.
Built from https://develop.svn.wordpress.org/trunk@53655


git-svn-id: http://core.svn.wordpress.org/trunk@53214 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-05 09:28:13 +00:00
audrasjb
0f3b3218c2 Menus: Use more appropriate escaping functions in class Walker_Nav_Menu_Edit.
This changeset replaces `esc_attr` escaping function with `esc_url` as it is more appropriate in the context of a link's `href` attribute.

Props audrasjb, aniketpatel.
Fixes #56108.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53213 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-05 08:06:17 +00:00
Peter Wilson
2c768f7c9d Cron API: Make wp-cron non-blocking for LiteSpeed LSAPI.
This should make cron spawning faster on LSAPI by ensuring that cron requests return immediately.

To avoid code repetition, the no caching headers are relocated and always sent. Caching plugins attempting to set these 
headers later will replace those set by WordPress Core.

Follow up to [44488].

Props maximej, johnbillion.
Fixes #54668.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53212 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-05 03:14:14 +00:00
Peter Wilson
e54b4ad284 Media: Add tests for wp_img_tag_add_decoding_attr().
Add new tests skipped in original commit. Follow up to [53480].

Fixes #53232.


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


git-svn-id: http://core.svn.wordpress.org/trunk@53211 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-05 00:48:14 +00:00
Sergey Biryukov
0ea522b7a8 Help/About: Add help tab info for the "Send password reset" row action on Users screen.
This adds a description in the "Available Actions" help tab for the "Send password reset" quick action when hovering over a username in the user list.

Follow-up to [50129].

Props kebbet, costdev.
Fixes #55801.
Built from https://develop.svn.wordpress.org/trunk@53651


git-svn-id: http://core.svn.wordpress.org/trunk@53210 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-05 00:25:13 +00:00
Sergey Biryukov
8f37ef9daa Docs: Update the version in which Meetup.com was removed as an oEmbed source.
Meetup.com was previously removed as an oEmbed source, since they have deprecated their endpoint. The block has also been removed from the editor, see #GB35085.

This commit updates the associated changelog entry for the `oembed_providers` filter to version 6.0.1, as the change is being backported to the 6.0 branch.

Follow-up to [53540].

See #55997.
Built from https://develop.svn.wordpress.org/trunk@53646


git-svn-id: http://core.svn.wordpress.org/trunk@53205 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-04 18:15:15 +00:00
Sergey Biryukov
0705b9daed Editor: Update block editor packages for WordPress 6.0.1.
This brings a new version of the Gutenberg code from the [https://github.com/WordPress/gutenberg/tree/wp/6.0 wp/6.0 branch] into core.

The following packages were updated:
* `@wordpress/block-directory` to `3.4.12`
* `@wordpress/block-editor` to `8.5.9`
* `@wordpress/block-library` to `7.3.12`
* `@wordpress/components` to `19.8.5`
* `@wordpress/customize-widgets` to `3.3.12`
* `@wordpress/edit-post` to `6.3.12`
* `@wordpress/edit-site` to `4.3.12`
* `@wordpress/edit-widgets` to `4.3.12`
* `@wordpress/editor` to `12.5.9`
* `@wordpress/format-library` to `3.4.9`
* `@wordpress/icons` to `8.2.3`
* `@wordpress/interface` to `4.5.6`
* `@wordpress/list-reusable-blocks` to `3.4.5`
* `@wordpress/nux` to `5.4.5`
* `@wordpress/plugins` to `4.4.3`
* `@wordpress/preferences` to `1.2.5`
* `@wordpress/reusable-blocks` to `3.4.9`
* `@wordpress/server-side-render` to `3.4.6`
* `@wordpress/widgets` to `2.4.9`

Props zieladam.
See #56058.
Built from https://develop.svn.wordpress.org/trunk@53644


git-svn-id: http://core.svn.wordpress.org/trunk@53203 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-04 12:06:43 +00:00
Sergey Biryukov
e70ac7004c Coding Standards: Escape the home URL in the "Background updated. Visit your site" message.
This affects `Custom_Background::admin_page()`.

Follow-up to [13041], [45662], [53642].

Props robinwpdeveloper, sajjad67, rudlinkon, hztyfoon, costdev.
Fixes #56133.
Built from https://develop.svn.wordpress.org/trunk@53643


git-svn-id: http://core.svn.wordpress.org/trunk@53202 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-04 10:14:14 +00:00
Sergey Biryukov
eb08ad9160 Coding Standards: Escape the home URL in the "Header updated. Visit your site" message.
This affects `Custom_Image_Header::step_1()`.

Follow-up to [12890], [45654].

Props jakariaistauk, rudlinkon, hztyfoon, costdev.
Fixes #56132.
Built from https://develop.svn.wordpress.org/trunk@53642


git-svn-id: http://core.svn.wordpress.org/trunk@53201 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-04 10:11:12 +00:00
audrasjb
7c94f45bb0 Docs: Use third-person singular verbs for function descriptions in WP_Comments_List_Table class, as per docblock standards.
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53200 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-04 08:20:15 +00:00
audrasjb
ec9b9bee76 Comments: Use more appropriate escaping functions in class WP_Comments_List_Table.
This changeset replaces `esc_attr` escaping function with `esc_html` as it is more appropriate in this context.

Props chintan1896, afragen, peterwilsoncc, SergeyBiryukov.
Fixes #56101.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53199 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-04 08:16:16 +00:00
audrasjb
a72203aa54 Docs: Add missing docblock description for install_themes_upload().
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53198 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-04 08:00:15 +00:00
Sergey Biryukov
5cfb35a5f2 Docs: Add @since tags for _doing_it_wrong() and deprecation notice handlers in the PHPUnit test suite.
This affects methods in the `WP_UnitTestCase_Base` class:
* `::expectDeprecated()`
* `::expectedDeprecated()`
* `::setExpectedException()`
* `::deprecated_function_run()`
* `::doing_it_wrong_run()`

Follow-up to [25402], [25408], [25785], [37861], [40536], [40539], [40872], [51872], [53637].

See #55652, #55646.
Built from https://develop.svn.wordpress.org/trunk@53638


git-svn-id: http://core.svn.wordpress.org/trunk@53197 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-03 17:30:09 +00:00
Sergey Biryukov
b8da90698c Build/Test Tools: Include the actual _doing_it_wrong() message or deprecation notice in the output.
This aims to provide better context and more details if an unexpected `_doing_it_wrong()` message or deprecation notice is encountered during a test run.

Previously, this would display a message like `Unexpected incorrect usage notice for [...]`, but without any further details, making it harder to track down the actual issue.

Follow-up to [25402], [25408], [25785], [37861], [51872].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53637


git-svn-id: http://core.svn.wordpress.org/trunk@53196 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-03 16:41:14 +00:00
John Blackbourn
c29d3d8142 Build/Test Tools: Enable loopback requests to work on the local development environment.
This maps `localhost` to the host machine so the requests get routed to the web server container.

Props sandrasanzdev, hasanuzzamanshamim

Fixes #52708

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


git-svn-id: http://core.svn.wordpress.org/trunk@53195 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-02 22:54:12 +00:00
Sergey Biryukov
d7efd9a793 Docs: Add @since tags for wp_die() handlers in the PHPUnit test suite.
Follow-up to [289/tests], [28797], [41966], [53634].

See #55652, #55646.
Built from https://develop.svn.wordpress.org/trunk@53635


git-svn-id: http://core.svn.wordpress.org/trunk@53194 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-02 18:29:11 +00:00
Sergey Biryukov
6ee60c3ebe Build/Test Tools: Add support for WP_Error in the test suite's wp_die() handlers.
This brings parity with WordPress core `wp_die()` handlers and ensures that if a `WP_Error` object is passed as the `$message` argument to `wp_die()`, the PHPUnit test suite displays the error message correctly.

Previously, this would cause a silent fatal error: `Object of class WP_Error could not be converted to string`, leading to just displaying `wp_die called` without any further details.

Follow-up to [28797], [41966], [44666], [45160], [47882].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53634


git-svn-id: http://core.svn.wordpress.org/trunk@53193 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-02 18:07:11 +00:00
Sergey Biryukov
9bea9ddfc9 Editor: Alphabetize block lists in various places.
This affects:
* `wp-includes/blocks/index.php`
* `tools/webpack/blocks.js`
* `_unhook_block_registration()` in `tests/phpunit/includes/functions.php`

Follow-up to [47250], [52069], [52730], [53157], [53278].

Fixes #56131.
Built from https://develop.svn.wordpress.org/trunk@53633


git-svn-id: http://core.svn.wordpress.org/trunk@53192 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-02 17:46:13 +00:00
Sergey Biryukov
354545bc3e Editor: Register the Comments Query Loop block from metadata.
This ensures that the block title and description can be translated.

Follow-up to [53157].

Props cbravobernal, bernhard-reiter, adamziel, gziolo, peterwilsoncc, audrasjb, mukesh27, SergeyBiryukov.
Fixes #56093. See #55809.
Built from https://develop.svn.wordpress.org/trunk@53631


git-svn-id: http://core.svn.wordpress.org/trunk@53190 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-02 14:35:14 +00:00
Sergey Biryukov
1f87125366 Widgets: Add a comment in WP_Nav_Menu_Widget::form() to clarify the esc_attr() usage.
The URL to create a new menu from the the Navigation Menu widget can be a `javascript:` link to the Customizer Menus panel, so `esc_attr()` is used here instead of `esc_url()`.

Follow-up to [53092].

Props hztyfoon.
Fixes #56128.
Built from https://develop.svn.wordpress.org/trunk@53630


git-svn-id: http://core.svn.wordpress.org/trunk@53189 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-01 20:01:15 +00:00
John Blackbourn
c3188a2566 Build/Test Tools: Remove an unused build configuration file.
This is a configuration file for Apache Ant that is no longer used.

Fixes #52604

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


git-svn-id: http://core.svn.wordpress.org/trunk@53188 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-01 19:56:16 +00:00
John Blackbourn
f5cbb5585a Build/Test Tools: Run the PHP container with PID > 1 so Ctrl+C works correctly.
This allows for cancellation of operations in the PHP container, such as a PHPUnit test suite run.

Fixes #55702

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


git-svn-id: http://core.svn.wordpress.org/trunk@53187 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-01 19:37:14 +00:00
John Blackbourn
d50fbb4469 Taxonomy: Pass the $args parameter to all actions and filters in wp_insert_term() and wp_update_term().
This allows actions and filters to access potentially useful contextual information when terms are inserted and updated.

Props mboynes

Fixes #55441

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


git-svn-id: http://core.svn.wordpress.org/trunk@53186 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-01 19:09:14 +00:00
Sergey Biryukov
3e622b1d75 Twenty Eleven: Replace deprecated function calls on theme options page.
This includes:
* Removing the deprecated `screen_icon()` function call.
* Replacing the deprecated `get_current_theme()` function call with `get_option( 'current_theme' )`.
* Using `wp_get_theme()->display( 'Name' )` explicitly instead of relying on `WP_Theme`'s `__toString()` method, for clarity.

Follow-up to [6334], [20039], [20040], [20042], [20508], [26537], [41274].

Props Presskopp, cu121, viralsampat, costdev, tomjdv, sabernhardt, SergeyBiryukov.
Fixes #54833.
Built from https://develop.svn.wordpress.org/trunk@53626


git-svn-id: http://core.svn.wordpress.org/trunk@53185 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-01 14:26:15 +00:00
Sergey Biryukov
580d991349 Editor: Ensure only the main query is modified when resolving template for new posts.
This adds a check for the main query in `_resolve_template_for_new_post()` to fix a 404 response when resolving template for new posts or pages caused by the wrong query being modified.

Original PR from Gutenberg repository:
* [https://github.com/WordPress/gutenberg/pull/40799 #40799: Ensure only the main query is modified when resolving template for new posts]

Follow-up to [52316].

Props petitphp, zieladam, poena, ndiego, gziolo, kebbet, Mamaduka, manfcarlo.
See #56058.
Built from https://develop.svn.wordpress.org/trunk@53593


git-svn-id: http://core.svn.wordpress.org/trunk@53181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-30 15:48:15 +00:00
desrosj
296c363bc1 Build/Test Tools: Correct some GitHub Action workflow inline documentation.
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53592


git-svn-id: http://core.svn.wordpress.org/trunk@53180 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-30 15:09:15 +00:00
desrosj
856cee1568 Build/Test Tools: Remove the workflow_run event from the Slack notification workflow.
The `workflow_run` event was added to restore Slack notifications for older branches (5.8 and older) without having to backport any changes while alternate approaches were explored.

The workflow has been tested and refined as a reusable one in `trunk`, and this approach is superior to the `workflow_run` event in several ways.

Primarily, the `workflow_run` event results in a separate workflow run being created for sending Slack notifications after the completion of each workflow triggered by `push`. When called as a reusable workflow, this does not happen and the additional jobs are instead added to the initial workflow. This makes which jobs are sending notifications for the current workflow more clear, and reduces the amount of noise (less workflow runs overall).

The `workflow_run` event also makes some data available in different ways than `push` events. By removing it, much of the logic within the workflow can be simplified.

See #56095.
Built from https://develop.svn.wordpress.org/trunk@53591


git-svn-id: http://core.svn.wordpress.org/trunk@53179 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-30 14:07:14 +00:00
Sergey Biryukov
78d4db9924 REST API: Use the integer type for page_on_front and page_for_posts options.
This adjusts the newly added options in the settings endpoint to use the `integer` type instead of `number`. Since these are page IDs and are not supposed to be floats, `integer` is the correct type.

Follow-up to [53588].

See #56058.
Built from https://develop.svn.wordpress.org/trunk@53589


git-svn-id: http://core.svn.wordpress.org/trunk@53177 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-29 14:17:16 +00:00
Sergey Biryukov
126de33a0d REST API: Add missing options to the settings endpoint.
This adds the `show_on_front`, `page_on_front`, and `page_for_posts` options to the settings endpoint that were missed during WP 6.0 backports.

Related PR from Gutenberg repository:
* [https://github.com/WordPress/gutenberg/pull/38607 #38607 Page for Posts: Display notice in template panel]

Props Mamaduka, spacedmonkey, gziolo, jameskoster.
See #56058.
Built from https://develop.svn.wordpress.org/trunk@53588


git-svn-id: http://core.svn.wordpress.org/trunk@53176 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-29 13:48:14 +00:00
audrasjb
46eb690e8f Help/About: Typo correction in the Media Library help tab text.
Follow-up to [53586].

Props SergeyBiryukov.
Fixes #55800.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53175 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-29 13:39:14 +00:00
audrasjb
e170038ca1 Help/About: Add help tab info for available row actions in the Media Library.
This changeset fills the existing help tab with more detailed information about available row actions in the Media Library, when using the List view.

Props kebbet, audrasjb, costdev, SergeyBiryukov, mukesh27.
Fixes #55800.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53174 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-28 20:47:11 +00:00
audrasjb
d5971fc876 Docs: Misc fixes in Shortcode API function and hook descriptions, as per documentation standards.
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53173 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-28 20:37:15 +00:00
Sergey Biryukov
98beaad58d Docs: Adjust some DocBlocks in wpdb per the documentation standards.
Includes:
* Wrapping long single-line comments to multi-line for better readability.
* Formatting code blocks to display correctly on the Code Reference.
* Other minor edits for consistency.

This applies to:
* `wpdb::$allow_unsafe_unquoted_parameters`
* `wpdb::escape_identifier()`
* `wpdb::_escape_identifier_value()`
* `wpdb::prepare()`
* `wpdb::has_cap()`

Follow-up to [53575].

See #52506, #55646.
Built from https://develop.svn.wordpress.org/trunk@53584


git-svn-id: http://core.svn.wordpress.org/trunk@53172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-28 11:27:14 +00:00
desrosj
f210e677f1 Build/Test Tools: Update the actions/cache action.
This correctly updates the `actions/cache` action. [53581] updated the inline comment to the latest version but did not update the actual SHA value correctly.

Follow up to [53581].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53582


git-svn-id: http://core.svn.wordpress.org/trunk@53171 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-27 19:25:15 +00:00
desrosj
5f51f82e46 Build/Test Tools: Update 3rd party GitHub Actions.
This updates the following GitHub Actions to the latest versions:

- `actions/checkout`
- `actions/cache`
- `actions/github-script`
- `actions/setup-node`
- `codecov/codecov-action`
- `shivammathur/setup-php`
- `slackapi/slack-github-action`

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53581


git-svn-id: http://core.svn.wordpress.org/trunk@53170 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-27 18:58:13 +00:00
desrosj
9930476af2 Build/Test Tools: Update NPM devDependencies to their latest versions.
This updates the following `devDependencies` to newer versions:

- `dotenv` from `16.0.0` to `16.0.1`.
- `grunt` from `1.5.2` to `1.5.3`.
- `grunt-contrib-qunit` from `6.0.0` to `6.2.0`.
- `grunt-contrib-uglify` from `5.2.1` to `5.2.2`.
- `qunit` from `2.18.2` to `2.19.1`.
- `sass` from `1.51.0` to `1.53.0`.
- `sinon` from `13.0.2` to `14.0.0`.
- `uglify-js` from `3.15.4` to `3.16.1`.

Additionally, `npm audit fix` has been run to update dependencies with vulnerabilities.

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53580


git-svn-id: http://core.svn.wordpress.org/trunk@53169 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-27 18:53:29 +00:00
Sergey Biryukov
729831b40f General: Revert an earlier define of the WPINC constant in src/index.php.
This avoids a `Constant WPINC already defined in src/wp-settings.php on line 16` PHP warning, which happens when running a WordPress install out of the `src` directory after `npm run build:dev`.

Add a comment to clarify the check for built assets and the direct mention of `wp-includes`.

Follow-up to [53518].

Props aristath.
See #54233.
Built from https://develop.svn.wordpress.org/trunk@53579


git-svn-id: http://core.svn.wordpress.org/trunk@53168 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-27 10:20:19 +00:00
Sergey Biryukov
79efd59bca Upgrade/Install: Add a conditional to facilitate testing of the Rollbacks feature project.
The [https://make.wordpress.org/core/2021/02/19/feature-plugin-rollback-update-failure/ Rollback Update Failure feature project] creates a temporary backup of plugins and themes before updating. This aims to make the update process more reliable and ensure that if a plugin or theme update fails, the previous version can be safely restored.

If the [https://wordpress.org/plugins/rollback-update-failure/ Rollback Update Failure plugin] is installed, `WP_Upgrader::install_package()` will use the `move_dir()` function from there for better performance. Instead of copying a directory from one location to another, it uses the `rename()` PHP function to speed up the process, which is instrumental in creating a temporary backup without a delay. If the renaming failed, it falls back to `copy_dir()` WP function.

This conditional aims to facilitate broader testing of the feature. It is temporary, until the plugin is merged into core.

Props afragen, pbiron, costdev, davidbaumwald, audrasjb, jrf, SergeyBiryukov.
Fixes #56057. See #51857, #54166.
Built from https://develop.svn.wordpress.org/trunk@53578


git-svn-id: http://core.svn.wordpress.org/trunk@53167 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-26 12:37:18 +00:00
Sergey Biryukov
d533b76ef8 Tests: Remove multiple $wpdb::placeholder_escape() calls in wpdb tests.
This aims to improve performance of the tests by reducing the number of function calls.

Since `$wpdb::placeholder_escape()` saves the result in a static variable on the first run, there is no need for repeated function calls during the same request or test run, as the result would still be the same.

Follow-up to [42056].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53577


git-svn-id: http://core.svn.wordpress.org/trunk@53166 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-25 14:45:12 +00:00
davidbaumwald
c2fbb4950d Comments: Add contextual autocomplete attributes to comment form fields.
For accessibility, input fields should identify their "purpose".  The HTML5 attribute `autocomplete` allows for various user data to be quickly autofilled while adding context for some assistive technologies.

This commit adds the appropriate autofill purposes for an author's name, email, and website URL in the comment form template.

Props juliemoynat, bhrugesh96, sabernhardt.
Fixes #55779.
Built from https://develop.svn.wordpress.org/trunk@53576


git-svn-id: http://core.svn.wordpress.org/trunk@53165 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-24 21:26:12 +00:00
davidbaumwald
e7a9fe918c Database: Add %i placeholder support to $wpdb->prepare to escape table and column names.
WordPress does not currently provide an explicit method for escaping SQL table and column names. This leads to potential security vulnerabilities, and makes reviewing code for security unnecessarily difficult.  Also, static analysis tools also flag the queries as having unescaped SQL input.

Tables and column names in queries are usually in-the-raw, since using the existing `%s` will straight quote the value, making the query invalid.

This change introduces a new `%i` placeholder in `$wpdb->prepare` to properly quote table and column names using backticks.

Props tellyworth, iandunn, craigfrancis, peterwilsoncc, johnbillion, apokalyptik.
Fixes #52506.
Built from https://develop.svn.wordpress.org/trunk@53575


git-svn-id: http://core.svn.wordpress.org/trunk@53164 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-24 20:35:14 +00:00
Sergey Biryukov
178bd65605 Tests: Replace esc_url_raw() calls with sanitize_url().
Previously committed in [53455], appears to be accidentally reverted in [53562].

Follow-up to [51597], [53452], [53455], [53562].

See #39265, #55652.
Built from https://develop.svn.wordpress.org/trunk@53574


git-svn-id: http://core.svn.wordpress.org/trunk@53163 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-24 15:09:11 +00:00
Sergey Biryukov
dc8416e7c2 Tests: Use more consistent wording when referring to PHP deprecation notices.
Previously committed in [53492], appears to be accidentally reverted in [53564].

Follow-up to [51619], [51695], [53492], [53563].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53573


git-svn-id: http://core.svn.wordpress.org/trunk@53162 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-24 15:04:10 +00:00
Sergey Biryukov
d0588e2f1b Tests: Give the tests for adding empty post meta values more consistent names.
One of these was previously renamed to mention `update_metadata_by_mid()`.

While `update_metadata_by_mid()` is indeed called in `wp_ajax_add_meta()` to update an existing meta value, the functionality change that the test intended to verify was in the latter function.

Follow-up to [44153], [53561].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53572


git-svn-id: http://core.svn.wordpress.org/trunk@53161 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-24 14:43:11 +00:00
Sergey Biryukov
816325b9b8 Tests: Put @covers tags before @params in Ajax and Formatting groups.
This makes the placement more consistent with the rest of the test suite.

Follow-up to [53561], [53562].

See #39265.
Built from https://develop.svn.wordpress.org/trunk@53571


git-svn-id: http://core.svn.wordpress.org/trunk@53160 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-24 14:20:13 +00:00
Sergey Biryukov
7abd4bc951 Media: Use correct escaping function for URLs in some legacy media functions.
This affects:
* `get_image_send_to_editor()`
* `image_link_input_fields()`

Follow-up to [7092], [7874], [8653], [11109], [11204], [11383], [12051], [12199], [19982].

Props smit08, mukesh27.
Fixes #56064.
Built from https://develop.svn.wordpress.org/trunk@53570


git-svn-id: http://core.svn.wordpress.org/trunk@53159 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-24 13:52:13 +00:00
Sergey Biryukov
bb92e303d7 Editor: Add utility classnames back to blocks that have layout attributes specified.
[https://github.com/WordPress/gutenberg/issues/38719 In 5.9 these utility classnames were removed], which removed the ability for theme/plugin authors to assign their own custom CSS related to specific layout selections. This was mostly related to the Button block.

This commit adds these classes dynamically based on attributes, rather than saving them to the serialized content.

Original PR from Gutenberg repository:
* [https://github.com/WordPress/gutenberg/pull/41487 #41487 Add utility classnames back to blocks that have layout attributes specified]

Props glendaviesnz, peterwilsoncc, andrewserong, zieladam, matveb, samikeijonen.
See #56058.
Built from https://develop.svn.wordpress.org/trunk@53568


git-svn-id: http://core.svn.wordpress.org/trunk@53157 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-23 23:09:09 +00:00
audrasjb
9a2ae08812 Application Passwords: Ensure long passwords don't break the "new password" notice.
This changeset adds a `word-wrap: break-word` CSS declaration to avoid text overflow in the "new application password" notice.

Props Presskopp, hasanuzzamanshamim, yannielsen, audrasjb.
Fixes #54581.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53156 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-23 23:04:09 +00:00
audrasjb
a33fd9fc55 Docs: Use third-person singular verbs for function descriptions in Bookmark related files, as per docblock standards.
This changeset updates `bookmark.php` and `bookmark-template.php` files.

See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53155 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-23 22:57:12 +00:00
Sergey Biryukov
a5ab6b8d8b Tests: Correct the expected result for wp_ajax_replyto_comment() test with a draft post.
The "Error:" prefix was previously removed and accidentally re-added with `@covers` tags.

Follow-up to [53337], [53561].

See #39265.
Built from https://develop.svn.wordpress.org/trunk@53565


git-svn-id: http://core.svn.wordpress.org/trunk@53154 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-23 21:38:12 +00:00
Andrew Ozz
4c9bf00e9c Build/Test Tools: Add missing @covers tags and fix the docs for the Cron test group.
Props pbeane, hellofromTonya, antonvlasenko, ironprogrammer, SergeyBiryukov, costdev.
See #39265.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53153 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-23 20:43:13 +00:00
Andrew Ozz
54ba73b9ca Build/Test Tools: Fix erroneous file name, from convertInvalidEntries.php to convertInvalidEntities.php.
Props pbeane, hellofromTonya, antonvlasenko, ironprogrammer, SergeyBiryukov, costdev.
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53563


git-svn-id: http://core.svn.wordpress.org/trunk@53152 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-23 20:36:13 +00:00
Andrew Ozz
d7b34a5287 Build/Test Tools, Formatting group:
- Add and update @covers tags.
- Add and improve docs and inline comments.

Props pbeane, hellofromTonya, antonvlasenko, ironprogrammer, SergeyBiryukov, costdev.
See #39265.
Built from https://develop.svn.wordpress.org/trunk@53562


git-svn-id: http://core.svn.wordpress.org/trunk@53151 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-23 20:29:09 +00:00
Andrew Ozz
c5a5234941 Build/Test Tools: Add missing @covers tags for the AJAX test group.
Props pbeane, hellofromTonya, antonvlasenko, ironprogrammer, SergeyBiryukov, costdev.
See #39265.
Built from https://develop.svn.wordpress.org/trunk@53561


git-svn-id: http://core.svn.wordpress.org/trunk@53150 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-23 19:47:10 +00:00
John Blackbourn
5dd1936fdb Themes: Add actions to template loading to assist with collecting debug info.
This introduces the following new actions which wrap the process of loading a template file:

* `wp_before_load_template`
* `wp_after_load_template`

Props rmccue, tabrisrp, peterwilsoncc

Fixes #54541

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


git-svn-id: http://core.svn.wordpress.org/trunk@53149 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-23 18:59:09 +00:00
Aaron Jorbin
a457e3498e Editor: Universalize functions for checking block editor status.
`use_block_editor_for_post_type` and `use_block_editor_for_post` can be very useful in more contexts than wp-admin, especially when a site is in transition. For example, you may want to do things on init that are different.

Neither function depends on other functions that are available only in wp-admin (other than use_block_editor_for_post() relying on use_block_editor_for_post_type() and an admin-referrer check that's historically gated by a query variable and now also gated by is_admin), therefore  moving them to wp-includes seems both feasible and beneficial

Props ethitter, jorbin.
Fixes #51819.


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


git-svn-id: http://core.svn.wordpress.org/trunk@53148 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-23 18:48:13 +00:00
Sergey Biryukov
fe941574c3 Code Modernization: Remove dynamic properties in Tests_Media.
Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0.

In this particular case, the test class contains a `set_up()` method that sets a group of properties, which are ''used'' by the tests, but never ''changed'' by the tests.

In other words, setting these properties in the `set_up()` is an unnecessary overhead and the properties should be changed to class constants.

Notes:
* As the `$img_html` property, which was previously being set, is not actually used in any of the tests, that property has not been converted to a constant.
* The values which were previously being set using a heredoc, now use a nowdoc (supported since PHP 5.3), as they don't contain any interpolation.
* The use of constant scalar expressions (`IMG_URL`) and constant arrays (`IMG_META`) in class constants is supported since PHP 5.6.

Follow-up to [711/tests], [1260/tests], [34855], [41724], [53557].

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


git-svn-id: http://core.svn.wordpress.org/trunk@53147 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-23 15:03:15 +00:00
Sergey Biryukov
86865fcbdd Code Modernization: Remove dynamic properties in Tests_*_Slashes.
Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0.

In this particular case, the test classes contain a `set_up()` method that sets a group of properties, which are ''used'' by the tests, but the values of these properties are never ''changed'' by the tests.

In other words, setting these properties in the `set_up()` is an unnecessary overhead and the properties should be changed to class constants.

Follow-up to [1041/tests], [1071/tests].

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


git-svn-id: http://core.svn.wordpress.org/trunk@53146 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-23 14:26:13 +00:00
Sergey Biryukov
fb93f0ecc1 Tests: Improve the test for sticky posts not being moved to the front in sitemaps.
* Give the test method a most descriptive name.
* Use a single assertion for the URL list instead of a `foreach` loop to provide more context in case of failure.
* Add a failure message to each assertion, as there are multiple assertions used in the test.

Follow-up to [53548].

See #55633.
Built from https://develop.svn.wordpress.org/trunk@53556


git-svn-id: http://core.svn.wordpress.org/trunk@53145 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-22 16:52:11 +00:00
Sergey Biryukov
5d2e8afebd Code Modernization: Use the integer portion of an item position in add_submenu_page().
This fixes an `Implicit conversion from float to int loses precision` PHP 8.1 deprecation notice when adding a new admin menu item with a `float` value passed as the `$position` parameter.

This change is covered by existing unit tests and addresses 8 errors when running the test suite on PHP 8.1.

References:
* [https://php.watch/versions/8.1/deprecate-implicit-conversion-incompatible-float-string PHP 8.1: Implicit incompatible float to int conversion is deprecated]
* [https://wiki.php.net/rfc/implicit-float-int-deprecate PHP RFC: Deprecate implicit non-integer-compatible float to int conversions]

Follow-up to [52569], [53104].

Props jrf.
See #55656, #54798.
Built from https://develop.svn.wordpress.org/trunk@53555


git-svn-id: http://core.svn.wordpress.org/trunk@53144 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-22 14:55:11 +00:00
desrosj
9e3dc52d45 Build/Test Tools: Return an error when uploading a test coverage report fails.
`true` is now passed to the `fail_ci_if_error` input when the `codecov/codecov-action` action is used.

When uploading a code coverage report is unsuccessful, the action will now fail and return an error. This will help avoid situations like #56022 where the report was suddenly failing to upload even though the workflow itself appeared to be successful.

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53554


git-svn-id: http://core.svn.wordpress.org/trunk@53143 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-22 00:20:11 +00:00
desrosj
5aae4a4c10 Build/Test Tools: Allow changes to the code coverage workflow to run on pull request.
This adds the `pull_request` event to the Code Coverage Report workflow, allowing changes to be verified in a pull request before being committed.

The `branches` and `paths` filters are used to limit when the workflow runs to pull requests with:

- A base branch of `trunk`.
- Changing specific files that can potentially affect the way a coverage report is generated.

Reports generated on `pull_request` events are for testing purposes only and are not submitted to Codecov.

The `docker-compose.yml` file has also been added to the `paths` filter for both `push` and `pull_request` events. Changes to this file could potentially affect the environment used to generate the report (such as the ones in [53552]).

Props afragen, johnbillion, desrosj.
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53553


git-svn-id: http://core.svn.wordpress.org/trunk@53142 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-22 00:01:13 +00:00
desrosj
df27445253 Build/Test Tools: Configure Xdebug modes in the local Docker environment.
One change in the update from Xdebug version 2.x to 3.x was a shift from enabling features to switching into modes.

When the version of Xdebug installed in the PHP 7.4 Docker container was updated from 2.x to 3.x, the code coverage reporting workflow stopped generating reports due to a lack of available coverage drivers.

This change adds the `XDEBUG_MODE` environment variable to the local Docker environment configuration to allow the active modes to be changed. This environment variable takes precedence over the `xdebug.mode` setting, but will not change the value of the `xdebug.mode` setting.

The `LOCAL_PHP_XDEBUG_MODE` environment variable has been added to the `.env` file and can be used to change the modes enabled in the Docker container. The code coverage reporting workflow uses this variable to enable the `coverage` mode, which is required for generating a test coverage report.

By default, `debug` and `debug modes are active, which enables the more commonly used features of Xdebug: development helpers and step debugging.

Props afragen, johnbillion, desrosj.
Fixes #56022.
Built from https://develop.svn.wordpress.org/trunk@53552


git-svn-id: http://core.svn.wordpress.org/trunk@53141 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-21 23:47:13 +00:00
audrasjb
29cfbec0ba Docs: Add missing @since mention in get_posts_query_args().
Follow-up to [53548].
See #55633.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53140 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-21 13:48:12 +00:00
audrasjb
d3cf4fb243 Docs: Use third-person singular verbs for function descriptions in Tests_Sitemaps_wpSitemapsPosts, as per docblock standards.
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53139 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-21 13:45:09 +00:00
spacedmonkey
ac6ce3e026 Posts, Post Types: Add caching to _find_post_by_old_slug and _find_post_by_old_date functions.
Cache result of database queries in `_find_post_by_old_slug` and `_find_post_by_old_date` functions. This means that repeated requests to a url where the page is not found, will result in hitting a cache for sites running persistent object caching. 

Props Spacedmonkey, dd32, mukesh27, pbearne, flixos90.
Fixes #36723.
Built from https://develop.svn.wordpress.org/trunk@53549


git-svn-id: http://core.svn.wordpress.org/trunk@53138 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-21 13:34:13 +00:00
audrasjb
ea5c6469c9 Sitemaps: Remove duplicate sticky Posts from Sitemap Post Query.
This changeset sets the `ignore_sticky_posts` parameter to `true` in the default arguments passed to `wp_sitemaps_posts_query_args`.

Props RavanH, pbiron, swissspidy, audrasjb, SergeyBiryukov.
Fixes #55633.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53137 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-21 13:18:10 +00:00
Sergey Biryukov
b8290da037 Docs: Improve documentation for WP_Image_Editor::save() and related functions.
Includes:
* Documenting the returned array using hash notation.
* Adding a `@since` note for the `$filesize` value being included in the returned array.

This affects:
 * `wp_generate_attachment_metadata()`
 * `wp_get_attachment_metadata()`
 * `WP_Image_Editor::save()`
 * `WP_Image_Editor_GD::save()` and `::_save()`
 * `WP_Image_Editor_Imagick::save()` and `::_save()`

Follow-up to [22094], [22619], [52837], [53546].

See #55646.
Built from https://develop.svn.wordpress.org/trunk@53547


git-svn-id: http://core.svn.wordpress.org/trunk@53136 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-21 11:18:17 +00:00
Sergey Biryukov
b352d32d8a Docs: Correct the return type for wp_save_image_file().
Since WordPress 3.5, `wp_save_image_file()` uses `WP_Image_Editor` classes under the hood to save the images.

While the `save()` method in those instances returns `array|WP_Error` and is documented as such, the return type of the `wp_save_image_file()` function was still left as `bool`.

A better solution would be to adjust the function to return the documented boolean type. However, doing that after 20+ major WP releases would be a backward compatibility break, so the documentation is now updated instead.

Includes:
* Documenting the returned array using hash notation.
* Adding a `@since` note for the `$image` parameter expecting a `WP_Image_Editor` instance.
* Adding a `@since` note for the `$filesize` value being included in the returned array.

Follow-up to [22094], [22619], [52837].

Props jrf, SergeyBiryukov.
See #55646.
Built from https://develop.svn.wordpress.org/trunk@53546


git-svn-id: http://core.svn.wordpress.org/trunk@53135 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-21 11:16:17 +00:00
Sergey Biryukov
f8e00d59ae Tests: Move assertQueryTrue() closer to the other custom assertions in WP_UnitTestCase_Base.
Follow-up to [109/tests], [26005].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53545


git-svn-id: http://core.svn.wordpress.org/trunk@53134 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-21 11:14:22 +00:00
spacedmonkey
65b78390ee REST API: Move all links to prepare_links method in theme REST API controller.
Move logic to generate link to global styles to the `prepare_links` method in theme REST API controller. This way all logic to generate links is within the `prepare_links` method, bringing this controller inline with other REST API controllers.

Props SergeyBiryukov, Spacedmonkey.
Fixes #56018.
Built from https://develop.svn.wordpress.org/trunk@53544


git-svn-id: http://core.svn.wordpress.org/trunk@53133 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-21 10:48:21 +00:00
John Blackbourn
721877d3d2 I18N: Correct and improve inline docs and tests for functionality related to nooped plurals.
See #55646, #55652

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


git-svn-id: http://core.svn.wordpress.org/trunk@53132 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-20 22:57:16 +00:00
Sergey Biryukov
a07f85a464 Docs: Use third-person singular verbs for function descriptions in Tests_Image_Functions, per the documentation standards.
See #55646.
Built from https://develop.svn.wordpress.org/trunk@53542


git-svn-id: http://core.svn.wordpress.org/trunk@53131 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-20 22:26:16 +00:00
Sergey Biryukov
db04949ca0 Tests: Further improve Tests_Image_Functions::test_wp_crop_image*() tests.
Includes:
* Making the test method names more specific.
* Converting one-off helper methods to static closures.
* Adding a failure message to each assertion when multiple assertions are used in the test.

Follow-up to [1126/tests], [1201/tests], [53292], [53495], [53522], [53538].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53541


git-svn-id: http://core.svn.wordpress.org/trunk@53130 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-20 22:06:18 +00:00
audrasjb
78bc43e7f8 Embeds: Remove Meetup as an oEmbed source since the related endpoint has been deprecated.
This changeset removes Meetup as an oEmbed source, since Meetup.com have deprecated their oEmbed endpoint. The block has already been removed from the editor, see GB#35085.

Props peterwilsoncc, audrasjb, swissspidy.
Fixes #55997.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53129 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-20 21:48:15 +00:00
audrasjb
fa3ed002e1 Docs: Use third-person singular verbs for function descriptions in the Feed API, as per docblock standards.
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53128 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-20 21:46:16 +00:00
Sergey Biryukov
30836ec0bd Tests: Improve Tests_Image_Functions::test_wp_crop_image*() tests.
Includes:
* Adding `@covers` annotations.
* Adding a failure message to each assertion when multiple assertions are used in the test.

Follow-up to [1126/tests], [53495], [53497], [53521], [53523], [53524], [53525], [53526], [53529], [53530], [53531], [53537].

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


git-svn-id: http://core.svn.wordpress.org/trunk@53127 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-20 21:37:15 +00:00
Sergey Biryukov
26561d6b94 Tests: Refactor Tests_Image_Functions::test_load_directory() to split the tests and use a data provider.
This one test was testing three different situations. When one assertion fails, the rest of the test would not be executed, so this leads to hiding one error behind another.

Splitting the test into three distinct test methods still allows for testing each situation, but tests each one in isolation and won't hide errors.

The third part of the test, dealing with image editor engine classes, will also now use a data provider.

Using a data provider has a number of advantages:
1. If the first test case fails, it won't prevent the other test cases from being tested.
2. The output from PHPUnit will be more descriptive in case of failure when using a data provider.
3. Using named test cases in the data provider will also make the `--testdox` output much more descriptive and informative.

The actual cases being tested, or the test itself have not been changed.

Includes:
* Adding `@covers` annotations.
* Adding a failure message to each assertion when multiple assertions are used in the test.
* Reusing an existing data provider with the available image editor engine classes.

Follow-up to [1061/tests], [53495], [53497], [53521], [53523], [53524], [53525], [53526], [53529], [53530], [53531].

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


git-svn-id: http://core.svn.wordpress.org/trunk@53126 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-20 19:36:20 +00:00
Sergey Biryukov
306f53a798 Tests: Always include the error message in assertNotWPError() and assertNotIXRError().
Previously, in case of failure, `WP_UnitTestCase_Base::assertNotWPError()` displayed the actual error message from the passed `WP_Error` object, but only if the `$message` parameter was empty.

This made the assertion less helpful, as the actual error message was lost in case there was a non-empty `$message` parameter passed to the method, as per the [https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#using-assertions Writing PHP Tests] guidelines:
> All PHPUnit assertions, as well as all WordPress custom assertions, allow for a `$message` parameter to be passed. This message will be displayed when the assertion fails and can help immensely when debugging a test. This parameter should always be used if more than one assertion is used in a test method.

This commit ensures that the actual error message is always displayed, in addition to the passed `$message` parameter.

The same applies to `WP_UnitTestCase_Base::assertNotIXRError()`.

Follow-up to [34638], [40417].

Props jrf, SergeyBiryukov.
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53536


git-svn-id: http://core.svn.wordpress.org/trunk@53125 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-20 17:29:17 +00:00
Sergey Biryukov
75f689766f External Libraries: Upgrade PHPMailer to version 6.6.3.
This is a maintenance release with minor CS improvements.

Release notes:
https://github.com/PHPMailer/PHPMailer/releases/tag/v6.6.3

For a full list of changes in this update, see the PHPMailer GitHub:
https://github.com/PHPMailer/PHPMailer/compare/v6.6.2...v6.6.3

Follow-up to [50628], [50799], [51169], [51634], [51635], [52252], [52749], [52811], [53500].

Props jrf, Synchro.
Fixes #56016.
Built from https://develop.svn.wordpress.org/trunk@53535


git-svn-id: http://core.svn.wordpress.org/trunk@53124 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-20 15:04:11 +00:00
desrosj
cb93e6ba63 Build/Test Tools: Adjust Slack notifications logic to account for expected non push events.
This adjusts the logic used to determine the outcome of the previous workflow run of the current one to account for `schedule` and `workflow_dispatch` events.

In the current state, only workflows triggered by `push` events are examined. This is causing failures when trying to post Slack notifications for the Test Coverage workflow, and inconsistent results for `workflow_dispatch` events when testing older branches on a schedule.

Follow up to [53466] and [53468].
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53534


git-svn-id: http://core.svn.wordpress.org/trunk@53123 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-20 15:00:15 +00:00
Sergey Biryukov
5b4e5235ed Tests: Use consistent punctuation in failure messages in Tests_Image_Functions.
Follow-up to [53523], [53524], [53525], [53526], [53529], [53530], [53531].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53533


git-svn-id: http://core.svn.wordpress.org/trunk@53122 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-20 12:50:14 +00:00
Sergey Biryukov
162bffa8b5 Tests: Consistently check that an image was loaded in image saving tests.
Don't unnecessarily load the image twice in `test_inferred_mime_types_when_saving_an_image()`.

Follow-up to [1061/tests], [1151/tests], [1157/tests], [29834].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53532


git-svn-id: http://core.svn.wordpress.org/trunk@53121 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-19 17:28:11 +00:00
Sergey Biryukov
5f344cee00 Tests: Refactor Tests_Image_Functions::test_inferred_mime_types() to use a data provider.
Using a data provider has a number of advantages:
1. If the first test case fails, it won't prevent the other test cases from being tested.
2. The output from PHPUnit will be more descriptive in case of failure when using a data provider.
3. Using named test cases in the data provider will also make the `--testdox` output much more descriptive and informative.

The actual cases being tested, or the test itself have not been changed.

Includes:
* Adding a `@covers` annotation.
* Adding a failure message to each assertion.
* Adding a skip annotation for unsupported mime types.
* Making the test method name more specific.

Follow-up to [1061/tests], [53495], [53497], [53521], [53523], [53524], [53525], [53526], [53529], [53530].

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


git-svn-id: http://core.svn.wordpress.org/trunk@53120 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-19 17:12:07 +00:00
Sergey Biryukov
13b24017be Tests: Refactor Tests_Image_Functions::test_mime_overrides_filename() to use a data provider.
Using a data provider has a number of advantages:
1. If the first test case fails, it won't prevent the other test cases from being tested.
2. The output from PHPUnit will be more descriptive in case of failure when using a data provider.
3. Using named test cases in the data provider will also make the `--testdox` output much more descriptive and informative.

The actual cases being tested, or the test itself have not been changed.

Includes:
* Adding a `@covers` annotation.
* Adding a failure message to each assertion.
* Making the test method name more specific.

Follow-up to [1061/tests], [53495], [53497], [53521], [53523], [53524], [53525], [53526], [53529].

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


git-svn-id: http://core.svn.wordpress.org/trunk@53119 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-19 16:53:08 +00:00
Sergey Biryukov
de017e6a7e Tests: Refactor Tests_Image_Functions::test_wp_save_image_file() to use a data provider.
Using a data provider has a number of advantages:
1. If the first test case fails, it won't prevent the other test cases from being tested.
2. The output from PHPUnit will be more descriptive in case of failure when using a data provider.
3. Using named test cases in the data provider will also make the `--testdox` output much more descriptive and informative.

The actual cases being tested, or the test itself have not been changed.

Includes:
* Adding a `@covers` annotation.
* Adding a skip annotation for unsupported mime types.
* Adding a failure message to each assertion.

Follow-up to [1061/tests], [53495], [53497], [53521], [53523], [53524], [53525], [53526].

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


git-svn-id: http://core.svn.wordpress.org/trunk@53118 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-19 16:41:12 +00:00
Sergey Biryukov
3abb5d4a83 Tests: Reorder is_gd_image() test methods for consistency.
This moves the test for valid types first, to match `file_is_valid_image()` and `file_is_displayable_image()` tests.

Follow-up to [48798], [53527].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53528


git-svn-id: http://core.svn.wordpress.org/trunk@53117 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-19 16:05:09 +00:00
Sergey Biryukov
b01fc042dc Tests: Rename some test methods in Tests_Image_Functions for consistency.
This matches the names of the functions being tested:
* `file_is_valid_image()`
* `file_is_displayable_image()`

Follow-up to [184/tests], [53523], [53524], [53525], [53526].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53527


git-svn-id: http://core.svn.wordpress.org/trunk@53116 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-19 15:45:13 +00:00
Sergey Biryukov
d53738ce7c Tests: Refactor Tests_Image_Functions::test_is_displayable_image_negative() to use a data provider.
Using a data provider has a number of advantages:
1. If the first test case fails, it won't prevent the other test cases from being tested.
2. While the assertion used in this test method ''does'' have a "failure message" (👍), the output from PHPUnit itself will already be more descriptive in case of failure when using a data provider.
3. Using named test cases in the data provider will also make the `--testdox` output much more descriptive and informative.

The actual cases being tested, or the test itself have not been changed.

Includes:
* Adding a `@covers` annotation.

Follow-up to [184/tests], [53495], [53497], [53521], [53523], [53524], [53525].

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


git-svn-id: http://core.svn.wordpress.org/trunk@53115 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-19 15:36:11 +00:00
Sergey Biryukov
40abfe84c7 Tests: Refactor Tests_Image_Functions::test_is_displayable_image_positive() to use a data provider.
Using a data provider has a number of advantages:
1. If the first test case fails, it won't prevent the other test cases from being tested.
2. While the assertion used in this test method ''does'' have a "failure message" (👍), the output from PHPUnit itself will already be more descriptive in case of failure when using a data provider.
3. Using named test cases in the data provider will also make the `--testdox` output much more descriptive and informative.

The actual cases being tested, or the test itself have not been changed.

Includes:
* Changing the conditional addition of the `.ico` file type to be unconditional, it was only needed for PHP < 5.3.
* Adding a `@covers` annotation.

Follow-up to [184/tests], [42780], [53495], [53497], [53521], [53523], [53524].

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


git-svn-id: http://core.svn.wordpress.org/trunk@53114 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-19 15:30:08 +00:00
Sergey Biryukov
3d4dce5320 Tests: Refactor Tests_Image_Functions::test_is_image_negative() to use a data provider.
Using a data provider has a number of advantages:
1. If the first test case fails, it won't prevent the other test cases from being tested.
2. While the assertion used in this test method ''does'' have a "failure message" (👍), the output from PHPUnit itself will already be more descriptive in case of failure when using a data provider.
3. Using named test cases in the data provider will also make the `--testdox` output much more descriptive and informative.

The actual cases being tested, or the test itself have not been changed.

Includes:
* Adding a `@covers` annotation.

Follow-up to [184/tests], [53495], [53497], [53521], [53523].

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


git-svn-id: http://core.svn.wordpress.org/trunk@53113 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-19 15:21:08 +00:00
Sergey Biryukov
35bb74740a Tests: Refactor Tests_Image_Functions::test_is_image_positive() to use a data provider.
Using a data provider has a number of advantages:
1. If the first test case fails, it won't prevent the other test cases from being tested.
2. While the assertion used in this test method ''does'' have a "failure message" (👍), the output from PHPUnit itself will already be more descriptive in case of failure when using a data provider.
3. Using named test cases in the data provider will also make the `--testdox` output much more descriptive and informative.

The actual cases being tested, or the test itself have not been changed.

Includes:
* Changing the conditional addition of the `.ico` file type to be unconditional, it was only needed for PHP < 5.3.
* Adding a `@covers` annotation.

Follow-up to [184/tests], [42780], [53495], [53497], [53521].

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


git-svn-id: http://core.svn.wordpress.org/trunk@53112 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-19 15:15:08 +00:00
Sergey Biryukov
3183f77ce7 Tests: Move the filter_image_editor_output_format() helper method next to the test it's used in.
Follow-up to [53292], [53495].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53522


git-svn-id: http://core.svn.wordpress.org/trunk@53111 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-19 12:49:12 +00:00
Sergey Biryukov
6e12ff3b89 Tests: Add a helper method for for creating named data providers in WP_UnitTestCase_Base.
This introduces a new test helper function which allows for turning a single-level array containing text strings into a data provider with named data sets, where the value of the data set will also be used as the name of the data set.

The function contains safeguards to ensure that it is only used with data compatible with this principle and will throw generic PHP exceptions when the data is incompatible. These type of exceptions will be displayed before the tests even start running and will stop the test run when they occur.

While generally speaking, all test cases ''should'' extend the base `WP_UnitTestCase_Base` class, this is still made a `public static` method to allow for a test, which by exception directly extends the PHPUnit base `TestCase` or the `PHPUnit_Adapter_TestCase`, to also be able to use this method.

Typical usage of this method:
{{{
public function data_provider_for_test_name() {
	$array = array(
		'value1',
		'value2',
	);

	return $this->text_array_to_dataprovider( $array );
}
}}}
The returned result will look like:
{{{
array(
	'value1' => array( 'value1' ),
	'value2' => array( 'value2' ),
)
}}}

Props jrf, hellofromTonya, adamsilverstein.
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53521


git-svn-id: http://core.svn.wordpress.org/trunk@53110 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-18 21:30:13 +00:00
Sergey Biryukov
481da1b9f4 Docs: Consistently declare the $wp_query global in link template functions.
This ensures that the global is explicitly declared and documented in:
* `get_next_posts_link()`
* `get_posts_nav_link()`
* `get_the_posts_navigation()`
* `get_the_posts_pagination()`
* `get_next_comments_link()`

Follow-up to [30065].

Props mt8.biz, sabernhardt.
Fixes #43164.
Built from https://develop.svn.wordpress.org/trunk@53520


git-svn-id: http://core.svn.wordpress.org/trunk@53109 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-18 15:38:15 +00:00
Sergey Biryukov
c70a5c547f Coding Standards: Fix WPCS issue in [53518].
This fixes an "Concat operator must be surrounded by a single space" error.

See #54233.
Built from https://develop.svn.wordpress.org/trunk@53519


git-svn-id: http://core.svn.wordpress.org/trunk@53108 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-17 11:33:08 +00:00
Sergey Biryukov
a0215f6e9d General: Use WPINC as a shorter reference to wp-includes in some files.
This brings more consistency with similar `require_once` statements and `_deprecated_file()` calls in other files.

Follow-up to [601], [628], [36693], [44359], [45663], [45678], [52026], 

Props malthert.
See #54233.
Built from https://develop.svn.wordpress.org/trunk@53518


git-svn-id: http://core.svn.wordpress.org/trunk@53107 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-17 11:20:13 +00:00
audrasjb
4947604b66 Twenty Twenty-One: Ensure custom text color is reflected in the Editor for Quote block.
This changes removes an hardcoded CSS color value for the Quote block in Twenty Twenty-One's editor stylesheet. This ensures custom text color is fully reflected in the Editor for Quote block.

Props jyolsna, evildon, kajalgohel, audrasjb.
Fixes #55989.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53106 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-16 23:43:09 +00:00
audrasjb
bac638e610 Docs: Use third-person singular verbs for function descriptions in the Taxonomy Administration API.
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53105 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-16 23:39:08 +00:00
audrasjb
cfd6d327ad Twenty Nineteen: Ensure custom text color is reflected in the Editor for Quote block.
This changes removes an hardcoded CSS color value for the Quote block in Twenty Nineteen's editor stylesheet. This ensures custom text color is fully reflected in the Editor for Quote block.

Props nithi22, evildon, SergeyBiryukov, audrasjb.
Fixes #55992.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53104 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-16 23:17:08 +00:00
audrasjb
8ea403e9bb Docs: Use third-person singular verbs for function descriptions in the WP_Screen API.
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53103 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-16 23:10:10 +00:00
Sergey Biryukov
2a1e9e1dd8 Docs: Add @since notes for html5 theme feature changes in add_theme_support():
* As of WordPress 3.6.1, the `html5` feature requires an array of types to be passed. Defaults to `comment-list`, `comment-form`, `search-form` for backward compatibility.
* As of WordPress 6.0, the previously added `_doing_it_wrong()` notice is actually displayed as expected.

Follow-up to [25193], [25235], [25785], [49344], [49354], [52828].

Props bobbingwide.
See #51657, #55646.
Built from https://develop.svn.wordpress.org/trunk@53513


git-svn-id: http://core.svn.wordpress.org/trunk@53102 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-16 15:21:15 +00:00
spacedmonkey
e5e61f3095 Tests: Re-enable failing REST API test for update_post_parent_caches().
Ensure that that attachment objects are not primed in cache so that test passes when object caching is enabled. 

Follow-up to [53506].

Props SergeyBiryukov.
See #55593.
Built from https://develop.svn.wordpress.org/trunk@53512


git-svn-id: http://core.svn.wordpress.org/trunk@53101 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-15 19:34:12 +00:00
Sergey Biryukov
cbca7c4fb9 Tests: Temporarily disable the failing REST API test for update_post_parent_caches().
This needs more investigation to address the test failure with persistent object cache.

Follow-up to [53506].

Props hellofromTonya.
See #55593.
Built from https://develop.svn.wordpress.org/trunk@53511


git-svn-id: http://core.svn.wordpress.org/trunk@53100 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-15 15:39:08 +00:00
Sergey Biryukov
0c2ced37c3 Tests: Use assertSameSets() in some newly introduced tests.
This ensures that not only the array values being compared are equal, but also that their type is the same.

Going forward, stricter type checking by using `assertSameSets()` or `assertSameSetsWithIndex()` should generally be preferred, to make the tests more reliable.

Follow-up to [48939], [51137], [51943], [53499], [53504], [53506], [53509].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53510


git-svn-id: http://core.svn.wordpress.org/trunk@53099 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-15 14:44:11 +00:00
Sergey Biryukov
43f0f88b15 Tests: Some improvements for REST API cache priming tests:
* Give the test methods more specific names and move them closer together.
* Correct the `@covers` tags.

Follow-up to [53499], [53504], [53506], [53507], [53508].

See #55593, #55652.
Built from https://develop.svn.wordpress.org/trunk@53509


git-svn-id: http://core.svn.wordpress.org/trunk@53098 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-15 14:09:08 +00:00
Sergey Biryukov
a42b89fc71 REST API: Some documentation and test improvements for update_menu_item_cache():
* Make the function description more specific, for consistency with other similar functions.
* Add a `@since` note for the `$update_menu_item_cache` parameter of `WP_Query::parse_query()`.
* Add missing `@covers` tags for the unit tests.

Follow-up to [53504].

See #55620.
Built from https://develop.svn.wordpress.org/trunk@53508


git-svn-id: http://core.svn.wordpress.org/trunk@53097 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-15 13:37:10 +00:00
Sergey Biryukov
84a8194200 REST API: Some documentation and test improvements for update_post_parent_caches():
* Make the function description more specific, for consistency with `update_post_author_caches()`.
* Add missing `@covers` tags for the unit test.

Follow-up to [53506].

See #55593.
Built from https://develop.svn.wordpress.org/trunk@53507


git-svn-id: http://core.svn.wordpress.org/trunk@53096 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-15 13:19:10 +00:00
spacedmonkey
2c8a6170af REST API: Prime caches for post parents in post REST API controller.
Prime caches for all post parents in the post REST API controller using the `_prime_post_caches` function. Post parent objects are required as part of the `check_read_permission` method’s permission check in post REST API controller. 

Props spacedmonkey, furi3r, peterwilsoncc, mitogh, madpixels. 
Fixes #55593.
Built from https://develop.svn.wordpress.org/trunk@53506


git-svn-id: http://core.svn.wordpress.org/trunk@53095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-15 10:43:10 +00:00
Sergey Biryukov
ab5cc35046 Database: Don't translate the "WordPress database error" message in the error log.
When using multilingual websites, this string could end up with multiple different translations in the error log, making it less actionable.

Unlike errors displayed to the user, a general consensus for software is that errors in logs should always be in English. Since MySQL errors are also returned in English, this brings more consistency to the logs.

Follow-up to [6391], [8168], [19760].

Props malthert.
Fixes #53125.
Built from https://develop.svn.wordpress.org/trunk@53505


git-svn-id: http://core.svn.wordpress.org/trunk@53094 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-15 10:36:09 +00:00
spacedmonkey
991acc48d4 REST API: Prime caches for linked objects in menu item REST API controller.
Add a new parameter to `WP_Query` called `update_menu_item_cache` that when set to true, primes the caches for linked terms and posts for menu item post objects. This change moves logic 
found in `wp_get_nav_menu_items` into a new function called `update_menu_item_cache`.  Update the menu item REST API controller, to pass the `update_menu_item_cache` parameter to the 
arguments used for the  `WP_Query` run to get menu items. 

Props furi3r,  TimothyBlynJacobs, spacedmonkey, peterwilsoncc, mitogh.
Fixes #55620.

 --This line, and those below, will be ignored--

M    src/wp-includes/class-wp-query.php
M    src/wp-includes/nav-menu.php
M    src/wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php
M    tests/phpunit/tests/post/nav-menu.php

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


git-svn-id: http://core.svn.wordpress.org/trunk@53093 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-15 10:20:13 +00:00
Sergey Biryukov
73a2d87eae Docs: Add a comment for stripping the leading AND from SQL clauses in some query classes.
Follow-up to [30084], [34529], [34542], [36598], [37477], [37572], [43010].

See #55646.
Built from https://develop.svn.wordpress.org/trunk@53503


git-svn-id: http://core.svn.wordpress.org/trunk@53092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-14 16:17:08 +00:00
Sergey Biryukov
cacf46f12b Docs: Add a missing word in pre_months_dropdown_query filter description.
Follow-up to [50163].

See #55646.
Built from https://develop.svn.wordpress.org/trunk@53502


git-svn-id: http://core.svn.wordpress.org/trunk@53091 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-14 15:07:10 +00:00
Sergey Biryukov
3f74637dfe I18N: Use a translatable string for displaying a user's first name and last name.
That allows locales to switch the order of the first name and last name, should they prefer to do so.

The string was previously used in `wp_insert_user()` and is now reused in other places for consistency:

* `WP_MS_Users_List_Table::column_name()`​
* `WP_Users_List_Table::column_name()​`
* `wp_list_authors()`
* `wp_list_users()`

Note: This also removes the `wp_list_author_full_name` filter, introduced for the same purpose in `wp_list_authors()`, as redundant for now.

Follow-up to [53486].

See #17025.
Built from https://develop.svn.wordpress.org/trunk@53501


git-svn-id: http://core.svn.wordpress.org/trunk@53090 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-14 14:43:12 +00:00
desrosj
cc05e7b608 External Libraries: Upgrade PHPMailer to version 6.6.2.
Release notes: https://github.com/PHPMailer/PHPMailer/releases/tag/v6.6.2.

For a full list of changes in this update, see the PHPMailer GitHub: https://github.com/PHPMailer/PHPMailer/compare/v6.6.0...v6.6.2.

Props ayeshrajans, jrf.
Fixes #55976.
Built from https://develop.svn.wordpress.org/trunk@53500


git-svn-id: http://core.svn.wordpress.org/trunk@53089 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-14 14:38:10 +00:00
spacedmonkey
77f62c11db REST API: Prime caches for featured images in post controller.
Ensure that featured image caches are primed for post collections in the post REST API controller, by calling the `update_post_thumbnail_cache` function. 

Props Spacedmonkey, TimothyBlynJacobs, mitogh.
Fixes #55592. 


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


git-svn-id: http://core.svn.wordpress.org/trunk@53088 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-14 13:10:10 +00:00
spacedmonkey
7df9ba26b2 REST API: Avoid duplicated query in post collections.
Avoid duplicated query when retrieving empty posts collections by adding a check if the page is more than 1. 

Props furi3r, gdetassigny, TimothyBlynJacobs, spacedmonkey. 
Fixes #55677.


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


git-svn-id: http://core.svn.wordpress.org/trunk@53087 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-14 12:42:10 +00:00
Sergey Biryukov
c7ab92451a Tests: Remove redundant skip call in Tests_Image_Functions::get_image_editor_engine_classes().
The test bootstrap requires GD to be available, so this test skip condition will never be matched.

Also, test skipping from within a helper method, which may be used in a data provider, can lead to test runtime errors.

Follow-up to [49009], [49014], [49535], [49571], [51415].

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


git-svn-id: http://core.svn.wordpress.org/trunk@53086 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-14 11:46:09 +00:00
spacedmonkey
47a8b2f5de Taxonomy: Fix caching issues in WP_Term_Query class.
Introduced [52836] when passing `child_of` or `pad_counts` parameters to `get_terms` or `WP_Term_Query` class, the array of terms received by the query, was not correctly cached. This 
change simplifies the logic in `WP_Term_Query` and ensures terms are correctly cached. This change also, improves performance, by only caching an array of term ids where possible.  

Props denishua, spacedmonkey, oztaser, peterwilsoncc, SergeyBiryukov, georgestephanis, jnz31, knutsp, mukesh27, costdev.
Fixes #55837.


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


git-svn-id: http://core.svn.wordpress.org/trunk@53085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-14 11:43:13 +00:00
Sergey Biryukov
e3e0bb1183 Tests: Move helper functions in Tests_Image_Functions to more appropriate places.
* Move a non-test specific helper function used by multiple tests up to the top of the class to make it more easily discoverable.
* Move a test-specific helper function used by only one test to be directly below the test using the helper function and make the link with the test explicit by adding a `@see` tag.

Follow-up to [1201/tests], [51415].

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


git-svn-id: http://core.svn.wordpress.org/trunk@53084 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-13 16:44:10 +00:00
Sergey Biryukov
30a9e469b8 Tests: Rename classes in phpunit/tests/option/ per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969], [51491], [51492], [51493], [51623], [51639], [51646], [51650], [51651], [51860], [52264], [52265], [53489].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53494


git-svn-id: http://core.svn.wordpress.org/trunk@53083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-13 15:26:10 +00:00
Sergey Biryukov
ca2e67d1b0 Tests: Add a unit test for PHP 8.1 deprecation notice in wp_user_settings().
This ensures that PHP 8.1 "passing null to non-nullable" deprecation notice is not thrown for the `$domain` parameter of `setcookie()` calls in the function.

Follow-up to [53490].

See #54914.
Built from https://develop.svn.wordpress.org/trunk@53493


git-svn-id: http://core.svn.wordpress.org/trunk@53082 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-13 15:22:10 +00:00
Sergey Biryukov
e3e07d2751 Tests: Use more consistent wording when referring to PHP deprecation notices.
Follow-up to [51619], [51695].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53492


git-svn-id: http://core.svn.wordpress.org/trunk@53081 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-13 14:53:11 +00:00
Sergey Biryukov
c12b446f41 Tests: Use a consistent URL in HTTP response cookie tests.
Follow-up to [34369], [35734], [38164].

See #51568.
Built from https://develop.svn.wordpress.org/trunk@53491


git-svn-id: http://core.svn.wordpress.org/trunk@53080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-12 15:18:10 +00:00
Sergey Biryukov
6151fddb6c Code Modernization: Pass correct default value to setcookie() in wp_user_settings().
The `wp_user_settings()` function calls the PHP native `setcookie()` function, the fifth parameter of which is the ''optional'' `$domain` parameter which expects a `string`.

A parameter being optional, however, does not automatically make it nullable.

As of PHP 8.1, passing `null` to a non-nullable PHP native function will generate a deprecation notice.

In this case, this function call yielded a `setcookie(): Passing null to parameter #5 ($domain) of type string is deprecated` notice.

Changing the `null` to an empty string fixes this without a backward compatibility break.

References:
* [https://www.php.net/manual/en/function.setcookie.php PHP Manual: setcookie()]
* [https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg PHP RFC: Deprecate passing null to non-nullable arguments of internal functions]

Follow-up to [29478].

Props ocean90, shenyanzhi, meysamnorouzi, jrf.
Fixes #54914.
Built from https://develop.svn.wordpress.org/trunk@53490


git-svn-id: http://core.svn.wordpress.org/trunk@53079 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-12 11:11:11 +00:00
Sergey Biryukov
97eff9b7b2 Tests: Rename classes in phpunit/tests/user/ per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969], [51491], [51492], [51493], [51623], [51639], [51646], [51650], [51651], [51860], [52264], [52265].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53489


git-svn-id: http://core.svn.wordpress.org/trunk@53078 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-11 15:50:08 +00:00
Sergey Biryukov
df324b9ff6 Tests: Re-initialize WP_Rewrite before running wp_list_authors() tests.
This ensures that the expected results use the default permalink structure, not affected by other tests.

Follow-up to [27550], [27684], [53487].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53488


git-svn-id: http://core.svn.wordpress.org/trunk@53077 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-11 15:36:13 +00:00
Sergey Biryukov
193a959806 Tests: Rename the test file and class for wp_list_authors() tests.
This matches the name of the function being tested.

Follow-up to [27550].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53487


git-svn-id: http://core.svn.wordpress.org/trunk@53076 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-11 13:43:13 +00:00
audrasjb
df0d910007 Query: Add a hook to filter author full name from wp_list_authors().
This changeset introduces the `wp_list_author_full_name` hook to allows developers to filter author full name, which by default is a combinaison of the author first and last name, separated by a space.

Props kevinB, wonderboymusic, DrewAPicture, nacin, Mte90, jorbin, afercia, rafiahmedd.
Fixes #17025.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53075 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-10 18:23:18 +00:00
spacedmonkey
c8f31dc0c0 REST API: Improve post cache priming in WP_REST_Post_Search_Handler class.
In the `WP_REST_Post_Search_Handler` class, ensure that post, post meta and term caches are correctly primed when performing a search.

Props furi3r, spacedmonkey, TimothyBlynJacobs, audrasjb, peterwilsoncc. 
Fixes #55674.


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


git-svn-id: http://core.svn.wordpress.org/trunk@53074 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-10 15:47:08 +00:00
Sergey Biryukov
a29c6663fd Docs: Use typed array notation in some post function DocBlocks:
* `wp_queue_posts_for_term_meta_lazyload()`
* `_prime_post_caches()`

See #55646.
Built from https://develop.svn.wordpress.org/trunk@53484


git-svn-id: http://core.svn.wordpress.org/trunk@53073 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-10 15:22:11 +00:00
Sergey Biryukov
9e01bd8adc Query: Some documentation and test improvements for update_post_author_caches():
* Make the descriptions for `update_post_author_caches()` and `update_post_caches()` more specific.
* Move the unit test into its own file, for consistency with `update_post_cache()` tests. This also allows for using shared fixtures in case more tests are added in the future.

Follow-up to [53482].

See #55716.
Built from https://develop.svn.wordpress.org/trunk@53483


git-svn-id: http://core.svn.wordpress.org/trunk@53072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-10 15:17:10 +00:00
spacedmonkey
2237f67458 Prime users cache in WP_Query and post REST API controller.
For a call to `WP_Query` or a post REST API request that contains posts from multiple authors, call the `cache_users` function, to ensure that all user data for post authors is primed in 
a single database query. This results in far fewer database queries on multiple author sites. 

Props spacedmonkey, timothyblynjacobs, peterwilsoncc.
Fixes #55716.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53071 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-10 13:39:11 +00:00
Sergey Biryukov
558cd4c353 Media: Some documentation and test improvements for wp_img_tag_add_decoding_attr():
* Add a `@since` note for the `decoding` attribute in `wp_get_attachment_image()`.
* Adjust `wp_img_tag_add_decoding_attr()` DocBlocks per the documentation standards.
* Wrap some long `sprintf()` calls in unit tests for better readability. In at least one case, `the_content` was unnecessarily passed to `sprintf()` as an extra (unused) parameter.

Follow-up to [53480].

See #53232.
Built from https://develop.svn.wordpress.org/trunk@53481


git-svn-id: http://core.svn.wordpress.org/trunk@53070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-09 16:21:14 +00:00
Peter Wilson
b8e44627c8 Media: Add decoding="async" to image attributes.
Dynamically add `decoding="async"` to image tags on the front end of a site to instruct browsers to download them in parallel.

Modifies `wp_get_attachment_image()`, `get_avatar()` to include the attribute by default. Modifies `wp_filter_content_tags()` to add the attribute during the front-end render of the site.

Introduces `wp_img_tag_add_decoding_attr()` to take an image tag and modify it to include the attribute. Introduces the filter `wp_img_tag_add_decoding_attr` used to define the default value for the attribute.

Props adamsilverstein, ayeshrajans, costdev, flixos90, hellofromtonya, isaumya, michaelbourne, mihai2u, mitogh, sergiomdgomes, spacedmonkey, westonruter, peterwilsoncc.
Fixes #53232.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53069 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-09 05:31:12 +00:00
Sergey Biryukov
cf5df71b88 Tests: Correct an assertion in wp_rand() tests.
The function returns non-negative integers, which includes zero.

Follow-up to [53473], [53477].

See #55194.
Built from https://develop.svn.wordpress.org/trunk@53479


git-svn-id: http://core.svn.wordpress.org/trunk@53068 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-08 13:19:14 +00:00
Sergey Biryukov
4b286c4f77 Tests: Move the tests for individual pluggable functions into their own directory.
This aims to make the tests more discoverable and easier to expand.

Follow-up to [50790], [53473], [53477].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53478


git-svn-id: http://core.svn.wordpress.org/trunk@53067 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-07 14:45:12 +00:00
Sergey Biryukov
e380ff685d Tests: Use more descriptive names for wp_rand() test methods.
This aims to clarify the intention of the tests.

Follow-up to [53473].

Props mlajo, costdev, acoulombe, azouamauriac, swissspidy, tobifjellner, peterwilsoncc, audrasjb, marekdedic, SergeyBiryukov.
See #55194.
Built from https://develop.svn.wordpress.org/trunk@53477


git-svn-id: http://core.svn.wordpress.org/trunk@53066 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-07 12:03:12 +00:00
audrasjb
7821fe08db Text Changes: Improve consistency of admin error notices in wp-admin/options.php.
This changeset replaces <strong>Error</strong>: with <strong>Error:</strong>, for better consistency.

Follow-up to [53458].

Fixes #50785.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-07 05:30:13 +00:00
audrasjb
2029a33158 Twenty-Twenty: Fix a width/alignement issue on "Wide Line" Separator style variation.
This change fixes an alignement issue on the "Wide Line" Separator style variation on front-end, especially when used inside a column block. It changes the block `width` value from `120rem` to `100%` to avoid container overflowing.

Props kjellr, matthiaspabst, sabernhardt, audrasjb.
Fixes #53643.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53064 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-07 05:23:09 +00:00
audrasjb
20c003e842 Docs: Use third-person singular verbs for function descriptions in the Core Translation API.
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53063 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-07 05:18:13 +00:00
audrasjb
56d7437f59 General: Ensure wp_rand() returns 0 when $min and $max values are equal to 0.
This changeset ensures `wp_rand()` returns zero instead of a random number when both `$min` and `$max` values are equal to zero.

Fixes #55194.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53062 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-06 22:50:10 +00:00
audrasjb
0ab9c4ee4b Docs: Various fixes in wp-includes/pluggable.php docblocks, as per documentation standards.
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53061 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-06 22:35:10 +00:00
audrasjb
312f7d4b76 Twenty-Twenty: Fix paragraph block alignment issues when used on a RTL website.
Twenty Twenty's `style.css` file has `/*rtl:ignore*/` for the `.has-text-align-left` class, but that was previously missing from the `.has-text-align-right` class. As a result, the theme overrides block library styles on the front-end (and not in the editor). This changeset adds the missing declaration.

Props amirkamizi, mayankmajeji, ianbelanger, sabernhardt, hasanuzzamanshamim.
Fixes #49447.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53060 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-06 21:42:13 +00:00
audrasjb
5d96ddab10 Twenty-Twenty: Improve Quote block style consistency between front and back-end.
This changeset updates the `font-style` value of the Quote block in the block editor to ensure styles are consistent between the editor and the front-end.

Props kajalgohel, iamjaydip, audrasjb, whaze, mukesh27.
Fixes #55931.


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


git-svn-id: http://core.svn.wordpress.org/trunk@53059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-06 13:31:15 +00:00
Sergey Biryukov
a29a0e05d1 Docs: Correct method reference format in some DocBlocks.
This ensures that the methods are recognized by the WordPress Code Reference parser.

Follow-up to [7994], [25567], [27156], [28887], [49672], [52226].

Props dd32, audrasjb.
Fixes #55928.
Built from https://develop.svn.wordpress.org/trunk@53469


git-svn-id: http://core.svn.wordpress.org/trunk@53058 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-06 10:51:12 +00:00
desrosj
1ce3b1ae3b Build/Test Tools: Correctly confirm the previous workflow run was triggered by a push event.
This fixes the code added in [53466] to look at the correct workflow object when determining the outcome of the previous workflow run.

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53468


git-svn-id: http://core.svn.wordpress.org/trunk@53057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-05 19:45:15 +00:00
Sergey Biryukov
6c79e4b29b Tests: Update the URL to the documentation on GitHub Actions environment variables.
Follow-up to [49264].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53467


git-svn-id: http://core.svn.wordpress.org/trunk@53056 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-05 14:06:11 +00:00
desrosj
6a7de2d74a Build/Test Tools: Prevent inaccurate “fixed” notifications in Slack.
When searching for previous workflow runs by branch, GitHub currently includes matches within forks.

If a contributor opens a pull request from their fork with a `head_ref` matching a Core branch that triggers a workflow on `push` event, the outcomes of the workflows associated with that pull request are currently used to determine if the previous workflow run had failed.

The result is a false “fixed” notifications when a commit immediately follows a failed workflow run from the pull request.

This adds a check to skip any workflow runs not triggered by a `push` event to prevent these inaccurate notifications.

Props SergeyBiryukov.
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53466


git-svn-id: http://core.svn.wordpress.org/trunk@53055 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-05 09:31:13 +00:00
Sergey Biryukov
5a2b984cc0 Tests: Don't overwrite image metadata in a wp_calculate_image_srcset() test for zero width.
This was unnecessarily replacing the original image metadata with a scaled version, leading to a few leftover images with the `-scaled` suffix in the `wp-content/uploads` directory.

Follow-up to [35412].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53465


git-svn-id: http://core.svn.wordpress.org/trunk@53054 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-04 18:05:08 +00:00
Sergey Biryukov
61b7a2a3e2 Tests: Consistently pass the $force_delete parameter to wp_delete_attachment().
Convert some `wp_delete_post()` calls to `wp_delete_attachment()` to avoid an extra function call.

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53464


git-svn-id: http://core.svn.wordpress.org/trunk@53053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-04 13:41:08 +00:00
Sergey Biryukov
854a06a4ad Tests: Clean up test images before performing assertions in image resize tests.
This makes sure there are no leftover images in case of a test failure.

Follow-up to [161/tests], [1255/tests].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53463


git-svn-id: http://core.svn.wordpress.org/trunk@53052 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-04 12:57:10 +00:00
audrasjb
343af672af Docs: Replace "updated" with "deleted" in wpdb::delete @return description.
Props audrasjb, cadlec.
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53051 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-04 12:15:12 +00:00
Sergey Biryukov
3fec80568e Tests: Add some test cases for path_join() with Windows paths.
Follow-up to [6984], [53457], [53460].

Props joyously.
See #55897.
Built from https://develop.svn.wordpress.org/trunk@53461


git-svn-id: http://core.svn.wordpress.org/trunk@53050 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-03 15:07:21 +00:00
Sergey Biryukov
1d2e969b50 General: Remove redundant ltrim() from path_join().
If the path starts with a slash, it will be considered absolute and returned as is earlier in the function.

It it's not absolute, then it does not start with a slash, so there is nothing to trim.

This change is covered by existing unit tests.

Follow-up to [6984], [53457].

Props karlijnbk.
See #55897.
Built from https://develop.svn.wordpress.org/trunk@53460


git-svn-id: http://core.svn.wordpress.org/trunk@53049 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-02 15:31:08 +00:00
audrasjb
e05a38f0a5 Twenty-Twenty: Alignment fix on Separator Block editor styles.
This changeset fixes an issue with some CSS rules of the "Wide Line" variation of the Separator Block’s editor stylesheet, for small, medium and large screens.

Props umesh84, iamjaydip, mukesh27, larrach.
Fixes #55896.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53048 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-02 15:10:10 +00:00
audrasjb
bbe60d66c3 Text Changes: Improve consistency of admin error notices.
This changeset replaces `<strong>Error</strong>:` with `<strong>Error:</strong>`, for better consistency.

Props transl8or, mihaidumitrascu, audrasjb.
Fixes #50785.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-02 15:05:13 +00:00
Sergey Biryukov
6f2e2a33be Tests: Add unit tests for path_join().
Props karlijnbk.
See #55897.
Built from https://develop.svn.wordpress.org/trunk@53457


git-svn-id: http://core.svn.wordpress.org/trunk@53046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-02 15:00:13 +00:00
audrasjb
a6539b8cfb Docs: Use third-person singular verbs for method descriptions in wp-includes/post.php, as per docs standards.
Props whaze.
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-02 10:55:11 +00:00
Sergey Biryukov
01d172b581 General: Replace all esc_url_raw() calls in core with sanitize_url().
This aims to improve performance by calling `sanitize_url()` directly, instead of the `esc_url_raw()` wrapper. As of WordPress 6.1, `sanitize_url()` is the recommended function for sanitizing a URL for database or redirect usage.

Follow-up to [11383], [13096], [51597], [53452].

Props benjgrolleau, peterwilsoncc, SergeyBiryukov.
Fixes #55852.
Built from https://develop.svn.wordpress.org/trunk@53455


git-svn-id: http://core.svn.wordpress.org/trunk@53044 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-01 18:14:10 +00:00
Sergey Biryukov
3be126b751 Tests: Require the zip PHP extension in block templates export file test.
This avoids a test failure if the `ZipArchive` class is missing.

Additionally, this commit replaces an inline check for the `ZipArchive` class in personal data export file tests with a `@requires` annotation, for consistency with similar PHP extension requirements in other tests.

Follow-up to [44786], [51415], [52286].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53454


git-svn-id: http://core.svn.wordpress.org/trunk@53043 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-01 14:18:10 +00:00
Sergey Biryukov
f2a7f4a387 I18N: Use consistent context for the "Add New" string when referring to media.
This replaces the only instance of the `add new media` context with `file`, used in other instances of the string.

Follow-up to [9198], [10680], [21948].

Props benjgrolleau, tobifjellner, SergeyBiryukov.
Fixes #55876.
Built from https://develop.svn.wordpress.org/trunk@53453


git-svn-id: http://core.svn.wordpress.org/trunk@53042 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-31 18:39:10 +00:00
Sergey Biryukov
d0712f35d4 Formatting: Make sanitize_url() the recommended function for sanitizing a URL.
A general security rule is "Sanitize when you save, escape when you echo".

In WordPress 5.9, `sanitize_url()` was un-deprecated in order to better align with the naming of other sanitizing functions, while still being an alias for `esc_url_raw()`.

This commit reverses the order and turns `esc_url_raw()` into a wrapper for `sanitize_url()`, making the latter the canonical function call and aiming to improve performance by reducing the number of function calls required when using the recommended technique.

Follow-up to [11383], [13096], [51597].

Props benjgrolleau, peterwilsoncc, SergeyBiryukov.
See #55852.
Built from https://develop.svn.wordpress.org/trunk@53452


git-svn-id: http://core.svn.wordpress.org/trunk@53041 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-31 15:17:14 +00:00
Sergey Biryukov
9268ef9788 Media: Add support for WebP images in the Thickbox library.
This ensures that `.webp` images are properly recognized and displayed in the modal as expected.

Follow-up to [50810], [51227], [52073].

Props ilunabar, graham73may, sabernhardt, mukesh27, SergeyBiryukov.
Fixes #55786.
Built from https://develop.svn.wordpress.org/trunk@53451


git-svn-id: http://core.svn.wordpress.org/trunk@53040 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-30 14:53:11 +00:00
Sergey Biryukov
d842b3b5c3 Docs: Explicitly declare some globals for clarity.
This aims to improve developer experience by making it clear that these variables are defined elsewhere.

Props ravipatel, davidbaumwald, hellofromTonya, costdev, SergeyBiryukov.
Fixes #51439.
Built from https://develop.svn.wordpress.org/trunk@53450


git-svn-id: http://core.svn.wordpress.org/trunk@53039 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-29 15:35:11 +00:00
Sergey Biryukov
9a2a423eb6 Quick/Bulk Edit: Check the show_in_quick_edit taxonomy property when processing the data for bulk edited posts.
Previously, setting the `show_in_quick_edit` property to `false` removed the taxonomy from the inline edit form, but several taxonomy-related database queries were still being performed in `bulk_edit_posts()` when building the arguments to pass to `wp_update_post()`, even though terms were not modified.

This commit improves performance by avoiding unnecessary database queries when `show_in_quick_edit` is `false`, and mirrors a similar check in the `get_inline_data()` function.

Follow-up to [13535], [14580], [31307], [52841], [53368].

Props Chouby, sabernhardt, costdev, nalininonstopnewsuk, webcommsat, marybaum, meher, wparslan, SergeyBiryukov.
Fixes #42474.
Built from https://develop.svn.wordpress.org/trunk@53449


git-svn-id: http://core.svn.wordpress.org/trunk@53038 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-27 15:51:12 +00:00
Peter Wilson
290742cada Budled themes: Revert the Twenty Ten theme version to 3.6.
No functional changes were made to Twenty Ten during the WordPress 6.0 release cycle so the theme version bump is not needed. The "tested up to" header change is maintained.

Follow up to and partial revert of [53418].

Props desrosj, ravipatel, costdev.
Fixes #55810.
See #55754.


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


git-svn-id: http://core.svn.wordpress.org/trunk@53037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-25 02:51:09 +00:00
Peter Wilson
cf5cf75f09 Help/About: Add cache busting string to video thumbnail.
Append `?ver=6.0` to the image used for linking to the video to break the cache in browsers, proxy servers and on the CDN.

A new version of the image has been uploaded and replaced the file in the original location.

Props annezazu, critterverse, ryelle, costdev, ironprogrammer, dd32.
Fixes #55808.


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


git-svn-id: http://core.svn.wordpress.org/trunk@53036 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-25 02:19:17 +00:00
Peter Wilson
5214e469df Help/About: Finalise links on about page.
Wrap up about page for 6.0 release.

Props ryelle, mukesh27, hellofromTonya, SergeyBiryukov, peterwilsoncc.
Fixes #55775.


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


git-svn-id: http://core.svn.wordpress.org/trunk@53031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-23 23:53:13 +00:00
Sergey Biryukov
d0e055e68f Coding Standards: Correct alignment in various files.
This fixes an `Equals sign not aligned correctly` WPCS warning.

Additionally, this commit sets the `svn:eol-style` property for the `phpunit/tests/ajax/wpAjaxCropImage.php` file and corrects line endings, so that the output of `composer format` is clean.

Follow-up to [53027], [53217], [53404].

Props hellofromTonya, SergeyBiryukov.
See #55647.
Built from https://develop.svn.wordpress.org/trunk@53441


git-svn-id: http://core.svn.wordpress.org/trunk@53030 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-23 20:40:14 +00:00
Sergey Biryukov
653a3af0d4 Upgrade/Install: Update $_old_files for 6.0.
Props hellofromTonya, JeffPaul, SergeyBiryukov.
Fixes #55794.
Built from https://develop.svn.wordpress.org/trunk@53439


git-svn-id: http://core.svn.wordpress.org/trunk@53028 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-23 17:02:16 +00:00
ryelle
c07f05ab86 Administration: Fix image overlap in Dashboard welcome panel.
Use longhand positioning properties (top, right, etc) so that the rtlcss build process can correctly adjust the layout for the RTL CSS.

Props ryelle, costdev, ironprogrammer, hellofromtonya.
Fixes #55793.


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


git-svn-id: http://core.svn.wordpress.org/trunk@53026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-23 16:48:15 +00:00
Sergey Biryukov
6e15f7fc9a Docs: Use third-person singular verbs for method descriptions in wp-includes/class-wp-roles.php, per the documentation standards.
See #55646.
Built from https://develop.svn.wordpress.org/trunk@53436


git-svn-id: http://core.svn.wordpress.org/trunk@53025 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-23 15:01:12 +00:00
Sergey Biryukov
b2869c1e62 General: Bump the recommended MariaDB version in readme.html.
MariaDB 10.2 has reached EOL in May 2022. The recommended minimum is bumped to 10.3 for now.

Follow-up to [52319], [52358], [52420], [52424], [53431], [53433], [meta11866].

Props hellofromTonya.
Fixes #55791. See #meta6322.
Built from https://develop.svn.wordpress.org/trunk@53435


git-svn-id: http://core.svn.wordpress.org/trunk@53024 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-23 14:22:10 +00:00
Sergey Biryukov
538587ef1d Tests: Improve the assertions in recommended MySQL and MariaDB version tests.
Comparing human-readable dates instead of numeric timestamps gives identical results, but makes the message more clear in case of failure.

Follow-up to [33946], [52418], [52421], [52424].

See #55791, #55652.
Built from https://develop.svn.wordpress.org/trunk@53433


git-svn-id: http://core.svn.wordpress.org/trunk@53022 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-23 14:09:12 +00:00
hellofromTonya
59d78a1dd4 Build/Test Tools: Temporarily skip MariaDB version test.
TEMPORARY COMMIT.

MariaDB version 10.2 is no longer supported as of 23 May 2022. This commit temporarily skips the version test. Why? To avoid test failures during this period, i.e. until the version is bummped and `readme.html` file changed.

See #55791, [https://meta.trac.wordpress.org/ticket/5999 Meta5999].
Built from https://develop.svn.wordpress.org/trunk@53431


git-svn-id: http://core.svn.wordpress.org/trunk@53020 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-23 13:32:07 +00:00
hellofromTonya
fd34524107 Build/Test Tools: Fix comments odd/even instabilities (test leaks).
The odd / even class attribute global variables are causing issues in comments tests when a new test is added or an existing test is modified. To stabilize the odd / even comment tests, the comment global variables are added to the base test class' `tear_down()` using the same patterns as the other global resets. This change ensures each comment test starts at the same state. In doing so, the expected odd / even class attributes are no longer affected by previous tests, i.e. test leaks.

Follow-up to [53172].

Props hellofromTonya, zieladam, peterwilsoncc.
See #54725.
Built from https://develop.svn.wordpress.org/trunk@53430


git-svn-id: http://core.svn.wordpress.org/trunk@53019 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-23 11:56:13 +00:00
Sergey Biryukov
f6412575c8 Query: Check if $wp_query is set in query loop functions.
This avoids a PHP fatal error if any of these functions are called too early:

* `have_posts()`
* `in_the_loop()`
* `rewind_posts()`
* `the_post()`
* `have_comments()`
* `the_comment()`

bringing some consistency with conditional tags: `is_single()`, `is_home()`, etc.

This commit also removes unnecessary `return` from `the_comment()`, for consistency with `the_post()`. As `WP_Query::the_comment()` does not have a return value, this statement did not have any effect in practice.

Follow-up to [4934], [8807], [16947], [17068], [17083], [49147], [53395], [53396], [53400].

Props vdankbaar, thijso, teunvgisteren, timkersten655, SergeyBiryukov.
Fixes #55722.
Built from https://develop.svn.wordpress.org/trunk@53429


git-svn-id: http://core.svn.wordpress.org/trunk@53018 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-22 15:17:14 +00:00
Sergey Biryukov
f4af743ea7 Docs: Correct the type for WP_Post::$post_category and ::$tags_input.
These properties are arrays of category IDs and tag names, respectively, not a single integer or string.

Follow-up to [21651], [31127], [32729], [48941].

Props omaeyusuke.
Fixes #55785.
Built from https://develop.svn.wordpress.org/trunk@53428


git-svn-id: http://core.svn.wordpress.org/trunk@53017 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-21 12:07:13 +00:00
desrosj
766a38f2fb Build/Test Tools: Link to a specific run attempt in GitHub Action Slack notifications.
This adjusts the workflow run URLs included in Slack notifications to link to the specific attempt being reported on making it easier for someone to see the proper context of a specific notification.

Additionally, this eliminates the need for a contributor to share the reason for a failure in Slack before restarting the workflow, as the link will always be to that specificattempt. When a “fixed” notification occurs for a subsequent run attempt, the link will be to the new, successful run attempt.

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53427


git-svn-id: http://core.svn.wordpress.org/trunk@53016 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-20 17:42:09 +00:00
Sergey Biryukov
40fc19024f Code Modernization: Replace phpversion() function calls with PHP_VERSION constant.
`phpversion()` return value and `PHP_VERSION` constant value are identical, but the latter is several times faster because it is a direct constant value lookup compared to a function call.

Props ayeshrajans, jrf, mukesh27, costdev, hellofromTonya, SergeyBiryukov.
Fixes #55680.
Built from https://develop.svn.wordpress.org/trunk@53426


git-svn-id: http://core.svn.wordpress.org/trunk@53015 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-20 17:38:14 +00:00
gziolo
59c970101f Docs: Add missing documentation for fallback_gap_value param
Follow-up for [53420]. 

Props SergeyBiryukov.
See #55567.


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


git-svn-id: http://core.svn.wordpress.org/trunk@53010 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-20 15:35:14 +00:00
gziolo
cbcf19d09d Editor: Update WordPress packages for 6.0 RC 4
Included cherry-picked commits from the Gutenberg plugin that fix bugs discovered after WordPress 6.0 RC 3.

Props zieladam.
See #55567.



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


git-svn-id: http://core.svn.wordpress.org/trunk@53009 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-20 14:32:40 +00:00
gziolo
b020766e3d Editor: Fix opinionated block styles loading in editor
Related changes in Gutenberg: https://github.com/WordPress/gutenberg/pull/40937.

Backport for WordPress 6.0 RC 4.

Props jffng.
See #55567.


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


git-svn-id: http://core.svn.wordpress.org/trunk@53008 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-20 11:42:19 +00:00
Peter Wilson
55a5dbcf27 Bundled themes: Bump versions for WordPress 6.0 release.
Bump bundled theme version numbers in preparation for the WordPress 6.0 release. Each theme's _tested up to_ file header has been increased to indicate WordPress 6.0 support.

The new version numbers are:

* Twenty Ten: 3.7
* Twenty Eleven: 4.1
* Twenty Twelve: 3.7
* Twenty Thirteen*: 3.7
* Twenty Fourteen: 3.4
* Twenty Fifteen*: 3.2
* Twenty Sixteen*: 2.7
* Twenty Seventeen*: 3.0
* Twenty Nineteen: 2.3
* Twenty Twenty: 2.0
* Twenty Twenty-One: 1.6

An asterisk indicates the theme includes assets requiring a manual version bump, this is set to the reverse date format of the release day: `20220524`.

Follow up to [53286] in which the Twenty Twenty-Two theme version was bumped to 1.2.

Props peterwilsoncc, desrosj, costdev, mehedi890.
Fixes #55754.


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


git-svn-id: http://core.svn.wordpress.org/trunk@53007 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-20 01:49:16 +00:00
Peter Wilson
ec3b0158d8 Themes: Accept valid block themes.
Updates theme validation to accept block themes. This replaces the requirement for an `index.php` with a requirement for either an `index.php`, `/templates/index.html` or the deprecated `/block-templates/index.html`.

Validation is updated for theme uploads, within `WP_Theme::__construct` and `validate_current_theme()`. 

A block theme using the deprecated file structure is now included in the unit tests.

Props peterwilsoncc, sergeybiryukov, hellofromtonya, costdev, azaozz, gziolo, FlorianBrinkmann, Boniu91, aristath, poena, audrasjb.
Fixes #55754.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53005 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-20 00:49:18 +00:00
Sergey Biryukov
4b46629139 Accessibility: List Tables: Hide the Comments column icon and title attribute from screen readers.
The element already has non-visual text, making the icon and the `title` attribute redundant for assistive technologies.

Follow-up to [22439], [27548], [31513], [32991], [50804].

Props sabernhardt, ryokuhi, afercia, karlgroves, SergeyBiryukov.
Fixes #55555. See #24766.
Built from https://develop.svn.wordpress.org/trunk@53414


git-svn-id: http://core.svn.wordpress.org/trunk@53003 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-19 15:54:15 +00:00
Peter Wilson
08c5dbc7e9 Site Editor: Include style parameter in home template redirect.
When redirecting the site editor to the home template include the `style` querystring parameter if it is set. This ensures the style panel opens if the user expects it.

Props grantmkin, mamaduka, peterwilsoncc.
Fixes #55752.


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


git-svn-id: http://core.svn.wordpress.org/trunk@53002 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-19 02:27:13 +00:00
Sergey Biryukov
6d0b0d9a4b Docs: Add missing documentation for some Customize class properties:
* `WP_Customize_Background_Image_Control::$type`
* `WP_Customize_Background_Image_Setting::$id`
* `WP_Customize_Header_Image_Setting::$id`

Follow-up to [21037], [21053], [30885].

Props iamjaydip.
See #55646.
Built from https://develop.svn.wordpress.org/trunk@53411


git-svn-id: http://core.svn.wordpress.org/trunk@53000 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-18 15:24:14 +00:00
audrasjb
d4f6347b94 Twenty Twenty-Two: Fix typo in Dark Footer pattern docblock.
Props passoniate, audrasjb.
Fixes #55772.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-18 12:57:12 +00:00
Peter Wilson
88f38062e2 Help/About: Ensure about page shows current header.
Add a query string parameter to the about page header images to ensure the cache is broken in browsers and CDNs.

Props ryelle.
Fixes #55750.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-18 03:01:13 +00:00
Sergey Biryukov
2972db4ba5 Users: Fail gracefully when checking mapped capabilities without providing the required object ID.
This avoids an `Undefined array key 0` PHP warning for `current_user_can()` capability checks that require a specific object to check against but an object ID was not passed.

A `_doing_it_wrong()` notice is also added, so that developers and site administrators are aware that the capability mapping is failing in the absence of the required object ID.

The list of mapped capabilities that require an object ID:

* `delete_post` / `delete_page`
* `edit_post` / `edit_page`
* `read_post` / `read_page`
* `publish_post`
* `edit_(post|comment|term|user)_meta` / `delete_*_meta` / `add_*_meta`
* `edit_comment`
* `edit_term` / `delete_term` / `assign_term`

Follow-up to [34091], [34113], [47178].

Props jeherve, peterwilsoncc, henry.wright, johnbillion, mattheweppelsheimer, hellofromTonya, JeffPaul, azouamauriac, Ninos Ego, TobiasBg, wpsmith, GaryJ, nacin, johnstonphilip, azaozz, SergeyBiryukov.
Fixes #44591.
Built from https://develop.svn.wordpress.org/trunk@53408


git-svn-id: http://core.svn.wordpress.org/trunk@52997 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-17 19:01:20 +00:00
gziolo
571e1e01b3 Editor: Return additional block patterns to server-generated settings
Reverts changes from [53155] to ensure backward compatibility.

Companion to Gutenberg changes https://github.com/WordPress/gutenberg/pull/40818. That makes sure that patterns registered with `admin_init` or `current_screen` hooks are not lost.

Props jsnajdr, zieladam, peterwilsoncc, johnstonphilip.
See #55567.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52993 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-17 14:38:14 +00:00
gziolo
58dfeaa86f Editor: Update WordPress packages for 6.0 RC 3
Included cherry-picked commits from the Gutenberg plugin that fix bugs discovered after WordPress 6.0 RC 2.

Props zieladam, ndiego.
See #55567.



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


git-svn-id: http://core.svn.wordpress.org/trunk@52992 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-17 13:30:31 +00:00
gziolo
102004b505 Theme: Use a better method to determine the theme name during export
See the same change in the Gutenberg plugin: https://github.com/WordPress/gutenberg/pull/40829.

Props scruffian, davidbaumwald, jeremyfelt.
See #55567.



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


git-svn-id: http://core.svn.wordpress.org/trunk@52991 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-17 12:10:14 +00:00
audrasjb
c03decd0cb Users: Fix misalignment of new user password toggle button on mobile.
This fixes an issue where the password hide/show button was misaligned when creating a new user on small screens.

Props kebbet.
Fixes #55558.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52990 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-16 22:37:12 +00:00
Sergey Biryukov
aeb3b7530a Tests: Use a data provider in the test for conditional tags returning early if $wp_query is not set.
Follow-up to [53395], [53396].

Props peterwilsoncc.
See #55104.
Built from https://develop.svn.wordpress.org/trunk@53400


git-svn-id: http://core.svn.wordpress.org/trunk@52989 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-16 14:11:12 +00:00
audrasjb
e3def96108 Twenty Twenty-One: Add a missing HTML comment to indicate the end of .post-thumbnail section.
Props haritpanchal.
Fixes #55724.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52988 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-15 22:34:08 +00:00
audrasjb
c29c6885c0 Coding Standards: Fix params indentation in pre_get_network_by_path hook docblock.
See #55647.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52987 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-15 20:32:08 +00:00
audrasjb
200283a99e Docs: Use third-person singular verbs for function descriptions in the WP_Network class.
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52986 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-15 20:28:07 +00:00
Sergey Biryukov
313f6f8fe0 Tests: Expand the test for conditional tags returning early if $wp_query is not set.
When called too early, conditional query tags should throw a `_doing_it_wrong()` notice and return `false`. This commit verifies that behavior not only for `is_main_query()`, but for all the other conditional tags too.

Follow-up to [16947], [17068], [17083], [18699], [37985], [53395].

See #55104.
Built from https://develop.svn.wordpress.org/trunk@53396


git-svn-id: http://core.svn.wordpress.org/trunk@52985 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-15 15:57:13 +00:00
Sergey Biryukov
a5db52030f Query: Check if $wp_query is set in is_main_query().
This avoids a PHP fatal error and triggers a `_doing_it_wrong()` notice if `is_main_query()` is called too early, bringing consistency with all the other `is_*()` conditionals: `is_single()`, `is_home()`, etc.

Follow-up to [16947], [17068], [17083], [18699], [37985].

Props vdankbaar, nhadsall, johnbillion, costdev, thijsoo, teunvgisteren, timkersten655, SergeyBiryukov.
Fixes #55104.
Built from https://develop.svn.wordpress.org/trunk@53395


git-svn-id: http://core.svn.wordpress.org/trunk@52984 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-14 15:10:14 +00:00
Sergey Biryukov
04f9d9bdf6 Database: Use generic references to a database server in ms_not_installed().
This replaces the references to “MySQL” with “your host’s database server” on the “Error establishing a database connection” page when Multisite could not be loaded. The generic “database server” term can refer to MySQL or MariaDB. Additionally, this brings some consistency with a similar error message in `wpdb::db_connect()`.

Follow-up to [52367], [52423].

Props tj692, hansjovisyoast, tobifjellner.
Fixes #55701.
Built from https://develop.svn.wordpress.org/trunk@53394


git-svn-id: http://core.svn.wordpress.org/trunk@52983 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-13 12:21:13 +00:00
Sergey Biryukov
2130878354 Docs: Replace Codex URL with a corresponding HelpHub article in the Additional CSS section in Customizer.
Follow-up to [45674-45677], [46740], [49912].

Props stevenlinx, audrasjb.
Fixes #55710. See #48987.
Built from https://develop.svn.wordpress.org/trunk@53393


git-svn-id: http://core.svn.wordpress.org/trunk@52982 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-12 17:57:17 +00:00
audrasjb
96c26acafd Taxonomy: Set use_desc_for_title to false by default in wp_list_categories()
This change removes the default `title` attribute of category links returned by `wp_list_categories()`, for better accessibility.

Props just0nequestion, joyously, andrija, audrasjb, sabernhardt.
Fixes #55530.
See #24766.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-12 14:06:21 +00:00
Sergey Biryukov
f4d9778c98 Menus: Replace "drop down" (noun) with "dropdown" in a few strings.
This makes the spelling more consistent with other instances of the word in core.

Follow-up to [23844], [27676].

Props NekoJonez, mukesh27, SergeyBiryukov.
Fixes #55661.
Built from https://develop.svn.wordpress.org/trunk@53391


git-svn-id: http://core.svn.wordpress.org/trunk@52980 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-11 13:22:15 +00:00
audrasjb
3a48bc354d Twenty Twenty-One: i18n fix for privacy policy section title.
This change makes the Twenty Twenty-One privacy policy section title translatable.

Props nlpro.
Fixes #55709.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52979 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-11 08:46:17 +00:00
hellofromTonya
88a16c0ad7 Editor: Use stricter assertions in comment template tests.
Backport of the remaining Comment Template block tests from Gutenberg:

* `assertEquals()` replaced with `assertSameSetsWithIndex()`.
* assertion's argument order changed to ensure expected and then actual.

Follow-up to [53353], [53298], [53172], [53138].

Props bernhard-reiter.
Fixes #55708.
Built from https://develop.svn.wordpress.org/trunk@53388


git-svn-id: http://core.svn.wordpress.org/trunk@52977 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-10 21:30:11 +00:00
ryelle
e8c02840a7 Administration: Update design of the Dashboard welcome panel.
This updates the panel to match the 6.0 About page styles, with the 6.0 graphic changing color based on the selected admin color scheme.

Props fcoveram, critterverse, joedolson, SergeyBiryukov.
Fixes #55532.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52972 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-10 16:45:08 +00:00
ryelle
8817bba1bf Help/About: Update the About section for 6.0.
Switch the images to use the s.w.org CDN. Update the font style and spacing on the About page. Update the header images for Credits, Freedoms, and Privacy.

Props fcoveram, peterwilsoncc, SergeyBiryukov.
Fixes #55434.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52971 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-10 16:33:08 +00:00
gziolo
8f952495a7 Editor: Update WordPress packages for 6.0 RC 2 (part 2)
Includes cherry-picked commit from the Gutenberg plugin that fix a bug discovere just before WordPress 6.0 RC 2.

Props hellofromtonya, zieladam, kebbet.
See #55567.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52967 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-10 15:57:28 +00:00
gziolo
6a989e83f6 Editor: Update WordPress packages for 6.0 RC 2
Included cherry-picked commits from the Gutenberg plugin that fix bugs discovere after WordPress 6.0 RC 1.

Props zieladam, ndiego, hellofromtonya.
See #55567.



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


git-svn-id: http://core.svn.wordpress.org/trunk@52966 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-10 14:49:35 +00:00
Sergey Biryukov
cb2d81f6df Coding Standards: Restore the $pieces variable for SQL clauses in query classes.
This is a defensive coding measure that aims to reduce confusion. With this change, `$pieces` is explicitly used for the names, and `$clauses` for the values of the clauses.

Follow-up to [52974], [53175], [53370], [53375].

Props peterwilsoncc.
See #55699.
Built from https://develop.svn.wordpress.org/trunk@53376


git-svn-id: http://core.svn.wordpress.org/trunk@52965 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-10 11:21:09 +00:00
Sergey Biryukov
4959a268c3 Coding Standards: Restore the $pieces variable in WP_Query::get_posts().
This is a defensive coding measure that aims to reduce confusion. With this change, `$pieces` is explicitly used for the names, and `$clauses` for the values of the clauses.

Follow-up to [52974], [53175], [53370].

Props peterwilsoncc.
See #55699.
Built from https://develop.svn.wordpress.org/trunk@53375


git-svn-id: http://core.svn.wordpress.org/trunk@52964 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-10 11:17:14 +00:00
Peter Wilson
1dff8e7973 Users: Improve WP_User_Query tests following [53362].
Props SergeyBiryukov.
See #53177.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52962 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-10 05:49:11 +00:00
Peter Wilson
8545c4493b Media: Remove error suppression in wp_filesize().
Replace error suppressing in `wp_filesize()` with a `file_exists()` check before calling the native PHP `filesize()` function.

Follow up to [52837].

Props Cybr, johnbillion, spacedmonkey, antpb, azouamauriac, ironprogrammer, mukesh27, costdev, audrasjb, dlh.
Fixes #55678.
See #49412.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52961 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-10 05:02:11 +00:00
Sergey Biryukov
6aa2e2c123 Tests: Move get_inline_data() tests to a more appropriate place.
Since this is an admin template function and the tests check for specific output with certain taxonomy parameters, placing the tests along with other tests for the functions in the same file should make them easier to find and extend than when placed between general taxonomy registration tests.

Follow-up to [52841], [53368].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@53371


git-svn-id: http://core.svn.wordpress.org/trunk@52960 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-09 17:58:13 +00:00
Sergey Biryukov
ad517e9c12 Query: Restore late compact() call for the posts_clauses_request filter.
This addresses a backward compatibility break where `posts_join_request` and other filters were applied, but their results were subsequently discarded and earlier values were used instead.

Follow-up to [52974], [53175].

Props 5um17, johnbillion, SergeyBiryukov.
Fixes #55699.
Built from https://develop.svn.wordpress.org/trunk@53370


git-svn-id: http://core.svn.wordpress.org/trunk@52959 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-09 13:51:15 +00:00
Peter Wilson
a5e2970995 Quick/Bulk Edit: Additional tests for showing taxonomies.
Additional tests to ensure taxonomies show in the quick/bulk edit froms based on the `show_in_quick_edit` setting rather than the the `show_ui` setting.

Follow up to [52841,31307].

Props figureone, costdev, audrasjb.
Fixes #49701.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52957 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-09 00:34:11 +00:00
Peter Wilson
70e7eec175 Script Loader: Explain why i18n prevents concatenation.
Add inline comment to `WP_Scripts::do_item()` explaining why the definition of a text domain prevents concatenation.

Follow up to [53360].

Fixes #55628.
Props SergeyBiryukov.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52955 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-08 23:59:11 +00:00
Sergey Biryukov
32c0cfe3b3 Code Modernization: Rename parameters to match native PHP functions in wp-includes/compat.php.
This ensures that parameter names for PHP polyfills in WordPress core 100% match the native PHP parameter names. Otherwise using named parameters with those functions could cause fatal errors for installs where the polyfills kick in.

This commit:
* Renames the `$string` parameter to `$message` in `_()` polyfill.
* Renames the `$str` parameter to `$string` in `mb_substr()` and `mb_strlen()` polyfills.
* Renames the `$raw_output` parameter to `$binary` in `hash_hmac()` polyfill.
* Renames the `$a` and `$b` parameters to `$known_string` and `$user_string` in `hash_equals()` polyfill.
* Renames the `$var` parameter to `$value` in `is_countable()` and `is_iterable()` polyfills.
* Renames the `$arr` parameter to `$array` in `array_key_first()` and `array_key_last()` polyfills.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270], [53271], [53272], [53273], [53274], [53275], [53276], [53277], [53281], [53283], [53284], [53285], [53287], [53364].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52954 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-08 00:29:14 +00:00
Sergey Biryukov
8c8b0a203a Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/template.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 `$parent` parameter to `$parent_page` in `parent_dropdown()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270], [53271], [53272], [53273], [53274], [53275], [53276], [53277], [53281], [53283], [53284], [53285], [53287].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52953 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-07 17:16:13 +00:00
Sergey Biryukov
8f805f4ddd Coding Standards: Remove extra space in wp-admin/admin-ajax.php.
Props rajeshraval786, costdev.
Fixes #55692.
Built from https://develop.svn.wordpress.org/trunk@53363


git-svn-id: http://core.svn.wordpress.org/trunk@52952 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-07 16:21:18 +00:00
Peter Wilson
f6ef37b050 Users: Allow any DB field to be returned by WP_User_Query.
Restore behaviour of `fields` parameter in `WP_User_Query` to allow developers to specify any database field to be returned either individually or as part of a subset. Add these fields to the documentation.

When a subset of `fields` includes the `id` paramater, include it in the results in both upper and lowercase to maintain backward compatibility.

Follow up to [53327].

Props dd32, pbearne, kraftbj, peterwilsoncc.
Fixes #53177.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52951 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-07 03:32:11 +00:00
Peter Wilson
b27a924101 Script Loader: Fix i18n edge case breaking dependencies.
Prevent concatenation of scripts if the text domain is defined to ensure the dependency order is respected. 

This accounts for an edge case in which replacing a core script via a plugin and a lack of translations (eg, for a US English site) could cause the JavaScript files to be ordered incorrectly.

Follow up to [52937].

Props audrasjb, boniu91, chaion07, costdev, hellofromtonya, jsnajdr, mukesh27, ndiego, ugyensupport.
Fixes #55628.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52949 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-07 02:53:11 +00:00
John Blackbourn
9afce5d0af Build/Test Tools: Allow the local development environment to run on Apple M1 machines without requiring local configuration changes.
The `amd64/mysql` and `amd64/mariadb` official images from Docker are compatible with x86 running on the ARM64v8 architecture of M1 machines.

Props afragen, justinahinon, desrosj, talldanwp, antonvlasenko, gziolo, aristath, johnbillion

Fixes #52356

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


git-svn-id: http://core.svn.wordpress.org/trunk@52947 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-06 17:16:11 +00:00
Sergey Biryukov
b230f10cf5 Tests: Improve the logic of the SECURITY.md test to check all supported versions.
This avoids a test failure if the list of supported WordPress versions is updated before the trunk version is bumped for a new major release.

Follow-up to [47403], [53347].

Fixes #55667.
Built from https://develop.svn.wordpress.org/trunk@53357


git-svn-id: http://core.svn.wordpress.org/trunk@52946 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-06 11:11:15 +00:00
Sergey Biryukov
7997df84a8 Site Health: Remove unused variables in WP_Site_Health::get_test_plugin_version().
Follow-up to [44986].

Props david.binda, mukesh27.
Fixes #55683.
Built from https://develop.svn.wordpress.org/trunk@53355


git-svn-id: http://core.svn.wordpress.org/trunk@52944 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-05 16:29:08 +00:00
ryelle
686a22802b Help/About: Add link to 6.0 Field Guide, fix missing placeholder in string.
Props audrasjb.
Follow-up to [53339].
See #55434.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52943 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-05 15:35:10 +00:00
hellofromTonya
7acc6d1682 Editor: Add unit test for Comment Template block.
Backport of 2 tests from Gutenberg for the Comment Template block:

* test line and paragraph breaks are converted into HTML tags.
* test rendering of unapproved comment preview.

Follow-up to [53298], [53172], [53138].

Props bernhard-reiter, darerodz, gziolo, peterwilsoncc, hellofromTonya. 
Fixes #55643.
See #55634.
Built from https://develop.svn.wordpress.org/trunk@53353


git-svn-id: http://core.svn.wordpress.org/trunk@52942 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-05 15:29:16 +00:00
Peter Wilson
a34abb93b7 Quick/Bulk Edit: Remove duplicate HTML IDs.
Rename `#inline-edit-legend` to avoid duplicate HTML IDs. These have been renamed `#quick-edit-legend` and `#bulk-edit-legend` for the quick and bulk editors respectively.

This HTML ID is not required by the quick editor duplicated via JavaScript so is removed as part of the duplication process.

Follow up to [53096].

Props azaozz, costdev, greglone, hellofromtonya, ironprogrammer, joedolson, sabernhardt.
Fixes #55575.
See #35483.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52941 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-05 03:26:16 +00:00
Sergey Biryukov
18c2eaa8c0 Build/Test Tools: Pass GitHub Actions environment variables to the Docker container.
This ensures that `WP_UnitTestCase::skipOnAutomatedBranches()` has access to the `GITHUB_REF` and `GITHUB_EVENT_NAME` variables, so that some tests can be skipped when appropriate.

Additionally, account for renaming the `master` branch to `trunk` in November 2021.

Follow-up to [40241], [46999], [49264], [49267], [51868].

Fixes #55668.
Built from https://develop.svn.wordpress.org/trunk@53349


git-svn-id: http://core.svn.wordpress.org/trunk@52938 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-04 00:40:11 +00:00
hellofromTonya
0ea8ac36ba Build/Test Tools: Ensure version number is in 'X.X' format after float math: Tests_Basic::test_security_md().
After subtracing `0.1` from a `X.1` current version, the result was a single digit without the `.0` decimal. Using `number_format()` ensures each current version has a decimal before appending the `.x` before the test.

This commit also reverts [55346] which was a temporary workaround.

Follow-up to [55346], [47403].
Fixes #55667.
Built from https://develop.svn.wordpress.org/trunk@53347


git-svn-id: http://core.svn.wordpress.org/trunk@52936 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-03 18:57:08 +00:00
Sergey Biryukov
68bcc2cbef Tests: Temporarily disable the test for "Supported Versions" section of GitHub Security Policy.
The test needs to be adjusted to handle major version changes correctly.
Built from https://develop.svn.wordpress.org/trunk@53346


git-svn-id: http://core.svn.wordpress.org/trunk@52935 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-03 18:16:08 +00:00
Sergey Biryukov
9cf0633789 Build/Test Tools: Add the 6.0 branch to the workflow for testing branches.
Built from https://develop.svn.wordpress.org/trunk@53345


git-svn-id: http://core.svn.wordpress.org/trunk@52934 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-03 17:44:08 +00:00
Sergey Biryukov
c583043223 Trunk is now 6.1-alpha.
Built from https://develop.svn.wordpress.org/trunk@53344


git-svn-id: http://core.svn.wordpress.org/trunk@52933 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-03 17:40:10 +00:00
Sergey Biryukov
61f74edbb3 Security: Update the Security Policy to include WordPress 6.0.
Built from https://develop.svn.wordpress.org/trunk@53342


git-svn-id: http://core.svn.wordpress.org/trunk@52931 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-03 17:34:09 +00:00
Sergey Biryukov
9efd001e48 Post WordPress 6.0 RC1 version bump.
Built from https://develop.svn.wordpress.org/trunk@53341


git-svn-id: http://core.svn.wordpress.org/trunk@52930 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-03 17:15:10 +00:00
Sergey Biryukov
638a31b8d3 WordPress 6.0 RC1
Built from https://develop.svn.wordpress.org/trunk@53340


git-svn-id: http://core.svn.wordpress.org/trunk@52929 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-03 16:46:09 +00:00
ryelle
7bd9548322 Help/About: Update the About section for 6.0.
This is the start of the WordPress 6.0 about page, introducing new content and a first pass of the new style.

Props fcoveram, estelaris, JeffPaul, critterverse, chanthaboune, dansoschin, webcommsat, annezazu, marybaum, cbringmann, eidolonnight, laurlittle, sergeybiryukov.
See #55434.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52928 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-03 16:28:09 +00:00
hellofromTonya
e9267bf3ee Editor: Update WordPress packages for 6.0 RC1.
Included cherry-picked commits from the Gutenberg plugin that fix bugs discovered after WordPress 6.0 Beta 4.

Props gziolo, zieladam, ndiego.

See #55567.
Built from https://develop.svn.wordpress.org/trunk@53338


git-svn-id: http://core.svn.wordpress.org/trunk@52927 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-03 15:00:36 +00:00
audrasjb
4de4330b17 General: Add missing strong tag to some error messages.
This changeset adds missing `strong` tag to some error messages and updates some AJAX messages, for better consistency.

Follow-up to [53118].

Props NekoJonez, audrasjb, ocean90.
Fixes #54437.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52926 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-03 14:53:09 +00:00
hellofromTonya
7b880889bc Editor: Sets 'paged' query arg only when there are comments: build_comment_query_vars_from_block().
A SQL syntax error happened when a post has no comments and "Break comments into pages" is checked in Settings > Discussion. The fix sets the `'paged'` query arg only when there are comments. When there are no comments, `WP_Comment_Query` sets the default `'paged'` value to `1`.

Props bernhard-reiter, luisherranz, czapla, cbravobernal, davidbaumwald, hellofromTonya.

Follow-up to [53142], [53138].
Fixes #55658.
Built from https://develop.svn.wordpress.org/trunk@53336


git-svn-id: http://core.svn.wordpress.org/trunk@52925 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-03 14:33:12 +00:00
Sergey Biryukov
0c9c1d5297 Post WordPress 6.0 Beta 4 version bump.
Built from https://develop.svn.wordpress.org/trunk@53335


git-svn-id: http://core.svn.wordpress.org/trunk@52924 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-02 16:44:10 +00:00
Sergey Biryukov
26d851eefe WordPress 6.0 Beta 4.
Built from https://develop.svn.wordpress.org/trunk@53334


git-svn-id: http://core.svn.wordpress.org/trunk@52923 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-02 16:10:10 +00:00
hellofromTonya
1cca8be49f REST API: Fixes /wp/v2/pattern-directory/patterns endpoint response for slug parameter.
[53218] introduced a bug of a wrong response from the `wp/v2/pattern-directory/patterns` endpoint with a `slug` parameter. As the response is cached, it can result in an incorrect list of available patterns supported by the current theme.

This commit resolves by:

* Limiting the `slug` to an `array` in the query parameters.
* When set, parsing and sorting the slug(s) and then serializing the sorted query args as part of the hashed transient keys.

Props antonvlasenko, timothyblynjacobs, spacedmonkey, costdev, hellofromTonya.

Follow-up to [53218], [53152], [51208].
Fixes #55617.
Built from https://develop.svn.wordpress.org/trunk@53333


git-svn-id: http://core.svn.wordpress.org/trunk@52922 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-02 14:00:09 +00:00
audrasjb
9d10c963ff Docs: Correct parameter types for serialize_block() and serialize_blocks().
This changeset clarifies the expected type for the first parameter passed to `serialize_block()` and `serialize_blocks()` functions.

Props manooweb.
Fixes #55648.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52921 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-02 13:32:08 +00:00
Sergey Biryukov
9c76c77398 Docs: Remove @return void from various DocBlocks.
Per the documentation standards, it should not be used outside of the default bundled themes.

Follow-up to [38767], [47055], [49697], [50956], [51003], [52069], [53255].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52920 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-02 13:13:08 +00:00
Sergey Biryukov
056bbc95ea Docs: Improve plugin_install_action_links filter's docs.
Refer developers to `plugins_api()` for array of plugin data.

Follow-up to [53074], [53328].

Props afragen, pbiron.
See #55480.
Built from https://develop.svn.wordpress.org/trunk@53330


git-svn-id: http://core.svn.wordpress.org/trunk@52919 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-02 13:07:14 +00:00
gziolo
afd35d1958 Editor: Update WordPress packages for 6.0 Beta 4
Included cherry-picked commits from the Gutenberg plugin that fix bugs discovere after WordPress 6.0 Beta 3.

Props zieladam, ndiego, darerodz.
See #55567.



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


git-svn-id: http://core.svn.wordpress.org/trunk@52918 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-02 10:39:04 +00:00
Peter Wilson
0fcdd744c1 Plugins: Improve plugin_install_description filter's docs.
Refer developers to `plugins_api()` for array of plugin data.

Props afragen, pbiron, SergeyBiryukov, costdev.
Fixes #55480.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52917 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-02 02:46:11 +00:00
Peter Wilson
4a7bcc14e4 Users: Validate WP_User_Query's fields argument.
Improve validation of `WP_User_Query`'s `fields` argument when passed as an array to ensure it only accepts permitted values. This prevents the invalid values being included in the generated database query.

Expand unit tests to include passing invalid values as part of an array, the lower case value `id`. Correct earlier unit tests to limit database query to one result.

Follow up to [53255].

Props felipeelia.
Fixes #53177.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52916 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-02 00:14:29 +00:00
Sergey Biryukov
8267fdc9a2 Tests: Add unit tests for some XML-RPC functions:
* `xmlrpc_getposttitle()`
* `xmlrpc_getpostcategory()`
* `xmlrpc_removepostdata()`

Props pbearne, audrasjb, costdev, SergeyBiryukov.
Fixes #53490.
Built from https://develop.svn.wordpress.org/trunk@53326


git-svn-id: http://core.svn.wordpress.org/trunk@52915 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-02 00:13:12 +00:00
audrasjb
403f9d53f1 Coding standards: Remove extra spaces in docblocks of the Walker_PageDropdown class.
Follow-up to [51779].

See #54728.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52914 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-01 22:01:10 +00:00
audrasjb
df39328035 Docs: Clarify the name and description of some parameters in the Walker class.
Follow-up to [53323].
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52913 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-01 21:47:10 +00:00
audrasjb
9df9561ce9 Docs: Docblock adjustements in the Walker class.
This changeset ensures third-person singular verbs are used for function descriptions in the `Walker` class, and adjusts some non-standard docblock descriptions for various properties and methods of the class.

See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52912 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-01 21:41:12 +00:00
Sergey Biryukov
c36f700fda Coding Standards: Remove extra alignment level in the data provider for wp_validate_boolean() tests.
Follow-up to [46159], [46224], [52775], [52776], [52777].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52911 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-01 16:24:14 +00:00
Sergey Biryukov
83c7440590 Tests: Add unit tests for wp_fuzzy_number_match().
Props pbearne, costdev, mukesh27, hellofromTonya, SergeyBiryukov.
Fixes #54239.
Built from https://develop.svn.wordpress.org/trunk@53321


git-svn-id: http://core.svn.wordpress.org/trunk@52910 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-05-01 16:13:19 +00:00
Sergey Biryukov
7fd2f89da7 Tests: Ignore EOL differences in Webfonts API tests.
Unix vs. Windows EOL style mismatches can cause misleading failures in tests using the heredoc syntax (`<<<`) or multiline strings as the expected result.

Includes renaming the test class to match the [https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization naming conventions].

Follow-up to [46612], [48443], [48466], [49691], [51135], [53282].

See #54725.
Built from https://develop.svn.wordpress.org/trunk@53319


git-svn-id: http://core.svn.wordpress.org/trunk@52908 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-30 11:35:16 +00:00
John Blackbourn
bdaba2407c Docs: Improve documentation of the walker argument for various functions.
See #54729

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


git-svn-id: http://core.svn.wordpress.org/trunk@52907 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-29 19:28:09 +00:00
John Blackbourn
cd9aade1bd Docs: Formatting corrections for various docblocks.
See #54729

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


git-svn-id: http://core.svn.wordpress.org/trunk@52906 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-29 19:24:09 +00:00
John Blackbourn
beac9601fa Docs: Corrections and improvements to docblocks for function and hooks relating to fatal error handling.
See #54729

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


git-svn-id: http://core.svn.wordpress.org/trunk@52905 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-29 19:17:11 +00:00
John Blackbourn
98846baff8 REST API: Correct the schema for the wp/v2/block-directory/search endpoint.
Props zieladam, TimothyBlynJacobs, spacedmonkey, johnbillion

Fixes #53621

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


git-svn-id: http://core.svn.wordpress.org/trunk@52904 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-29 16:55:13 +00:00
Sergey Biryukov
0b930401e0 Docs: Adjust comments in Gruntfile.js per the documentation standards.
See #54729.
Built from https://develop.svn.wordpress.org/trunk@53314


git-svn-id: http://core.svn.wordpress.org/trunk@52903 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-29 14:46:11 +00:00
Sergey Biryukov
4fc2b46aa0 Docs: Further clarify a comment for the main part of wp-login.php.
Follow-up to [52945].

Fixes #54746.
Built from https://develop.svn.wordpress.org/trunk@53313


git-svn-id: http://core.svn.wordpress.org/trunk@52902 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-29 14:36:10 +00:00
gziolo
a972e8131f Editor: Fix core 'Featured' pattern category registration
Backports changes from https://github.com/WordPress/gutenberg/pull/40650.

Patch fixes regression, and moves core "Featured" pattern category registration from `_load_remote_featured_patterns` into `_register_core_block_patterns_and_categories`.

Follow-up [53152].
Props mamaduka, ntsekouras.
See #55567.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52901 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-29 14:10:09 +00:00
gziolo
6333a1d971 Tools: Further automate backporting from Gutenberg to Core
Follow-up for #51491.

Updating WordPress packages is currently a manual process that takes some reading and trial & error to figure out. This PR adds a single npm task called `sync-gutenberg-packages` that automates this entire process.

Props zieladam.
Fixes #55642.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52900 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-29 14:01:10 +00:00
Sergey Biryukov
3070806375 Docs: Remove double spaces in tests/phpunit/README.txt.
Props grandeljay.
Fixes #55637.
Built from https://develop.svn.wordpress.org/trunk@53310


git-svn-id: http://core.svn.wordpress.org/trunk@52899 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-29 13:33:09 +00:00
spacedmonkey
b00e2a0e89 Taxonomy: Increase cache hits in WP_Term_Query when using include and exclude parameters.
Ensure that empty values of include and exclude passed to the parameters of `WP_Term_Query`, reused existing caches by 
resetting values to an empty array. 

Props Spacedmonkey, peterwilsoncc, hellofromtonya.
Follow-up to [52970].
See #55352.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52898 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-29 12:36:13 +00:00
Peter Wilson
e9850e7225 Bundled Themes: Note visually hidden text for translators.
Indicate the use of screen reader only text in translator comments.

Props sabernhardt.
Fixes #55591.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52897 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-29 05:03:11 +00:00
Peter Wilson
ef8a32f6b9 Media: Validate track number ID3 tags before use.
Validate current and total track ID3 tags as numeric before use.

Props mjkhajeh, SergeyBiryukov, costdev.
Fixes #55204.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52896 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-29 04:50:12 +00:00
Peter Wilson
eebb76a64f Install: Prevent DB errors caused by web fonts API.
Bypass checking `theme.json` for web fonts during the installation of WordPress.

During installation the active theme is considered to be Twenty Twenty-Two (the default theme). As a block theme this prompts a database call when the web fonts API checks the `theme.json` settings, this triggers a database error during installation as the database tables do not exist.

Props chouby, costdev, peterwilsoncc, sergeybiryukov.
Fixes #55632.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52895 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-29 03:50:14 +00:00
Sergey Biryukov
8e29ebbc16 Docs: Make the @return tag for Translation_Entry::key() more precise.
Props manooweb.
Fixes #55640.
Built from https://develop.svn.wordpress.org/trunk@53305


git-svn-id: http://core.svn.wordpress.org/trunk@52894 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-28 16:53:09 +00:00
Sergey Biryukov
2334cea3e9 Bootstrap/Load: Move some more administration-related hooks to admin-filters.php.
Follow-up to [53266].

Fixes #54795.
Built from https://develop.svn.wordpress.org/trunk@53304


git-svn-id: http://core.svn.wordpress.org/trunk@52893 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-28 16:39:11 +00:00
Mike Schroder
d9266d5bfd Media: Ensure wp_read_image_metadata filter returns array for $iptc and $exif.
Makes the behavior of the filter lines up with its documentation.
Previously, both `$iptc` and `$exif` could return `false` when `exif_read_data()` or `iptcparse()` failed.

Now, if those functions do not return an array, the results are explicitly set to `array()`.

Props volodymyrkolesnykov, SergeyBiryukov, sabernhardt, sumitsingh, mikeschroder.
Fixes #54637.
Built from https://develop.svn.wordpress.org/trunk@53303


git-svn-id: http://core.svn.wordpress.org/trunk@52892 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-28 11:00:10 +00:00
John Blackbourn
c6dbcf8576 Docs: Various docblock corrections and improvements for changes introduced in 6.0.
See #54729

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


git-svn-id: http://core.svn.wordpress.org/trunk@52891 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-28 09:59:13 +00:00
John Blackbourn
13ed66ec88 Mail: Improve the docblocks for actions and functions related to the parsing of authentication cookies.
See #54729

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


git-svn-id: http://core.svn.wordpress.org/trunk@52890 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-28 09:54:16 +00:00
John Blackbourn
0d46464f83 Docs: Various docblock corrections.
See #54729

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


git-svn-id: http://core.svn.wordpress.org/trunk@52889 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-28 09:49:16 +00:00
John Blackbourn
6aa053dc01 Docs: Various docblock improvements.
See #54729

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


git-svn-id: http://core.svn.wordpress.org/trunk@52888 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-28 09:46:21 +00:00
Peter Wilson
4710282f33 Editor: Show comment previews in the Comment Query Loop.
Update `build_comment_query_vars_from_block()` to show previews of unmoderated comments to the original author of the comment. This duplicates the existing logic in `wp_list_comments()`.

Props darerodz, bernhard-reiter, czapla.
Fixes #55634.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52887 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-28 01:18:13 +00:00
desrosj
b4eb72f714 Build/Test Tools: Update the NPM dependencies to the latest versions.
This updates the following development dependencies:

- `@wordpress/scripts` from `22.4.2` to `22.5.0`.
- `chalk` from `4.1.2` to `5.0.1`.
- `grunt` from `1.4.1` to `1.5.2`.
- `grunt-contrib-clean` from ``2.0.0` to `2.0.1`.
- `grunt-contrib-uglify` from `5.1.0` to `5.2.1`.
- `qunit` from `2.18.1` to `2.18.2`.
- `sass` from `1.50.0` to `1.51.0`.
- `sinon` from `13.0.1` to `13.0.2`.
- `uglify-js` from `3.15.3` to `3.15.4`.

Fixes #54727.
Built from https://develop.svn.wordpress.org/trunk@53297


git-svn-id: http://core.svn.wordpress.org/trunk@52886 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-27 17:21:53 +00:00
desrosj
e942432883 External Libraries: Update the underscore library to version 1.13.3.
This is a minor bug fix release.

Fixes #55547.
Built from https://develop.svn.wordpress.org/trunk@53296


git-svn-id: http://core.svn.wordpress.org/trunk@52885 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-27 14:39:21 +00:00
desrosj
3ec9f00b1f Bundled Themes: Update NPM dependencies for default themes.
This updates all NPM dependencies for all default themes with a `package.json` file (Twenty Nineteen, Twenty Twenty, and Twenty Twenty-One) to their latest versions following the defined version constraints. `npm audit fix` has also been run for each theme.

These updates only resulted in minor changes within built files for Twenty Twenty-One.

See #54727.
Built from https://develop.svn.wordpress.org/trunk@53295


git-svn-id: http://core.svn.wordpress.org/trunk@52884 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-27 14:25:07 +00:00
Sergey Biryukov
6e9c29da06 Bootstrap/Load: Avoid a PHP warning when setting the $pagenow global in wp-includes/vars.php.
In some scenarios where `is_admin()` returns true but `$_SERVER['PHP_SELF']` does not match a `wp-admin/*` location, setting the `$pagenow` global could trigger a PHP warning: `Undefined array key 1`.

This commit avoids the warning by checking whether the matches array is not empty.

Props janh2, konradyoast, peterwilsoncc.
Fixes #54700.
Built from https://develop.svn.wordpress.org/trunk@53294


git-svn-id: http://core.svn.wordpress.org/trunk@52883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-27 13:47:11 +00:00
Peter Wilson
87c8ca71b5 Built tools: Reduce file size of About page texture.
Reduce the file size of the file `src/wp-admin/images/about-texture.png` by running it through the grunt precommit hook.

Other modified files are not included in this commit as there is no change in file size.

See #48703.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52882 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-27 05:37:08 +00:00
Peter Wilson
da0ce4038f Media: Ensure wp_crop_image() returns correct file type.
Return the correct file path from `wp_crop_image()` when a developer modifies the file type with via the `image_editor_output_format` filter.

Previously the function would return a broken file reference containing the original file extension rather than the one specified via the filter.

Props mat-lipe, adamsilverstein.
Fixes #55403.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-27 05:21:08 +00:00
Peter Wilson
75d1fab217 Comments: Avoid DB error in comment meta queries.
In `WP_Comment_Query` always include the table name when referencing `wp_comments.comment_ID`. This avoids ambiguity in when making meta queries as `wp_commentmeta` includes a column of the same name.

Follow up to [47887].

Props genosseeinhorn, azouamauriac, audrasjb, peterwilsoncc.
Fixes #55218.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52880 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-27 04:10:08 +00:00
Sergey Biryukov
a143b42349 Post WordPress 6.0 Beta 3 version bump.
Built from https://develop.svn.wordpress.org/trunk@53290


git-svn-id: http://core.svn.wordpress.org/trunk@52879 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 16:38:08 +00:00
Sergey Biryukov
24163597f7 WordPress 6.0 Beta 3.
Built from https://develop.svn.wordpress.org/trunk@53289


git-svn-id: http://core.svn.wordpress.org/trunk@52878 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 16:16:08 +00:00
hellofromTonya
8b50004388 Themes: Remove 'gutenberg' as translation context in _wp_theme_json_webfonts_handler().
Follow-up to [53282].

Props kebbet.

See #55567, #46370.
Built from https://develop.svn.wordpress.org/trunk@53288


git-svn-id: http://core.svn.wordpress.org/trunk@52877 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 15:37:09 +00:00
Sergey Biryukov
3c94881cd5 Code Modernization: Rename parameters that use reserved keywords in wp-includes/deprecated.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 `$display` in:
 * `the_category_ID()`
 * `get_author_link()`
 * `get_links()`
 * `get_category_rss_link()`
 * `get_author_rss_link()`
* Renames the `$string` parameter to `$text` in `wp_specialchars()`.
* Renames the `$string` parameter to `$message` in `debug_fwrite()`.
* Renames the `$string` parameter to `$content` in `wp_kses_js_entities()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270], [53271], [53272], [53273], [53274], [53275], [53276], [53277], [53281], [53283], [53284], [53285].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52876 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 15:28:07 +00:00
jffng
dac4e3be11 Twenty Twenty-Two: Add three style variations.
This commit adds three style variations to Twenty Twenty-Two, allowing users to quickly swap between different visual styles — "Blue", "Pink", and "Swiss" — for the default theme. The variations are previewed and selected from the Site Editor's global styles panel. 

For the implementation, each variation is defined by its own theme.json file within the "/styles" directory of the theme. All variations leverage the internal-only theme.json handler of the Webfonts API [53282] to load locally hosted fonts.

Props kjellr, hellofromtonya.
See #55433.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52875 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 15:26:11 +00:00
Sergey Biryukov
39b11dd1f7 Code Modernization: Rename parameters that use reserved keywords in wp-includes/comment-template.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 `$class` parameter to `$css_class` in `comment_class()` and `get_comment_class()`.
* Renames the `$echo` parameter to `$display` in `comment_class()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270], [53271], [53272], [53273], [53274], [53275], [53276], [53277], [53281], [53283], [53284].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52874 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 15:08:16 +00:00
Sergey Biryukov
9134afa220 Code Modernization: Rename parameters that use reserved keywords in wp-includes/class.wp-styles.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 `$display` in `WP_Styles` class methods.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270], [53271], [53272], [53273], [53274], [53275], [53276], [53277], [53281], [53283].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52873 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 14:59:08 +00:00
Sergey Biryukov
6cdf9f1c86 Code Modernization: Rename parameters that use reserved keywords in wp-includes/class.wp-scripts.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 `$display` in `WP_Scripts` class methods.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270], [53271], [53272], [53273], [53274], [53275], [53276], [53277], [53281].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52872 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 14:56:08 +00:00
hellofromTonya
053b9bbd71 Themes: Add internal-only theme.json's webfonts handler (stopgap).
Adds `_wp_theme_json_webfonts_handler()` for handling `fontFace` declarations in a theme's `theme.json` file to generate the `@font-face` styles for both the editor and front-end.

Design notes:
* It is not a public API, but rather an internal, Core-only handler.
* It is a stopgap implementation that will be replaced when the public Webfonts API is introduced in Core.
* The code design is intentional, albeit funky, with the purpose of avoiding backwards-compatibility issues when the public Webfonts API is introduced in Core.
   * It hides the inter-workings.
   * Does not exposing API ins and outs for external consumption.
   * Only works for `theme.json`.
   * Does not provide registration or enqueuing access for plugins.

For more context on the decision to include this stopgap and the Webfonts API, see:
* Core's PR 40493 https://github.com/WordPress/gutenberg/pull/40493
* Gutenberg's tracking issue 40472 https://github.com/WordPress/gutenberg/issues/40472

Props aristath, hellofromTonya, peterwilsoncc, costdev, jffng, zieladam, gziolo, bph, jonoaldersonwp, desrosj.

See #55567, #46370.
Built from https://develop.svn.wordpress.org/trunk@53282


git-svn-id: http://core.svn.wordpress.org/trunk@52871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 14:48:09 +00:00
Sergey Biryukov
a7b2ae76c1 Code Modernization: Rename parameters that use reserved keywords in wp-includes/class-wp-query.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 `$list` parameter to `$status` in `WP_Dependencies::query()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270], [53271], [53272], [53273], [53274], [53275], [53276], [53277].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52870 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 14:28:08 +00:00
Sergey Biryukov
69be4c73ff Docs: Add missing documentation for WP_*_Query::get_search_sql() method parameters.
Includes renaming the `$cols` parameter to `$columns` for consistency across the classes.

Follow-up to [42876], [53272-53276].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52869 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 14:04:10 +00:00
Sergey Biryukov
5ac4bf5ec6 Docs: Correct alignment for the customize_nav_menu_available_items filter DocBlock.
Follow-up to [53245].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 13:44:15 +00:00
gziolo
b9f396743c Editor: Update WordPress packages for 6.0 Beta 3
Included cherry-picked commits from the Gutenberg plugin that fix bugs discovere after WordPress 6.0 Beta 2.

Props zieladam, ndiego.
See #55567.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52867 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 13:42:07 +00:00
Sergey Biryukov
cc6dcc2623 Code Modernization: Rename parameters that use reserved keywords in wp-includes/class-wp-query.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 `$array` parameter to `$query_vars` in `WP_Query::fill_query_vars()`.
* Renames the `$default` parameter to `$default_value` in `WP_Query::get()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270], [53271], [53272], [53273], [53274], [53275], [53276].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52866 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 13:32:11 +00:00
Sergey Biryukov
901dae255d Code Modernization: Rename parameters that use reserved keywords in wp-includes/class-wp-user-query.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 `$search` in `WP_User_Query::get_search_sql()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270], [53271], [53272], [53273], [53274], [53275].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52865 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 11:47:26 +00:00
Sergey Biryukov
1c5a65884a Code Modernization: Rename parameters that use reserved keywords in wp-includes/class-wp-term-query.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 `$search` in `WP_Term_Query::get_search_sql()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270], [53271], [53272], [53273], [53274].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52864 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 11:46:18 +00:00
Sergey Biryukov
e333f174de Code Modernization: Rename parameters that use reserved keywords in wp-includes/class-wp-site-query.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 `$search` in `WP_Site_Query::get_search_sql()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270], [53271], [53272], [53273].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52863 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 11:44:15 +00:00
Sergey Biryukov
27eff4bd87 Code Modernization: Rename parameters that use reserved keywords in wp-includes/class-wp-network-query.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 `$search` in `WP_Network_Query::get_search_sql()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270], [53271], [53272].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52862 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 11:43:07 +00:00
Sergey Biryukov
84e3a59385 Code Modernization: Rename parameters that use reserved keywords in wp-includes/class-wp-comment-query.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 `$search` in `WP_Comment_Query::get_search_sql()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270], [53271].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52861 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 11:41:10 +00:00
Sergey Biryukov
adec401ff7 Code Modernization: Rename parameters that use reserved keywords in wp-includes/class-wp-image-editor.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 `$function` parameter to `$callback` in `WP_Image_Editor::make_image()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52860 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 11:31:07 +00:00
Sergey Biryukov
f5f05eb2cc Code Modernization: Rename parameters that use reserved keywords in wp-includes/class-wp-image-editor-gd.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 `$function` parameter to `$callback` in `WP_Image_Editor_GD::make_image()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52859 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 11:25:08 +00:00
Sergey Biryukov
bbf6ffb769 Code Modernization: Rename parameters that use reserved keywords in wp-includes/class-wp-embed.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 `$match` parameter to `$matches` in `WP_Embed::autoembed_callback()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52858 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 10:00:09 +00:00
gziolo
1dabd8df68 Editor: Register 'lock' attribute for every block on the server
Backports changes from https://github.com/WordPress/gutenberg/pull/40468.

The lock attribute needs to be supported by every block, but currently, it is only done on the client site. As a result, it was causing block rendered API requests to fail when blocks are locked.

Props mamaduka, peterwilsoncc.
See #55567.



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


git-svn-id: http://core.svn.wordpress.org/trunk@52857 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 09:50:12 +00:00
audrasjb
22de3f7711 Widgets: Fix Classic Widgets screen toggle response on small screens.
This changeset updates the toogle logic to fix Widget's responsive behavior on Classic Widgets screen.

Props inc2734, kmix39, dlh, desrosj, costdev, Boniu91.
Fixes #48896.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52856 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 06:54:09 +00:00
audrasjb
813c4d604c Bootstrap/load: Move administration related hooks to admin-filters.php.
This change moves some administration related hooks from `default-filters.php` to `admin-filters.php`. It also updates the `default-filters.php` docblock to indicate that contextualized hooks should be located in the most appropriate place.

Props dlh, hellofromTonya, antonvlasenko, audrasjb, azaozz.
Fixes #54795.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52855 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 06:32:08 +00:00
audrasjb
29cc1e94c0 Docs: Use third-person singular verbs for function descriptions in Core Comment API and Comment template functions.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52854 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 06:20:08 +00:00
Peter Wilson
e9610a5d20 Administration: Trigger a notice for incorrect add_menu_page() parameter.
Trigger a notice (via `_doing_it_wrong()`) for developers incorrectly setting the position when calling `add_menu_page()`.

Modify a similar message in `add_submenu_page()` to combine near identical strings and match the error description to the conditions in which it is called.

Follow up to [52569], [53104].

Fixes #40927.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52853 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 02:59:08 +00:00
davidbaumwald
df148d90fc Twenty Twenty-One: Make translator comments referencing the post title consistent.
Follow-up to [53221].

Props SergeyBiryukov.
Fixes #55564.
Built from https://develop.svn.wordpress.org/trunk@53263


git-svn-id: http://core.svn.wordpress.org/trunk@52852 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 23:11:10 +00:00
gziolo
77c9ef30d7 Build: Update the constant used to remove experimental Gutenberg code
We missed the change for blocks that got applied to packages. `process.env.GUTENBERG_PHASE` got renamed to `process.env.IS_GUTENBERG_PLUGIN`.

See #55567.
Follow-up for [53157].


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


git-svn-id: http://core.svn.wordpress.org/trunk@52851 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 17:03:10 +00:00
gziolo
19d31e1b42 Tests: Update Gallery block unit tests to new gallery format
The Gallery block unit tests still use the old format, so this updates it to the new format that uses nested Image blocks.

Props glendaviesnz.
Fixes #55571.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52850 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 16:57:10 +00:00
gziolo
32bbe9b0b9 Editor: Fix styles for nested elements (link color)
This fixes an issue by which link color behaves differently in the editor and front end.

Related Gutenberg PR: https://github.com/WordPress/gutenberg/pull/37728.

Props oandregal.
See #55567.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52849 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 16:37:08 +00:00
gziolo
287662fca1 Editor: Add default comment status to discussion settings
This is a backport that exposes the default_comments_status option in the Editor, under the discussion settings, which then is then used by the Post Comments and Post Comments Form blocks.

Related change in Gutenberg: https://github.com/WordPress/gutenberg/pull/40484.

Props luisherranz.
See #55567.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52848 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 16:16:10 +00:00
gziolo
f7dde1e53a Tests: Add missing unit tests to Comment Template block
Follow-up for [53138], [53172].
Props darerodz.
See #55567.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52847 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 16:12:09 +00:00
Sergey Biryukov
5097c83eac Code Modernization: Rename parameters that use reserved keywords in wp-includes/class-wp-customize-widgets.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_Customize_Widgets` class methods.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52846 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 13:29:09 +00:00
audrasjb
8f93e5f2dd Docs: Use third-person singular verbs for function descriptions in WP_User_Query Class, as per docs standards.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52845 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 13:05:10 +00:00
audrasjb
120f9b9eae Users: Make sure WP_User_Query can be filtered using the fields parameter.
This change ensures the `fields` parameter is taken into account when running `WP_User_Query` by fixing the conditional statement used to process the `fields` param.

Props rilwis, peterwilsoncc, NomNom99, hellofromTonya, audrasjb, rilwis, Boniu91.
Fixes #53177.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52844 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 12:57:09 +00:00
audrasjb
a74d3ede67 Docs: Use third-person singular verbs for function descriptions in WP_Theme Class, as per docs standards.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52843 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 09:54:07 +00:00
audrasjb
50050b2f59 Themes: Ensure WP_Theme::get_files() doesn't return unexpected values.
This change filters out empty entries from `WP_Theme::get_files()` before returning the array of files. This avoid returning an entry with `false` value when the directory of the theme does not exist.

Props dd32, opurockey, Rahmohn, audrasjb.
Fixes #53599.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52842 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 09:46:08 +00:00
audrasjb
2c0a330fba Docs: Use third-person singular verbs for function descriptions in wp-includes/nav-menu.php, as per docs standards.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52841 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 09:32:09 +00:00
audrasjb
dc8a2658e4 Docs: Typo correction in wp-includes/ms-functions.php docblock.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52840 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 09:25:09 +00:00
audrasjb
baf41c1fb9 Docs: Use third-person singular verbs for function descriptions in wp-includes/ms-load.php, as per docs standards.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 09:22:15 +00:00
audrasjb
5d93f8d388 Docs: Use third-person singular verbs for function descriptions in wp-includes/capabilities.php, as per docs standards.
Props azouamauriac.
See #54729.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52838 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-24 21:32:06 +00:00
audrasjb
365afa3b9c Docs: Use third-person singular verbs for function descriptions in Multisite WordPress API, as per docs standards.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52837 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-24 21:28:07 +00:00
audrasjb
9564a68697 Twenty Fifteen: Use #page height instead of body height in sidebar scroll calculation.
This changeset replaces `bodyHeight = $body.height();` with `bodyHeight = $('#page).height();`. It fixes a JS issue in some specific context, when there is content generated right before the closing `body` tag. For example, this happens when the HTML content is added using the `wp_footer` filter.

Props stephenharris, sabernhardt, audrasjb.
Fixes #40492.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52836 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-24 21:03:10 +00:00
Sergey Biryukov
8ca3012db9 Code Modernization: Rename parameters that use reserved keywords in swp-includes/class-wp-customize-setting.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_Customize_Setting` class methods.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52835 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-24 00:28:08 +00:00
Sergey Biryukov
ccde5b8bd3 Code Modernization: Rename parameters that use reserved keywords in wp-includes/class-wp-customize-nav-menus.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 `$type` and `$object` parameters to `$object_type` and `$object_name` in `WP_Customize_Nav_Menus::load_available_items_query()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52834 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-23 20:59:10 +00:00
Sergey Biryukov
af5365ff02 Docs: Correct the expected parameter type for WP_Customize_Manager::remove_preview_signature().
Before the method was deprecated, the parameter contained the value passed through for the `wp_die_handler` filter, which expects a callable function. 

Follow-up to [20926], [32535], [34320], [38810], [53242], [53243].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52833 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-22 10:56:13 +00:00
Sergey Biryukov
752429a58e Code Modernization: Rename parameters that use reserved keywords in wp_die_*_handler filters.
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 `$function` parameter to `$callback` in `wp_die_*_handler` filters, which aims to make it easier to use a non-reserved parameter name for anyone utilizing these filters.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52832 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-22 10:43:20 +00:00
Sergey Biryukov
2bc70fc658 Code Modernization: Rename parameters that use reserved keywords in wp-includes/class-wp-customize-manager.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_Customize_Manager::post_value()`.
* Renames the `$return` parameter to `$callback` in `WP_Customize_Manager::remove_preview_signature()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52831 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-22 10:31:15 +00:00
audrasjb
2b25ad7c7b Build/Test Tools: Typo correction in rss2 unit tests.
Follow-up to [53233].

Props SergeyBiryukov.
Fixes #47968.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52830 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-21 23:13:12 +00:00
Sergey Biryukov
01a28c0031 Code Modernization: Rename parameters that use reserved keywords in wp-includes/block-supports/border.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_has_border_feature_support()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52829 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-21 21:05:11 +00:00
Sergey Biryukov
88b6ade46a Code Modernization: Rename parameters that use reserved keywords in wp-includes/atomlib.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 `$content` in `AtomParser::xml_escape()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52828 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-21 11:24:17 +00:00
Peter Wilson
7082f4dc84 Posts, Post Types: Fix option validation in stick_post().
Normalize an invalid `sticky_posts` option to an empty array within `stick_post()`. This fixes a bug in which an unexpected option value would prevent new posts from being made sticky.

Follow up to [50380].

Props azouamauriac, denishua, kajalgohel, sergeybiryukov, costdev.
Fixes #55176.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52827 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-21 06:04:15 +00:00
Peter Wilson
7821c369eb Tests, Build Tools: Improve version compatibility tests.
Improve tests for `is_wp_version_compatible()` and `is_php_version_compatible()`.

Follow up to [53227].

Props costdev, SergeyBiryukov.
Fixes #54257.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52826 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-21 01:02:14 +00:00
Sergey Biryukov
89f24e9c61 Code Modernization: Rename parameters that use reserved keywords in bundled themes.
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 `$class` parameter to `$css_class` in:
 * `twentysixteen_excerpt()`
 * `twentynineteen_post_classes()`
* Renames the `$echo` parameter to `$display` in:
 * `twentythirteen_entry_date()`
 * `twentytwenty_generate_css()`
 * `twentytwenty_site_logo()`
 * `twentytwenty_site_description()`
 * `twenty_twenty_one_generate_css()`

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 14:24:12 +00:00
audrasjb
6ef5625ac2 Docs: Docs: Use third-person singular verbs for function descriptions in wp-includes/blocks.php and wp-includes/script-loader.php, per the documentation standards.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52824 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 14:09:11 +00:00
audrasjb
4d3dbe477a Editor: Move wp_enqueue_block_style() to wp-includes/script-loader.php, for better consistency.
As a result of [52741] and [52743], `wp_enqueue_block_support_styles()` was moved to `wp-includes/script-loader.php`. However, `wp_enqueue_block_style()` was still defined in `wp-includes/blocks.php`. This changeset also moves `wp_enqueue_block_support_styles()` to `wp-includes/script-loader.php` for better consistency.

Follow-up to [52741], [52743].

Props SergeyBiryukov, mukesh27, audrasjb.
Fixes #55182.
See #55148.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52823 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 13:53:16 +00:00
audrasjb
943e956379 Feeds: Use latest comment date for the Last-Modified header of comments feed.
Previously, the `Last-Modified` header of comments feed was using the date/time of the last comment. This behavior was breaking caching and causing feed readers to believe there is no new content even when there might be new posts.

This commit changes this behavior to use the newest date from both `get_lastcommentmodified()` and `get_lastpostmodified()` functions instead of only using the result from `get_lastcommentmodified()`.

Props xiven, mauteri, costdev, audrasjb.
Fixes #47968.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52822 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 12:47:11 +00:00
Sergey Biryukov
0cc2cb34cd Code Modernization: Rename parameters that use reserved keywords in wp-admin/install-helper.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 `check_column()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52821 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 11:19:12 +00:00
Sergey Biryukov
5fad544f8d Tests: Update the test for wp_install() signature.
Follow-up to [53230].

See #55327.
Built from https://develop.svn.wordpress.org/trunk@53231


git-svn-id: http://core.svn.wordpress.org/trunk@52820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 11:06:07 +00:00
Sergey Biryukov
91ad9dbb07 Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/upgrade.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 `$public` parameter to `$is_public` in `wp_install()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52819 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 10:46:09 +00:00
audrasjb
3d7603869b Docs: Misc fixes and improvements in the Administration Media API docblocks, as per documentation standards.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 08:29:08 +00:00
audrasjb
aab2815d58 Media: Remove attachment_fields_to_save filter and deprecate image_attachment_fields_to_save().
This filter prevented removing attachment titles. This changeset removes the filter and deprecates the related function since it is no longer used.

Props dromero20, desrosj, Junaidkbr, francina, antpb, audrasjb, aadilali, etaproducto, azouamauriac, Boniu91, SergeyBiryukov.
Fixes #39108.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52817 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 08:13:10 +00:00
Peter Wilson
eeedcfac4b Build, Test Tools: Test PHP and WP compatibility functions.
Introduce tests for `is_php_version_compatible()` and `is_wp_version_compatible()`.

Props pbearne, hellofromTonya, mikeschroder, peterwilsoncc, toro_unit.
Fixes #54257.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52816 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 06:01:09 +00:00
Peter Wilson
1b5dd9b426 Autosave: Compare heartbeat intervals in same unit.
Move the conversion of `minimalInterval` to milliseconds to be grouped with the other time conversions from seconds to milliseconds.

This fixes a bug in which the minimal and main intervals were compared after the former had been converted to milliseconds but the latter had not. This could cause the heatbeat interval to blow out to unexpectedly high values if the minimal interval was set.

Props tabrisrp, sabernhardt, SergeyBiryukov, audrasjb.
Fixes #54825.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52815 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 05:55:06 +00:00
Peter Wilson
40942c2695 Comments: Improve accuracy of get_comment_count() docblock.
Remove reference to uncached database query now `get_comment_count()` uses `WP_Comment_Query` which contains caching. Remove reference to `$wpdb` global, it is no longer used.

Follow up to [53036].

Fixes #19901.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52814 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 05:53:11 +00:00
Sergey Biryukov
8aef26cfe3 Post WordPress 6.0 Beta 2 version bump.
Built from https://develop.svn.wordpress.org/trunk@53224


git-svn-id: http://core.svn.wordpress.org/trunk@52813 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 16:41:08 +00:00
Sergey Biryukov
70fc105ce0 WordPress 6.0 Beta 2.
Built from https://develop.svn.wordpress.org/trunk@53223


git-svn-id: http://core.svn.wordpress.org/trunk@52812 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 16:14:10 +00:00
Sergey Biryukov
eeb9f68181 Menus: Use correct parameter in _wp_nav_menu_meta_box_object().
Follow-up to [53220].

Props davidbaumwald.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53222


git-svn-id: http://core.svn.wordpress.org/trunk@52811 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 15:59:10 +00:00
davidbaumwald
5892153992 Twenty Twenty-One: Correct translator comment in twenty_twenty_one_continue_reading_text.
This commit updates the translator comment in `twenty_twenty_one_continue_reading_text` to indicate that the text is visually hidden.  This change also corrects the comment above the `the_content_more_link` filter to reference the content, not the excerpt.

Props sabernhardt, costdev.
Fixes #55564.
Built from https://develop.svn.wordpress.org/trunk@53221


git-svn-id: http://core.svn.wordpress.org/trunk@52810 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 15:23:11 +00:00
Sergey Biryukov
9ce061ae8c Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/template.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 `$display` in:
 * `wp_popular_terms_checklist()`
 * `_post_states()`
 * `_media_states()`
* Renames the `$default` parameter to `$default_term` in `wp_popular_terms_checklist()`.
* Renames the `$default` parameter to `$default_template` in `page_template_dropdown()`.
* Renames the `$default` parameter to `$default_page` in `parent_dropdown()`.
* Renames the `$object` parameter to `$data_object` in:
 * `do_block_editor_incompatible_meta_box()`
 * `do_meta_boxes()`
 * `do_accordion_sections()`
* Amends the `$item_object` parameter in other functions for consistency:
 * `wp_nav_menu_item_post_type_meta_box()`
 * `wp_nav_menu_item_taxonomy_meta_box()`
 * `_wp_nav_menu_meta_box_object()`

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52809 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 15:13:08 +00:00
gziolo
6aead54d17 Editor: Update WordPress packages for 6.0 Beta 2
Included cherry-picked commits from the Gutenberg plugin that fix bugs discovered after WordPress 6.0 Beta 1.

Props zieladam, ndiego.
See #55567.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52808 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 15:11:17 +00:00
gziolo
c795115b0a REST API: Add array argument to getItems for Pattern Directory endopoint
Since http://api.wordpress.org/patterns API supports array parameters, there is no need to implode slug values inside the _register_remote_theme_patterns function.
Both WP_REST_Pattern_Directory_Controller and _register_remote_theme_patternsmust be updated to support array request arguments.

Props antonvlasenko.
Fixes #55574.
Follow-up #55505, [53152].



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


git-svn-id: http://core.svn.wordpress.org/trunk@52807 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 14:58:09 +00:00
gziolo
d2e9cf1f81 REST API: Respect _fields query arg in preloaded requests
Ensures that preloaded request can include a `_fields` query param that asks that only selected response fields are returned.

Props jsnajdr, timothyblynjacobs. 
Fixes #55213.
See #55567.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52806 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 14:40:09 +00:00
Sergey Biryukov
05d12bfa4c Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/taxonomy.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 `$parent` parameter to `$category_parent` in `category_exists()` and `wp_create_category()`. This matches the category object property of the same name.
* Amends similar parameters in `dropdown_categories()` and `wp_dropdown_cats()` for consistency.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52805 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 13:51:08 +00:00
Sergey Biryukov
90cbd98c6b Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/plugin.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 `$function` parameter to `$callback` in:
 * `add_menu_page()`
 * `add_submenu_page()`
 * `add_management_page()`
 * `add_options_page()`
 * `add_theme_page()`
 * `add_plugins_page()`
 * `add_users_page()`
 * `add_dashboard_page()`
 * `add_posts_page()`
 * `add_media_page()`
 * `add_links_page()`
 * `add_pages_page()`
 * `add_comments_page()`
* Renames the `$echo` parameter to `$display` in `menu_page_url()`.
* Renames the `$parent` parameter to `$parent_page` in `get_admin_page_parent()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52804 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 12:48:08 +00:00
gziolo
ec0574144a Editor: Fix Comment Query block isn't lazy loading meta data
Related GitHub issue: https://github.com/WordPress/gutenberg/issues/40241.
Primes comment meta data cache within calls to WP_Comment_Query.

Props peterwilsoncc, cbravobernal.
See #55567.
Follow-up [53138].



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


git-svn-id: http://core.svn.wordpress.org/trunk@52803 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 12:39:09 +00:00
gziolo
5cc972ba4a Editor: Include the PHP file for the Cover block
This file is copied by the build process but it also needs to be versioned so unit tests can run without issues.

Follow-up [53212].
See #55580.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52802 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 11:51:07 +00:00
gziolo
87207e9ca5 Editor: Correctly register the dynamic Cover block
The new "Featured Image" enhancement is handled dynamically, so we need to update how the Cover block is handled in the build processa and registered in the code.

Props ironprogrammer, costdev, Mamaduka, chaion07.
Fixes #55580.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 11:37:12 +00:00
gziolo
83aed3ea4f Code Quality: Fix reported undefined $script_uri variable notice
The code editor reported this issue while mamduka was browsing the blocks.php file. PHP considers variables undefined until a value is assigned (or the global keyword is used).

Follow-up for [53091].
Props mamaduka, peterwilsoncc.
See 55567.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52800 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 09:58:07 +00:00
gziolo
fba03a16ca REST API: Add inserter field to the schema of Patterns endpoint
Backports changes from https://github.com/WordPress/gutenberg/pull/40416. Adds the missing `inserter` field to the Patterns item schema. This field was omitted from the response, and patterns that should be hidden in the inserter were visible.

Props mamaduka, ndiego.
See #55567.
Follow-up [53152].



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


git-svn-id: http://core.svn.wordpress.org/trunk@52799 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 09:41:09 +00:00
gziolo
09688edc45 REST API: Don't load remote patterns twice in the controller
This PR aims to fix an issue with fetching remote patterns multiple times inside the WP_REST_Block_Patterns_Controller::get_items method.

Follow-up [53152].

Props antonvlasenko.
See #55567.



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


git-svn-id: http://core.svn.wordpress.org/trunk@52798 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 09:28:12 +00:00
jorgefilipecosta
0559e94375 Block editor: Prevent styles from being added in the site editor.
The site editor, unlike other editors, generates the styles coming from global styles (presets, styles) dynamically in the client. This is because the user can modify any value that we need to consolidate (merge core, theme, and user style preferences). We don't want to have the global styles twice, as it introduces subtle bugs.

Props oandregal, youknowriad.
See #55567.
Built from https://develop.svn.wordpress.org/trunk@53208


git-svn-id: http://core.svn.wordpress.org/trunk@52797 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-18 17:12:07 +00:00
Sergey Biryukov
c4c4edccc0 Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/nav-menu.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 `$display` in `wp_nav_menu_disabled_check()`.
* Renames the `$object` parameter to `$item_object` in:
 * `wp_nav_menu_item_post_type_meta_box()`
 * `wp_nav_menu_item_taxonomy_meta_box()`
 * `_wp_nav_menu_meta_box_object()`

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52796 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-18 15:22:08 +00:00
audrasjb
57fba4946f Docs: Replace Codex links with the corresponding page on DevHub.
The Codex page for `WP_Object_Cache` already redirects to the corresponding DevHub page.

See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52795 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-18 15:08:09 +00:00
audrasjb
3b2c1e5629 Docs: Update a link to the Custom Elements spec in unsupported_valid_tag_names() unit test docblock.
This changeset replaces a link to the outdated W3C specs on Custom Elements with a link to the corresponding WhatWG specification.

Follow-up to [53204].

See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52794 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-18 14:43:08 +00:00
audrasjb
eca9278a10 Docs: Update a link to the Custom Elements spec in force_balance_tags() docblock.
This changeset replaces a link to the outdated W3C specs on Custom Elements with a link to the corresponding WhatWG specification.

See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52793 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-18 14:35:07 +00:00
Sergey Biryukov
f53b215bfe Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/ms.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 `$display_message` in `upload_is_user_over_quota()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-18 10:33:09 +00:00
audrasjb
b6c2df9325 Docs: Update MDN link in send_frame_options_header() docblock.
The X-Frame-Options MDN documentation has been moved to `/docs/Web/HTTP/Headers/X-Frame-Options`. This changeset updates the link accordingly.

See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52791 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-18 10:18:10 +00:00
Sergey Biryukov
99de4aea45 Docs: Use third-person singular verbs for function descriptions in wp-admin/includes/meta-boxes.php, per the documentation standards.
See #54729.
Built from https://develop.svn.wordpress.org/trunk@53201


git-svn-id: http://core.svn.wordpress.org/trunk@52790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-17 17:57:09 +00:00
Sergey Biryukov
9043ef83ef Docs: Add missing descriptions for function parameters in wp-admin/includes/meta-boxes.php.
See #54729.
Built from https://develop.svn.wordpress.org/trunk@53200


git-svn-id: http://core.svn.wordpress.org/trunk@52789 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-17 17:47:13 +00:00
Sergey Biryukov
6c36a0867d Coding Standards: Simplify long conditions in xfn_check().
Add some comments for clarity.

Follow-up to [2051], [4990], [53198].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52788 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-17 17:26:08 +00:00
Sergey Biryukov
447bd92f5d Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/meta-boxes.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 `$class` parameter to `$xfn_relationship` in `xfn_check()`.
* Renames the `$value` parameter to `$xfn_value` for clarity.
* Includes minor code layout changes for better readability.

Reference: [http://gmpg.org/xfn/join XFN: Getting Started].

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52787 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-17 15:37:09 +00:00
Sergey Biryukov
e0d13f8b59 Coding Standards: Correct alignment in various files.
This fixes an `Array double arrow not aligned correctly` WPCS warning.

Follow-up to [53075], [53084], [53091], [53094], [53155], [53129].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52786 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-17 15:07:08 +00:00
Sergey Biryukov
8a6d7ea5ac Coding Standards: Correct the $items_count variable in add_menu_classes().
Follow-up to [53195].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52785 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-17 14:44:07 +00:00
Sergey Biryukov
b32080c332 Coding Standards: Use more descriptive variable names in add_menu_classes().
Follow-up to [9578], [53193], [53194].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52784 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-17 14:41:08 +00:00
Sergey Biryukov
a30a1efac4 Docs: Add missing documentation for add_cssclass() and add_menu_classes().
Follow-up to [9578], [53193].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52783 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-17 14:30:13 +00:00
Sergey Biryukov
f6b7a1fd7a Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/menu.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 `$class` parameter to `$classes` in `add_cssclass()`.
* Renames the `$add` parameter to `$class_to_add` for clarity.
* Includes minor code layout changes for better readability. 

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52782 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-17 14:10:07 +00:00
Sergey Biryukov
88cce3c705 Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/media.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` parameter to `$return_type` in `media_sideload_image()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52781 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-17 10:51:10 +00:00
audrasjb
9998c01dca Themes: Use consistent thumbnail sizes in Customizer preview screen.
This ensures displaying theme thumbnails in consistent sizes in Customizer theme preview.

Props poena, karpstrucking, costdev, audrasjb.
Fixes #54188.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52780 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-16 06:15:09 +00:00
Sergey Biryukov
36708d062c I18N: Move code out of a translatable string in WP_Theme::__construct().
Props kapilpaul, azouamauriac, SergeyBiryukov.
Fixes #55405.
Built from https://develop.svn.wordpress.org/trunk@53190


git-svn-id: http://core.svn.wordpress.org/trunk@52779 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-16 00:30:11 +00:00
audrasjb
407e802048 Docs: Use third-person singular verbs for function descriptions in author-template.php, as per documentation standards.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52778 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-15 15:14:09 +00:00
audrasjb
6d0458e78c Docs: Fix a docblock typo in get_the_modified_author.
Follow-up to [53187].

See #55420.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52777 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-15 13:55:10 +00:00
audrasjb
ed59d4f043 Users: Avoid warning on the_modified_author when get_userdata() returns false.
This change adds a check of the value returned by `get_userdata()` before using it in `get_the_modified_author()`. It avoids a warning when retrieving the last author who edited the current post.

Props juanlopez4691, mukesh27.
Fixes #55420.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52776 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-15 13:47:12 +00:00
audrasjb
f087315090 Text Changes: Fix various inconsistent capitalization issues.
Props Presskopp, arpitgshah, mukesh27, desrosj, audrasjb, marybaum.
Fixes #53028.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52775 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-15 11:58:10 +00:00
Sergey Biryukov
ad5deed830 Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/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 `$class` parameter to `$class_name` in `_get_list_table()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52774 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-15 10:52:11 +00:00
Sergey Biryukov
e86b90cad6 Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/deprecated.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` and `$parent` parameters to `$default_category` and `$parent_category` in `dropdown_categories()`.
* Renames the `$default` parameter to `$default_link_category` in `dropdown_link_categories()`.
* Renames the `$parent` parameter to `$parent_cat` and some other parameters for consistency in `wp_dropdown_cats()`.
* Renames the `$function` to `$callback` in `add_object_page()` and `add_utility_page()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52773 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-14 15:26:09 +00:00
Sergey Biryukov
9a9617ea72 Coding Standards: Rename the $object variable to $attachment in several files.
This brings some consistency with a similar fragment in `Custom_Image_Heade::step_2_manage_upload()`, `WP_Site_Icon::insert_attachment()`, `media_handle_upload()`, and clarifies the type of the data.

Follow-up to [52946], [53137].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52772 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-14 15:15:12 +00:00
audrasjb
c57fd8ae09 Help/about: Improve text in help tabs of the Personal Data Exporter/Eraser.
This change clarifies the purpose of the personal data exporter/eraser tool in the related help tab.

Props dimadin, peterwilsoncc, audrasjb, marybaum, webcommsat, azaozz, paapst, desrosj.
Fixes #52970.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-14 14:46:07 +00:00
audrasjb
80aea1734c Plugins: Avoid translating empty plugin headers.
This change aims to avoid unnecessarily translating empty strings from plugin headers, by removing empty fields from translation process in `_get_plugin_data_markup_translate()`.

Props Chouby, johnbillion, audrasjb.
Fixes #54586.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52770 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-14 13:26:12 +00:00
audrasjb
44e4439d68 Docs: Removes an irrelevant @link mention in Translation_Entry Class.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-14 09:18:08 +00:00
audrasjb
c5a34f9397 Docs: Misc. Docblocks improvements in the Core User API.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52768 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-14 07:08:08 +00:00
audrasjb
050a2947cf Users: Update parameters passed to the new send_retrieve_password_email and retrieve_password_notification_email filters.
For consistency with some similar filters like `send_password_change_email` or `send_email_change_email`, and for more flexibility, pass `$user_login` and `$user_data` parameters directly to the new `send_retrieve_password_email` and `retrieve_password_notification_email` filters.

Follow-up to [52604], [52605], [52606], [52607].

Props SergeyBiryukov, costdev, peterwilsoncc.
Fixes #54690.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52767 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-14 06:24:10 +00:00
audrasjb
ecce0c2f57 Docs: Small fixes in WP_Theme_JSON_Resolver docblocks, as per documentation standards.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52766 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-14 06:15:09 +00:00
audrasjb
39052a81e6 Docs: Fix @link URLs in get_merged_data() Docblock.
This addresses some 404s found on Helphub links by replacing the related `@link` sources.

See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52765 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-14 06:05:11 +00:00
Sergey Biryukov
ed4829b0ee Query: Restore late compact() call for SQL clauses in wp-includes/class-wp-*-query.php.
This addresses a backward compatibility break where `posts_groupby` and other filters were applied, but their results were subsequently discarded and earlier values were used instead.

Follow-up to [52974].

Props nextend_ramona.
See #54728, #meta6273.
Built from https://develop.svn.wordpress.org/trunk@53175


git-svn-id: http://core.svn.wordpress.org/trunk@52764 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-14 00:04:11 +00:00
Sergey Biryukov
c6a5a33e54 Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/class-wp-terms-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 `$parent` parameter to `$parent_term` in `WP_Terms_List_Table::_rows()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52763 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-13 16:14:10 +00:00
desrosj
f448f54be5 Script Loader: Specify the version of the clipboard library included when registering.
For external libraries, the current version included with WordPress should be specified when registering scripts.

Props elifvish.
Fixes #55565.
Built from https://develop.svn.wordpress.org/trunk@53173


git-svn-id: http://core.svn.wordpress.org/trunk@52762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-13 15:58:08 +00:00
gziolo
cf490c773c Tests: Add unit tests for rendering in Comment Template block
Follow-up [53138].

Props darerodz.
See #55505.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52761 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-13 07:49:10 +00:00
gziolo
4549da16cc REST API: Fix incorrect casing of patterns endpoint schema properties
Follow-up [53154].

Props talldanwp.
See #55505.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52760 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-13 07:06:17 +00:00
Peter Wilson
74dcee85d0 Docs: Improve doc blocks for hooks added in [53126].
Fix a variable name and provide examples of the hook names.

Follow up to [53126].

Props dlh, pbiron.
Fixes #53212.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-13 03:04:10 +00:00
Peter Wilson
4b73e7b87b Cache API: Improve cache key generation in WP_Comment_Query.
Discard the parameters `update_comment_meta_cache` and `update_comment_post_cache` when generating the cache key as neither have an effect on the database query generated.

Props uday17035, spacedmonkey.
Fixes #55460.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-13 02:57:14 +00:00
davidbaumwald
2ea5eb36fe Taxonomy: Only reset non-button form field values after adding a tag.
[52953] added HTML5 input types to the form reset after a tag is created.  The selector was a bit too greedy, causing `button` types to have their values reset also.  

This change updates the jQuery selector to exclude `button`, `submit`, and `reset` input types from the form reset.

Follow-up to [52953].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52757 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 19:37:14 +00:00
Sergey Biryukov
e1a2ae351a Post WordPress 6.0 Beta 1 version bump.
Built from https://develop.svn.wordpress.org/trunk@53167


git-svn-id: http://core.svn.wordpress.org/trunk@52756 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 19:05:15 +00:00
Sergey Biryukov
2be90dc589 WordPress 6.0 Beta 1.
Built from https://develop.svn.wordpress.org/trunk@53166


git-svn-id: http://core.svn.wordpress.org/trunk@52755 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 18:15:10 +00:00
desrosj
43ca7ac938 External Libraries: Update polyfill libraries.
This updates two polyfill libraries to their latest versions.

- `polyfill-library` from `3.105.0` to `4.0.0`.
- `formdata-polyfill` from `4.0.0` to `4.0.10`.

This will affect the following script handles:
- `wp-polyfill-formdata`
- `wp-polyfill-node-contains`
- `wp-polyfill-dom-rect`

These polyfills are no longer used by WordPress Core, but are kept up to date as a courtesy for any plugins or themes still requiring them.

See #55547.
Built from https://develop.svn.wordpress.org/trunk@53165


git-svn-id: http://core.svn.wordpress.org/trunk@52754 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 17:35:27 +00:00
desrosj
35005412d0 External Libraries: Update some external libraries.
This updates three external libraries to their latest versions:

- `backbone` from `1.4.0` to `1.4.1`.
- `underscore` from `1.13.1` to `1.13.2`.
- `clipboard` from `2.0.8` to `2.0.10`.

These are all minor updates containing bug fixes and documentation improvements.

See #55547.
Built from https://develop.svn.wordpress.org/trunk@53164


git-svn-id: http://core.svn.wordpress.org/trunk@52753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 17:17:22 +00:00
desrosj
e15e2d78bf External Libraries: Update moment to version 2.29.2.
See #55547.
Built from https://develop.svn.wordpress.org/trunk@53163


git-svn-id: http://core.svn.wordpress.org/trunk@52752 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 16:52:23 +00:00
joedolson
fd9d7a7547 Media: Fix editing controls covering image edit region.
Move the editing control sidebar for mobile image editing below the image edit region so image is not obscured.

Props mor10, HristoK, certainstrings, joedolson.
Fixes #30154.
Built from https://develop.svn.wordpress.org/trunk@53162


git-svn-id: http://core.svn.wordpress.org/trunk@52751 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 16:50:08 +00:00
joedolson
1d29cb6632 Media: Enable edits to custom image sizes.
Add a filter `edit_custom_thumbnail_sizes` to allow users to enable editing individual custom image sizes.

Props silb3r, joedolson, costdev.
Fixes #28277.
Built from https://develop.svn.wordpress.org/trunk@53161


git-svn-id: http://core.svn.wordpress.org/trunk@52750 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 16:16:08 +00:00
gziolo
1882e40a8a Editor: Use block settings to pass assets for the iframed editor
Backports changes applied in Gutenberg in https://github.com/WordPress/gutenberg/pull/37193.

Props zieladam.
See #55505.
Follow-up for [53157].


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


git-svn-id: http://core.svn.wordpress.org/trunk@52749 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 16:02:19 +00:00
joedolson
4dd4aec2d1 Administration: Add unit test for term supplementary notice.
Adds a new test assertion to handle the supplemental data array passed in `ajax-response.js`. 

Follow up to [53123].

Props SergeyBiryukov, peterwilsoncc.
Fixes #55078.
Built from https://develop.svn.wordpress.org/trunk@53159


git-svn-id: http://core.svn.wordpress.org/trunk@52748 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 16:01:08 +00:00
audrasjb
bb723f9920 Widgets: Avoid 27 duplicate translations in Media Widgets constructor.
This changeset rationalizes the declaration of translation strings in the Media Widgets constructor.

Props Chouby, audrasjb, peterwilsoncc, costdev.
Fixes #54561.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52747 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 15:40:11 +00:00
gziolo
ab8a964858 Editor: Update WordPress packages based based on Gutenberg v13.0 RC3
This is the last step of backports from the Gutenberg plugin for WordPress 6.0 Beta 1 release. It includes all updates WordPress packages published to npm based on the Gutenberg plugin v13.0 RC3 release. This patch also includes all the necessary changes applied to core blocks. New blocks included:

- Avatar
- Comment Author Name
- Comment Content
- Comment Date
- Comment Edit Link
- Comment Rely Link
- Comment Template
- Comments Pagination
- Comments Pagination Next
- Comments Pagination Previous
- Comments Query Loop
- Home Link
- Post Author Biography
- Query No Results
- Read More
See more details in https://github.com/WordPress/wordpress-develop/pull/2564.

Props zieladam, ramonopoly, ocean90.
Fixes #55505.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52746 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 15:12:47 +00:00
audrasjb
bc0f186599 Administration: Clarify some sentences after [53131].
Props SergeyBiryukov, costdev, audrasjb.
Fixes #46057.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52745 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 13:43:16 +00:00
gziolo
e81c1a0267 Editor: Remove block patterns from server-generated settings
Backport of https://github.com/WordPress/gutenberg/pull/39185 from the Gutenberg plugin. Namely the part where the `gutenberg_remove_block_patterns_settings` filter function removes the block patterns fields from settings.

Props jsnajdr, zieladam.
See #55505.
Follow-up for [53152].


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


git-svn-id: http://core.svn.wordpress.org/trunk@52744 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 13:00:14 +00:00
gziolo
34e9aca0ca REST API: Use snake case convention for field names in Block Patterns
Backports the same changes applied in Gutenberg: https://github.com/WordPress/gutenberg/pull/40254.

Follow-up for [53152].

Props jsnajdr, timothyblynjacobs.
See #55505.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 12:48:18 +00:00
gziolo
e1414c93ca Tests: Improve test cleanup for block supports
Let's unregister the block in the tear_down method. The block will be unregistered even if the test fails.

Props ramonopoly, antonvlasenko.
See #55505.
Follow-up [53085], [53076].


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


git-svn-id: http://core.svn.wordpress.org/trunk@52742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 09:40:11 +00:00
gziolo
68a36de460 REST API: Bring new endpoints for Block Patterns from Gutenberg plugin
Related Gutenberg issue: https://github.com/WordPress/gutenberg/issues/39889.

Backporting changes from the Gutenberg plugin:
- new Block Patterns REST API endpoint
- new Block Pattern Categories REST API endpoint
- updates to Query Loop related patterns
- support for custom taxonomies in Query Loop block

Props hellofromtonya, peterwilsoncc, ntsekouras, zieladam, ironprogrammer, spacedmonkey, timothyblynjacobs, antonvlasenko, jsnajdr.
See #55505.



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


git-svn-id: http://core.svn.wordpress.org/trunk@52741 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 09:26:16 +00:00
Peter Wilson
5703931172 Options: Show error when updating all options exceeds max_input_vars.
On sites with a large number of options, the number of inputs when saving all options via the /wp-admin/options.php page may exceed PHP's `max_input_vars` setting, this will prevent saving.

An error is now shown if this is the case.

Props ishitaka, jorbin, maguijo, pento, sergeybiryukov. 
Fixes #45438.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52740 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 06:07:08 +00:00
Peter Wilson
b53f7ce56f Emoji: Update the Twemoji to version 14.0.2.
This version introduces support for the latest Emoji added in Emoji 14. 

"Insert witty comment newly supported emoji."

Props kraftbj, desrosj, dd32, milana_cap.
Fixes #55395.



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


git-svn-id: http://core.svn.wordpress.org/trunk@52739 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 05:56:23 +00:00
Peter Wilson
fadb4e1ea3 Media: Run the wp_content_img_tag filter once per image.
Prevent multiple identical `img` tags in a block of content causing the `wp_content_img_tag` filter to fire multiple times for that image.

Follow up to [53028].

Props superpoincare, flixos90, pbearne, peterwilsoncc.
Fixes #55510.
See #55347.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52738 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 05:18:08 +00:00
Sergey Biryukov
561518cdd7 I18N: Remove wp-config.php file name from translatable strings.
Follow-up to [35547], [35557], [53131].

See #46057.
Built from https://develop.svn.wordpress.org/trunk@53148


git-svn-id: http://core.svn.wordpress.org/trunk@52737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 01:47:07 +00:00
davidbaumwald
ce4a2a11de Formatting: Make get_the_author_link pluggable.
Adds a new filter to alter the output of `get_the_author_link`.  This change also adds unit tests for the new filter.

Props dshanske, donmhico, audrasjb, peterwilsoncc, SergeyBiryukov.
Fixes #51859.
Built from https://develop.svn.wordpress.org/trunk@53147


git-svn-id: http://core.svn.wordpress.org/trunk@52736 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 23:38:08 +00:00
audrasjb
fcb19b1c42 Docs: Misc. docblock fixes in wp-admin/includes/mic.php, as per documentation standards.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52735 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 21:48:09 +00:00
audrasjb
476e73194d Users: Improve wording of the "New Admin Email Address" email.
This changeset clarifies the email that the user gets when someone change the administration email address.

Props TwisterMc, Presskopp, audrasjb.
Fixes #45915.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52734 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 21:34:08 +00:00
audrasjb
70dea8e3c2 Formatting: Avoid escaping valid XML values in esc_xml().
This change improves the `esc_xml()` function by replacing two `empty()` checks with `isset()` to cover values that are not equal to `''` but still returning `true` when checked with `empty()`, like `'0'`, `0` or `false`. It also updates the related unit tests accordingly.

Props rumpel2116, pbiron.
Fixes #55399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52733 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 20:00:09 +00:00
desrosj
523c679e76 Build/Test Tools: Update generated CSS files after [53141].
This removes 2 instances of `-moz-tab-size`, which has not been required for Firefox to support the `tab-size` property since version 90 (current version is 99.

See #55559.
Built from https://develop.svn.wordpress.org/trunk@53143


git-svn-id: http://core.svn.wordpress.org/trunk@52732 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 19:10:13 +00:00
gziolo
44a0e46c85 Editor: Update build_comment_query_vars_from_block from Gutenberg
Follow-up for [53138].
See #55505.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 16:35:10 +00:00
gziolo
4a76af7233 Build: Bring caniuse-lite to the latest version
This ensures that build tools target the most recent version of browsers supported by WordPress.

Follow-up [53135].
See #51750, #55505.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52730 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 16:25:11 +00:00
gziolo
29254bd90a Build: Enable React Fast Refresh for block development
Brings the same functionality introduced in the Gutenberg plugin with https://github.com/WordPress/gutenberg/pull/28273. In effect, it brings React Fast Refresh support to WordPress core for block development with `@wordpress/scripts`.

Props walbo, antonvlasenko.
See #51750, #55505.
Follow-up [53135].


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


git-svn-id: http://core.svn.wordpress.org/trunk@52729 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 16:10:22 +00:00
gziolo
8b207b7967 REST API: Fix the wrong name in the comments controller
It should be `embeddable` not `embedded`.
Follow-up [53138].

Props timothyblynjacobs.
See #55505.



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


git-svn-id: http://core.svn.wordpress.org/trunk@52728 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 15:37:09 +00:00
gziolo
f3fc52f959 Editor: Add changes for new Comments Query Loop blocks
Backports changes from Gutenberg to add functions required by Comment Query Loop and related blocks. Related unit tests depends on the new blocks and they will get added seperately.

Props darerodz, timothyblynjacobs.
See #55505.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52727 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 15:22:09 +00:00
Sergey Biryukov
3180ab2cef Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/class-wp-site-icon.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 to `$attachment` in `WP_Site_Icon::insert_attachment()` and updates the documentation accordingly.

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

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


git-svn-id: http://core.svn.wordpress.org/trunk@52726 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 14:21:09 +00:00
audrasjb
8f35c61e7b Administration: Replace "can not" with "cannot" after [53131].
Follow-up to [53132], [53131], [52979].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52725 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 12:08:09 +00:00
gziolo
2ec4c366e6 Build: Update webpack to v5.x
Update webpack version to latest version https://www.npmjs.com/package/webpack. This aligns closer with how the Gutenberg plugin handles WordPress packages. Related update in Gutenberg from August 2021: https://github.com/WordPress/gutenberg/pull/33818.

Props walbo, desrosj, mukesh27.
Fixes #51750.



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


git-svn-id: http://core.svn.wordpress.org/trunk@52724 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 12:04:30 +00:00
audrasjb
4557cd683b Administration: Revert unwanted spaces found in theme.json after [53131].
Follow-up to [53131].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52723 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 11:55:00 +00:00
audrasjb
44d52e04a1 Administration: Revert accidental changes made to theme.json in changeset [53131].
Follow-up to [53131].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52722 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 11:53:00 +00:00
audrasjb
e0bb68d7cb Administration: Replace "can not" with "cannot" after [53131].
Follow-up to [53131], [52979].

See #46057, #38913

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


git-svn-id: http://core.svn.wordpress.org/trunk@52721 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 11:50:01 +00:00
audrasjb
12fc2d9146 Administration: Remove self-reference ("we") in WordPress Admin.
This changes updates many strings to remove self-references to an undefined "we" collective across the WordPress Administration.

The goal of this change is to better match the guidelines and recommendations set forth in the make/core handbook, specifically:

> the word "we" should be avoided (…) unless its made very clear which group is speaking.

Props johnbillion, shital-patel, audrasjb, marybaum, SergeyBiryukov, peterwilsoncc, johnjamesjacoby, kebbet, costdev, chaion07, davidbaumwald.
Fixes #46057.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52720 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 11:42:04 +00:00
gziolo
c6ad5a6945 Editor: Add missing defaultDutone changes
Follow-up for [53129].

This PR backports the remaining `defaultDuotone` option changes added in the Gutenberg plugin. Related PRs: https://github.com/WordPress/gutenberg/pull/38681 and https://github.com/WordPress/gutenberg/pull/39966.

Props oandregal, ajlende.
See #55505.
 


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


git-svn-id: http://core.svn.wordpress.org/trunk@52719 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 11:01:00 +00:00
gziolo
9e3c5a4215 Editor: Add functionality required for theme export in the site editor
This bring across changes to theme export functionality, and related code, and tests. Relates issue in Gutenberg: https://github.com/WordPress/gutenberg/issues/39889.

Props scruffian, timothyblynjacobs, oandregal, ajlende, zieleadam.
See #55505.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52718 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 10:38:00 +00:00
gziolo
5d78798b5c Tests: Improve code comments for block supports tests
Follow-up for [53085].

Props ramonopoly, antonvlasenko, peterwilsoncc.
See #55505.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52717 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 10:14:04 +00:00
Peter Wilson
f27ba31069 Permalinks: Improve settings page error messages.
Props sabernhardt.
Fixes #53141.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52716 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 05:16:00 +00:00
Peter Wilson
a009192299 Posts, Post Types/Taxonomies: Add object type specific registration filters.
Add post type and taxonomy specific registration argument hooks. 

Introduces the filters `register_{$post_type}_post_type_args` and `register_{$taxonomy}_taxonomy_args`. Introduces the actions `registered_post_type_{$post_type}` and `registered_taxonomy_{$taxonomy}`.

Props pbiron, dlh, davidbaumwald, hellofromTonya, milana_cap.
Fixes #53212.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 05:11:02 +00:00
Peter Wilson
b90d225de1 Feeds: Remove comment feed HTML headers when empty.
Remove the `link[rel=alternate]` element from the HTML header when the comment feeds are disabled. Previously the HTML element was output with an empty `href` attribute.

The element is removed if `get_post_comments_feed_link()` returns an empty string or the feed is disabled via the `feed_links_show_comments_feed` filter.

Props barryceelen, audrasjb, costdev, rachelbaker, Boniu91.
Fixes #54703.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 05:03:03 +00:00
Peter Wilson
cf4f9c9e61 Plugins: Update item count when plugin deleted.
Update the item count, "N items", on the plugin list when a plugin is deleted. This matches the live updating of various other counts on the screen.

Props mitogh, costdev, azouamauriac, swissspidy, kebbet.
Fixes #55316.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 04:51:11 +00:00
Peter Wilson
ce1dd08c07 Administration: Remove term page check from ajax-response.js.
Replace hard coded check for the term creation page in `_enqueues/lib/ajax-response.js` with a check for a notification to display in the AJAX response data.

Follow up to  [52170], [52672].

Props SergeyBiryukov, ryokuhi, johnregan3, sabernhardt, joedolson.
Fixes #55078.
See #54955.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52712 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 04:37:00 +00:00
Peter Wilson
bdd42a3e74 Upgrade/Install/Users: Prevent JS bug filling new passwords.
A JavaScript race condition was throwing an error and preventing passwords from being set if the zxcvbn library loaded earlier than expected. This could prevent the installation of WordPress or the creation/updating of user accounts.

Props adi64bit, afragen, agepcom, audrasjb, bedas, brookedot, cbigler, charlyox, costdev, desrosj, drago239, Eric3D, espiat, jadpm, jrf, justinahinon, kubiq, lkraav, michelangelovandam, mirkolofio, mkox, peterwilsoncc, poena, sbossarte, sebastienserre, SergeyBiryukov, Synchro, thomasplevy, walbo, waterfire, wpmakenorg.
Fixes #53974, #52086.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52711 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 04:29:04 +00:00
audrasjb
5c07bc0b59 Twenty Twenty One: Prevent loading translation file twice.
This changes wraps the registration of patterns and pattern categories in a function hooked to `init`, to avoid loading the Twenty Twenty One translation file twice.

Props zodiac1978, sabernhardt, audrasjb.
Fixes #53589.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52710 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-10 22:29:03 +00:00
audrasjb
439bf1296f Twenty Twenty: Improve padding for number input type.
This changes improves lateral padding for `number` input types in Twenty Twenty bundled theme.

Props helgatheviking, sabernhardt, chaion07, poena, justinahinon, ugyensupport, nayana123.
Fixes #53115.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52709 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-10 20:36:02 +00:00
audrasjb
387ce8d003 Administration: Improved padding for pagination setting fields.
This changes improves paddings for the "Number of items per page" field available on list screens.

Props ankit-k-gupta, aezazshekh, mukesh27, sabernhardt, mehedi890.
Fixes #54219.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52708 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-10 20:07:59 +00:00
audrasjb
f680e20156 General: add missing strong tag to some error messages.
Props NekoJonez, oakesjosh.
Fixes #54437.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52707 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-10 19:47:02 +00:00
Sergey Biryukov
0c12438eed Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/class-wp-site-health.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 `$class` parameter to `$class_name` in `WP_Site_Health::test_php_extension_availability()`.
* Renames some other parameters for consistency.

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

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


git-svn-id: http://core.svn.wordpress.org/trunk@52706 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-10 14:29:04 +00:00
Sergey Biryukov
483a0e38e8 Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/class-wp-posts-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 `$class` parameter to `$css_class` in `WP_Posts_List_Table::get_edit_link()`.
* Renames the `$parent` parameter to `$parent_page` in `WP_Posts_List_Table::_page_rows()`.

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

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


git-svn-id: http://core.svn.wordpress.org/trunk@52705 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-09 20:38:04 +00:00
joedolson
1d65842848 Media: Align username and post title in Save postbox.
Remove the float alignment that places the "Uploaded by" username and the "Uploaded to" post title on the opposite side of the Save postbox for mobile. This matches the alignment on desktop, and makes it easier for low-vision users to track the information relationship between label and content.

Props sabernhardt.
Fixes #55508.
Built from https://develop.svn.wordpress.org/trunk@53115


git-svn-id: http://core.svn.wordpress.org/trunk@52704 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-08 21:10:02 +00:00
joedolson
dedfc82ed8 Posts, Post Types: Make permalink fully visible on mobile.
Set `break-word` on sample permalink so the full permalink will be visible on mobile devices in posts, media, and comments. Prevent hidden text overflow or horizontal scrolling on mobile.

Props sumitsingh, sabernhardt.
Fixes #54811.
Built from https://develop.svn.wordpress.org/trunk@53114


git-svn-id: http://core.svn.wordpress.org/trunk@52703 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-08 20:38:00 +00:00
desrosj
f27c6a5565 Build/Test Tools: Update some NPM dependencies to the latest versions.
This updates several NPM dependencies to the latest versions, including:

- `check-node-version` from `4.1.0` to `4.2.1`.
- `dotenv` from `10.0.0` to `16.0.0`.
- `dotenv-expand` from `5.1.0` to `8.0.3`.
- `grunt-contrib-concat` from `2.0.0` to `2.1.0`.
- `grunt-contrib-jshint` from `3.1.1` to `3.2.0`.
- `grunt-contrib-uglify` from `5.0.1` to `5.1.0`.
- `qunit` from `2.17.2` to `2.18.1`.
- `sass` from `1.43.4` to `1.50.0`.
- `sinon` from `12.0.1` to `13.0.1`.
- `sinon-test` from `3.1.1` to `3.1.3`.
- `uglify-js` from `3.14.3` to `3.15.3`.
- `wait-on` from `6.0.0` to `6.0.1`.

The updates to `dotenv` and `dotenv-expand` required a minor change to files using these packages.

Additionally, this contains several updates to the `package-lock.json` file as a result of running `npm audit fix`.

See #54727.
Built from https://develop.svn.wordpress.org/trunk@53113


git-svn-id: http://core.svn.wordpress.org/trunk@52702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-08 20:07:18 +00:00
desrosj
304281dcef Build/Test Tools: Update all 3rd party actions to their latest versions.
This updates all 3rd party GitHub actions to their latest versions.

- `actions/cache` from `2.1.6` to `3.0.1`.
- `actions/github-script` from `5.0.0` to `6.0.0`.
- `actions/setup-node` from `2.4.1` to `3.1.0`.
- `codecov/codecov-action` from `2.1.0` to `3.0.0`.
- `ramsey/composer-install` from `1.3.0` to `2.1.0`.
- `shivammathur/setup-php` from `2.15.0` to `2.18.0`.

Additionally, this updates all instances of the `actions/setup-node` action to replace the `node-version` option with the new `node-version-file`. This simplifies the process of changing the version of NodeJS used in workflows by only requiring the version to be changed once in the `.nvmrc` file.

See #54725.
Built from https://develop.svn.wordpress.org/trunk@53112


git-svn-id: http://core.svn.wordpress.org/trunk@52701 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-08 18:39:07 +00:00
joedolson
b518b73602 Users: Use autocomplete values on user profiles.
Assign appropriate autocomplete values for new and edited user, user email, and password fields.

Props clonemykey, sabernhardt, WraithKenny, bookdude13, konradyoast.
Fixes #43886, #52714.
Built from https://develop.svn.wordpress.org/trunk@53111


git-svn-id: http://core.svn.wordpress.org/trunk@52700 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-08 17:40:07 +00:00
spacedmonkey
06ab86cee6 REST API: Use rest_parse_embed_param function in WP_REST_Server class.
Ensure that the value get parameter `_embed ` that is passed to the `envelope_response` method, is run through the `rest_parse_embed_param` function. 

Props Spacedmonkey, johnbillion, TimothyBlynJacobs. 
Fixes #54015.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52699 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-08 17:29:01 +00:00
joedolson
bd9478d512 Quick/Bulk Edit: Fix padding in term quick edit.
Fix missing padding on quick edit for taxonomy terms following accessibility changes in [53096].

Props afercia.
Fixes #35483.
Built from https://develop.svn.wordpress.org/trunk@53109


git-svn-id: http://core.svn.wordpress.org/trunk@52698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-08 17:05:03 +00:00
desrosj
b79a708ab6 Build/Test Tools: Improve the accuracy of “fixed” Slack notifications.
This adjusts the logic of the Slack Notifications workflow to make the “fixed” notifications more reliable.

Currently, the workflow looks at the immediately preceding workflow run for the current branch. This fails to indicate that a workflow is fixed when other unrelated commits are made, and when rerunning the workflow after a false failure (timeout, etc.).

The workflow will now use the following logic to determine if something has been fixed:
- When a workflow is rerun, the conclusion for the immediately preceding run attempt will now be used to determine if the current attempt has “fixed” the workflow.
- When on the first run attempt for a workflow run, the workflow conclusion for the immediately preceding commit will be used.
- When on the first run attempt for a workflow run and no preceding commits for the current branch are present (this is a fresh tag or branch), always consider it “fixed”.

Props davidbaumwald.
See #54742.
Built from https://develop.svn.wordpress.org/trunk@53108


git-svn-id: http://core.svn.wordpress.org/trunk@52697 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-08 13:59:06 +00:00
Peter Wilson
395f39aee4 Networks and Sites: Increase sort options in WP_Site_Query.
Add orderby support for the boolean options: deleted, spam, mature, archived and public.

Props lenasterg, SergeyBiryukov.
Fixes #55226.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-08 06:36:03 +00:00
Peter Wilson
67e97dc748 Embeds: Add YouTube shorts to the allow list.
YouTube shorts URLs have a different structure to other YouTube videos. This adds support for the structure for YouTube embeds.

Props danielbachhuber, johnbillion, mukesh27.
Fixes #55528.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-08 06:31:02 +00:00
Peter Wilson
8c29f283d7 Users: Prevent author changes in bulk editor on large sites.
On large sites (with over 1000 users), include a hidden `post_author` field in the bulk editing interface to preven unexpected authorship changes.

Follow up to [53011], [53049].

Props georgestephanis, tobifjellner, peterwilsoncc, spacedmonkey, jb510.
Fixes #38741.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52694 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-08 06:26:02 +00:00
Peter Wilson
5e885b798f Administration: Allow floats for menu positions.
Permit plugin authors to pass the menu position as a float in `add_menu_page()` and `add_submenu_page()`. This allows for a common practice within major plugins to avoid menu collisions by passing a float.

Follow up to [52569].

Props justinbusa, dd32, welcher, SergeyBiryukov, kirtan95, audrasjb, Cybr, chaion07, costdev, peterwilsoncc.
See #40927.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52693 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-08 06:17:05 +00:00
Peter Wilson
35913a6309 Script loader: Add wp-a11y as dependency of wp-ajax-response.
Ensure `wp.a11y.speak()` is available when called in `wp-ajax-response`.

Follow up to [52170].

Props afercia.
Fixes #55544.
See #42937.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52692 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-08 06:00:08 +00:00
Sergey Biryukov
0f8bdeb263 I18N: Add missing translator comment for application password helper text for Super Admins.
Follow-up to [53101].

See #53234.
Built from https://develop.svn.wordpress.org/trunk@53102


git-svn-id: http://core.svn.wordpress.org/trunk@52691 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-08 00:03:05 +00:00
audrasjb
13dbc8c063 Application Passwords: Use a more appropriate helper text message for super-admins.
Previously, the helper text of the application password section was misleading for a Super Admin because an application password for a Super Admin grants access to all sites on the network, not just ones that they are a member of. This changeset provides a slightly different message for Super admin role.

Props johnbillion, rsiddharth, audrasjb.
Fixes #53234

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


git-svn-id: http://core.svn.wordpress.org/trunk@52690 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-07 23:16:02 +00:00
audrasjb
b317b87147 Toolbar: Add a filter to help remove site icons from toolbar for large multisite, and lazy load them by default.
This changeset introduces the `wp_admin_bar_show_site_icons` filter to help developers to hide site icons from the toolbar, as it may have negative performance impact on large multisites. It also adds a default lazy load behavior for these icons.

Props wslyhbb, sabernhardt, lkraav, kebbet, peterwilsoncc.
Fixes #54447

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


git-svn-id: http://core.svn.wordpress.org/trunk@52689 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-07 22:14:05 +00:00
Sergey Biryukov
2c074169e7 Customize: Use correct dashicon for external links in the Additional CSS section.
This replaces the `migrate` dashicon with `external` in the section description styles.

Follow-up to [38829].

Props pross.
Fixes #55542.
Built from https://develop.svn.wordpress.org/trunk@53099


git-svn-id: http://core.svn.wordpress.org/trunk@52688 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-07 18:02:01 +00:00
spacedmonkey
4a14685afd Networks and Sites: Improve cache key generation in WP_Network_Query class.
Improve cache key generation in the `WP_Network_Query` class by removing `update_network_cache` element in the array used to generate the cache key.  This 
element does not affect that cache and by removing it, it improves the likelihood of reusing an existing cache. 

Props Spacedmonkey, furi3r, johnbillion, johnjamesjacoby, flixos90.
Fixes #55461.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-07 17:59:04 +00:00
spacedmonkey
7aad7bef06 Networks and Sites: Improve cache key generation in WP_Site_Query class.
Improve cache key generation in the `WP_Site_Query` class by removing `update_site_cache` and `update_site_meta_cache` elements in the array used to generate 
the cache key.  These elements do not affect that cache and by removing them, improve the likelihood of reusing an existing cache. 

Props Spacedmonkey, furi3r, johnbillion, johnjamesjacoby, flixos90.
Fixes #55462.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-07 17:46:04 +00:00
joedolson
337e4a8d90 Quick/Bulk Edit: Fix initial focus and keyboard operability.
Fix the quick and bulk edit forms to set an appropriate initial focus, use native HTML controls for all interactions, and set appropriate labels for controls. Improve the semantics of HTML wrappers so lists are enumerable by screen readers.

Props afercia, azaozz.
Fixes #35483.
Built from https://develop.svn.wordpress.org/trunk@53096


git-svn-id: http://core.svn.wordpress.org/trunk@52685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-07 16:44:05 +00:00
gziolo
758211c9b8 Editor: Remove loading remote patterns from editor pages
Stops loading remote patterns on the post editor and site editor pages. The only place to load remote patterns is going to be the `/wp/v2/block-patterns/patterns` REST endpoint handler.

Props jsnajdr.
See #55505.



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


git-svn-id: http://core.svn.wordpress.org/trunk@52684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-07 13:53:03 +00:00
gziolo
358dd334a4 Editor: Update preload paths for post, site and widgets editors
Changes the REST endpoints that get preloaded when displaying a page for post, site and widgets editor, so that they are in sync with what the latest version of Gutenberg to be shipped with Core 6.0 really requests.

Props jsnajdr.
See #55505.



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


git-svn-id: http://core.svn.wordpress.org/trunk@52683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-07 13:40:04 +00:00
gziolo
9fd50db978 Site Editor: Resolve homepage template on server-side
Backports change from Gutenberg to support server-side home template resolution in the Site Editor. Original PR https://github.com/WordPress/gutenberg/pull/38817.

Props Mamaduka.
See #55505.



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


git-svn-id: http://core.svn.wordpress.org/trunk@52682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-07 13:35:02 +00:00
Sergey Biryukov
ba864b2792 Administration: Restore the correct escaping function for base64-encoded SVG icons in the admin menu.
Add a comment to clarify the `esc_attr()` usage instead of `esc_url()`.

Follow-up to [53050].

Props KProvance, kebbet, w33zy, ocean90, mukesh27.
Fixes #55539.
Built from https://develop.svn.wordpress.org/trunk@53092


git-svn-id: http://core.svn.wordpress.org/trunk@52681 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-07 12:54:03 +00:00
gziolo
0ae89f5171 Editor: Allow registration of blocks that include assets from within a theme
Fixes the issue when you register blocks with `block.json` in your theme. There is no longer an assets's URL error because it resolves correctly in relation to the theme where it is located.

Props fabiankaegy, ocean90, whoisnegrello, audrasjb, peterwilsoncc, 
Fixes #54647, #55513.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52680 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-07 11:59:05 +00:00
gziolo
030980579d Editor: Add localAutosaveInterval preference to editor settings
Backports changes from the Gutenberg plugin. Original PR in Gutenberg: https://github.com/WordPress/gutenberg/pull/39180.

Props zieleadam, talldanwp.
See #55505.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52679 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-07 11:16:06 +00:00
Peter Wilson
a334e05915 Editor: Limit display of tags on classic editor.
On the classic editor, limit the search of tags and non-hierarchical taxonomies to twenty results. This in turn prevents an unbounded database query via an AJAX request.

Props pikamander2, costdev, azouamauriac, audrasjb.
Fixes #55052.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52678 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-07 04:06:05 +00:00
Peter Wilson
3d9bb812f1 Taxonomy: Show error message for terms without a name.
Display an error message to users if they attempt to create a term without a name via the admin-ajax `add-tag` action. This improves the accessibility of the screen by avoiding the use of color alone to indicate an error.

Props conner_bw, birgire, afercia.
Fixes #47018.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52677 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-07 03:50:05 +00:00
Sergey Biryukov
8e4e8afe5d Docs: Adjust DocBlock formatting for wp_robots_*() and related functions.
This ensures the code blocks are displayed correctly in the WordPress Code Reference.

Follow-up to [19304], [37541], [44021], [49992].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52676 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-06 15:33:03 +00:00
Sergey Biryukov
a5f05b68a3 Docs: Adjust some deprecated function DocBlocks per the [https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/#1-2-deprecated-functions documentation standards].
This ensures the replacement functions are linked correctly in the WordPress Code Reference.

Follow-up to [38515], [43548], [49992], [51348], [51586], [52757], [53082].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52675 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-06 15:20:06 +00:00
gziolo
e0ce8e7a6b Editor: Update layout handling for block supports
Backports changes applied in the Gutenberg plugin planned for WordPress 6.0 release. See https://github.com/WordPress/gutenberg/issues/39889.

Props ramonopoly, youknowriad.
See #55505.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52674 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-06 11:41:05 +00:00
gziolo
a9008e6cc5 Editor: Make block type aware of the ancestor field
The `ancestor` field was recently added to the `block.json` schema in Gutenberg. See: https://github.com/WordPress/gutenberg/pull/39894.

Props darerodz.
Fixes #55531.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52673 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-06 09:47:09 +00:00
Peter Wilson
d7d9102b06 Networks and Sites: Remove duplicate cache entry.
Remove the `networks_have_paths, site-options` cache entry as it duplicates caching within the `WP_Network_Query` class.

Props uday17035, spacedmonkey, johnbillion, johnjamesjacoby.
Fixes #42070.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52672 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-06 04:35:00 +00:00
Peter Wilson
da07ae873e Editor: Soft deprecate block supports functions.
Reinstate the functions hard deprecated in [53076]: `wp_skip_border_serialization()`, `wp_skip_dimensions_serialization()` and `wp_skip_spacing_serialization()`.

Props ramonopoly.
See #55505.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52671 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-06 04:24:05 +00:00
desrosj
419262f0cd Build/Test Tools: Prevent error when workflows run for new branches and tags.
This fixes a JavaScript error in the Slack notifications workflow. This was causing the first workflow run for each workflow in a new branch or tag to be reported as a failure, even if the important parts of the workflow succeed.

When running a workflow for the first time, a default of `failure` is now used for the previous outcome. This will trigger a success notification to be sent to report successful branching/tagging.

Props davidbaumwald.
Fixes #54742.
Built from https://develop.svn.wordpress.org/trunk@53077


git-svn-id: http://core.svn.wordpress.org/trunk@52666 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-05 13:20:02 +00:00
gziolo
c5360263ed Editor: Backport block support changes from the Gutenberg plugin
Migrate spacing, border, color, dimensions, elements and typography and associated tests for block supports in the block editor.

Related changes in Gutenberg:
- Include individual serialization changes from 6de16981c7
- Skip Style Engine integration from 44925a947f%60

Props ramonopoly, aaronrobertshaw.
See #55505.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-05 12:08:02 +00:00
youknowriad
85837cfa5b Block Editor: Synchronize global styles endpoint code with Gutenberg.
This adds a missing fallback to ensure styles property is always defined in the returned data.

Props gziolo.
See #55505.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-05 11:49:08 +00:00
Sergey Biryukov
74079f27a9 Plugins: Introduce the plugin_install_description filter.
This allows for modification of the plugin card description on the Add Plugins screen.

Use cases include displaying a list of dependencies for the [https://make.wordpress.org/core/2022/02/24/feature-project-plugin-dependencies/ Plugin Dependencies feature project] ([https://github.com/WordPress/wp-plugin-dependencies GitHub]).

Props afragen, davidbaumwald, peterwilsoncc, SergeyBiryukov.
Fixes #55480.
Built from https://develop.svn.wordpress.org/trunk@53074


git-svn-id: http://core.svn.wordpress.org/trunk@52663 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-05 11:02:01 +00:00
youknowriad
88026a4f37 Block Editor: Backport the Global Styles Variations endpoint.
This include the /global-styles/themes/{theme}/variations rest endpoint into core.
The endpoint will be used by the site editor to display alternative theme styles to the user.

Props gziolo, oandregal.
See #55505.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-05 09:52:02 +00:00
gziolo
025bd5e718 Env: Revert accidental changes to the config
It's the only way to make the env work locally with Apple M1 processor, but I included them by accident.

Props Mamaduka.
See [53070]. 


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


git-svn-id: http://core.svn.wordpress.org/trunk@52660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-05 09:33:01 +00:00
gziolo
1bb507149e Editor: Fix post lock data inconsistencies
Backporting fixes introduced in WordPress/gutenberg#37914.

Props Mamaduka.
Fixes #55238.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52659 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-05 09:21:02 +00:00
gziolo
4e622757ea Build: Fix npm install on Apple Silicon
Fixes the issue where `npm install` aborts on Apple Silicon due to Puppeteer not finding appropriate chromium binary. It works correctly with the latest versio of `grunt-contrib-qunit` package.

Props afragen, jorbin, SergeyBiryukov.
Fixes #52690.
Related #52356.




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


git-svn-id: http://core.svn.wordpress.org/trunk@52658 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-05 08:46:23 +00:00
Peter Wilson
d798e60859 Login, Registration: Fix coding standards errors in [53067].
See #35500.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52657 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-05 04:18:03 +00:00
Peter Wilson
d4f060b216 Login, Registration: Prevent password reset to whitespace alone.
Prevent users from using the password reset form to set their password to whitespace alone (tabs, spaces). This matches the processing used during the authentication flow, ensuring users do not inadvertently get locked out of their account.

Props antonrinas, swissspidy, voldemortensen, hellofromTonya, henry.wright, costdev.
Fixes #35500.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52656 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-05 03:27:03 +00:00
Peter Wilson
f908c6e495 Query: Add tests following [53065].
Props spacedmonkey, boonebgorges, pbearne.
See #36904.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52655 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-05 02:01:02 +00:00
Peter Wilson
4127a17a0a Query: Cache comments feeds in WP_Query.
Cache queries to the comments table in `WP_Query` for various comments feeds. Only comment IDs are stored for each feeds cache to avoid doubling up caching with each individual comment's cache.

Props spacedmonkey, boonebgorges, pbearne.
Fixes #36904.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52654 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-05 01:55:03 +00:00
audrasjb
2a7f0aabed Docs: Use third-person singular verbs for function descriptions in WP_Automatic_Updater class, per the documentation standards.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52653 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-04 20:53:01 +00:00
audrasjb
267ebcec09 Mail: Replace empty site title with domain name in email subjects.
This change replaces site title with domain name in email subjects when the `blogname` option is empty.

Props Presskopp, kebbet, audrasjb, azouamauriac.
Fixes #54760.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-04 20:21:00 +00:00
Sergey Biryukov
b8bc65042a Docs: Add missing description for $taxnow global in various functions.
Follow-up to [53060], [53061].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52651 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-04 18:43:02 +00:00
Sergey Biryukov
f2e14d4e5f Docs: Add missing description for $typenow global in various functions.
Follow-up to [53060].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52650 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-04 18:39:01 +00:00
Sergey Biryukov
9fb5112732 Docs: Add missing description for $pagenow global in various functions.
See #54729, #55499.
Built from https://develop.svn.wordpress.org/trunk@53060


git-svn-id: http://core.svn.wordpress.org/trunk@52649 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-04 18:26:06 +00:00
Sergey Biryukov
955e2c007b Docs: Consistently document the $pagenow global in WP_Customize_Manage methods.
Follow-up to [41839].

Props jontyravi, bhrugesh12, kebbet.
Fixes #55499.
Built from https://develop.svn.wordpress.org/trunk@53059


git-svn-id: http://core.svn.wordpress.org/trunk@52648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-04 12:03:03 +00:00
Peter Wilson
b8b35c78b7 Posts, Post Types; Taxonomy: Translate default labels once.
Improve the translation of post type and taxonomy labels by caching the translations during runtime. To account for internationalisation plugins, the runtime cache is cleared as the post types/taxonomies are reinitiated on `change_local` hook.

The same property and methods are added to both `WP_Post_Type` and `WP_Taxonomy`:

* `$default_labels`: for storing the translated strings at runtime
* `get_default_labels()`: for getting the default labels, these are translated on the first run and stored in the new property.
* `reset_default_labels()`: to clear the runtime cache and force a re-translation of the default labels

Props Chouby, nacin, SergeyBiryukov, Rarst, chriscct7, ocean90, audrasjb, costdev.
Fixes #26746.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52647 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-04 03:50:07 +00:00
Peter Wilson
881e4f054b Customizer: Improve performance checking for published pages.
Improve the performance of `WP_Customize_Manager::has_published_pages()` by limiting the database query to a single published page, down from querying all published pages.

Props nagpai, dlh, tyxla.
Fixes #55425.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-04 01:25:08 +00:00
Sergey Biryukov
8ddb40d7a0 Docs: Use correct format for multi-line comments in the_block_editor_meta_boxes().
Follow-up to [44131], [44260].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52645 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-03 11:45:07 +00:00
audrasjb
c9a7acde6a Docs: Use third-person singular verbs for function descriptions in WP_Customize_Nav_Menus class, per the documentation standards.
Follow-up to [53054].

See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52644 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-02 16:26:07 +00:00
audrasjb
b7c74cd433 Docs: Use third-person singular verbs for function descriptions in WP_Customize_Manager class, per the documentation standards.
Props azouamauriac.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52643 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-02 16:21:05 +00:00
Sergey Biryukov
521db02647 Docs: Further remove HTML markup from various function summaries.
Per the [https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/#summary-formerly-short-description WordPress PHP documentation standards], no HTML markup or Markdown of any kind should be used in the summary. This ensures that the summary is displayed correctly in the [https://developer.wordpress.org/reference/ WordPress Code Reference].

This commit also improves formatting of HTML special characters in descriptions in `wp-includes/formatting.php`.

Follow-up to [53048].

Props johnbillion, mukesh27.
Fixes #55506.
Built from https://develop.svn.wordpress.org/trunk@53053


git-svn-id: http://core.svn.wordpress.org/trunk@52642 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-02 13:55:11 +00:00
joedolson
58fd134d63 General: Open change permalink structure links in same tab.
Remove `target="_blank"` from the link to change permalink structures and change link text to clarify link purpose. 

Props kebbet, sabernhardt.
Fixes #55252.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52641 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-01 20:10:09 +00:00
joedolson
7b96116f3f Twenty Twenty: Fix aria-expanded handling in search toggle.
Transform search into a dialog role and fix the handling of aria-expanded to synchronize mobile and desktop buttons.

Props utz119, alexstine, mukesh27, hareesh-pillai, sabernhardt, audrasjb, afercia.
Fixes #53951.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52640 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-01 17:56:08 +00:00
Sergey Biryukov
35ce94f930 Administration: Consistently escape icon URLs in the admin menu.
Follow-up to [9154], [26664].

Props chintan1896, jigar-bhanushali, mukesh27.
Fixes #55496.
Built from https://develop.svn.wordpress.org/trunk@53050


git-svn-id: http://core.svn.wordpress.org/trunk@52639 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-01 11:46:04 +00:00
spacedmonkey
1c5733e796 Users: Fix notice error in WP_Posts_List_Table class.
Fix notice error introduced in [53011] as the variable `$authors_dropdown` is now conditionally loaded. 

Follow-up to [53011].

Props Spacedmonkey, dd32, johnbillion. 
See #38741. 


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


git-svn-id: http://core.svn.wordpress.org/trunk@52638 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-01 11:43:05 +00:00
Sergey Biryukov
9d3325a3a8 Docs: Remove HTML markup from WP_REST_URL_Details_Controller class method summaries.
Per the [https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/#summary-formerly-short-description WordPress PHP documentation standards], no HTML markup or Markdown of any kind should be used in the summary. This ensures that the summary is displayed correctly in the [https://developer.wordpress.org/reference/ WordPress Code Reference].

Props gvgvgvijayan, rsiddharth, azouamauriac, SergeyBiryukov.
Fixes #55506.
Built from https://develop.svn.wordpress.org/trunk@53048


git-svn-id: http://core.svn.wordpress.org/trunk@52637 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-01 11:35:05 +00:00
audrasjb
5c6a8e9826 Adds "select all" shortcut for Mac on permalinks page when .htaccess is not writable.
This change improves the description of the "select all" shortcut for Mac users in Permalink Settings screen.

Props Valer1e, ajoah, audrasjb, SergeyBiryukov.
Fixes #54633.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52636 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-01 11:09:07 +00:00
audrasjb
f9c1c14c76 Docs: Use third-person singular verbs for function descriptions in WP_Embed class, per the documentation standards.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52635 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-01 08:32:03 +00:00
Peter Wilson
14e965a8d6 General: Validate input of wp_list_pluck().
`wp_list_pluck()` is used by WordPress to pluck items from a list. Of course, this requires a list. This validates the input of `wp_list_pluck()` to ensure it is a list.

This matches the behaviour of `wp_list_sort()` and `wp_filter_object_list()`.

Props marv2, davidbaumwald, mkox, SergeyBiryukov, dd32.
Fixes #54751.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-01 05:56:06 +00:00
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&amp;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
audrasjb
d1fe2eec5c Docs: Miscellaneous fixes in wp-admin/includes/plugin-install.php and wp-admin/includes/plugin.php.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52520 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-13 21:56:01 +00:00
audrasjb
837cb1e93b Docs: Use third-person singular verbs for function descriptions in wp-includes/class-wp-locale.php.
Follow-up to [52929].

See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52519 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-13 21:06:01 +00:00
audrasjb
30a77d5fa4 i18n: Define List item separator as a WP_Locale property.
The list item separator is a locale property, and it doesn't make much sense to translate it separately in multiple projects. This changeset implements the following modifications:

- Define list item separator as a new WP_Locale property
- Add `wp_get_list_item_separator()` as a wrapper for `WP_Locale::get_list_item_separator`
- Replace `$wp_locale->get_list_item_separator()` calls with `wp_get_list_item_separator()`
- Added a compatibility layer for bundled themes

Props SergeyBiryukov, swissspidy, rsiddharth, johnbillion, audrasjb.
Fixes #39733.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-13 20:03:01 +00:00
audrasjb
3046b5b3e1 Twenty Thirteen: Add gradient background options using the theme color scheme.
This change implements gradient background options that fit the color scheme used in Twenty Thirteen.

Props ianbelanger, tomjdevisser, audrasjb.
Fixes #49762.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52517 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-13 09:50:06 +00:00
audrasjb
b9033d9203 Twenty Nineteen: Display Image block at the same size whether the image is linked or not.
This change makes sure the `max-width` value is assigned for linked images.

Props JarretC, sabernhardt.
Fixes #48697.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52516 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-12 22:53:04 +00:00
audrasjb
b972ba13bd Twenty Sixteen: Remove .entry-content selector from button styles.
This change applies the default button styles to all button blocks in Twenty Sixteen, instead of only targeting those in `entry-content`. This means that any buttons added outside of `.entry-content`, such as in a widget area, will be styled the same as any other button blocks. This change also makes the theme custom colors work outside of `.entry-content`.

Follow-up to [44306].

Props mikachan, costdev, audrasjb.
Fixes #55167.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-12 21:55:08 +00:00
audrasjb
2594c68d9f Twenty Nineteen: avoid columns set to full width to extend beyond editor bounds.
This changeset applies `max-width` and `margin` CSS rules when `block-editor-writing-flow` and `editor-styles-wrapper` classes are on the same element.

Props charleyparkerdesign, sabernhardt, smit08, sclayf1.
Fixes #54169.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52514 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-12 19:13:05 +00:00
davidbaumwald
3172eac11b Formatting: Use safecss_filter_attr in wp_get_layout_style().
Previously, `safecss_filter_attr` did not allow for `calc` and `var` in parsed CSS.  Because of this, `wp_strip_all_tags` was used in `wp_get_layout_style` to allow for the use of these CSS functions to account for responsive widths.  [50923] added support for both of these CSS functions in KSES, so `safecss_filter_attr` can now be used in `wp_get_layout_style` as originally intended.

Follow-up to [52069].

Props grapplerulrich.
Fixes #55356.
Built from https://develop.svn.wordpress.org/trunk@52924


git-svn-id: http://core.svn.wordpress.org/trunk@52513 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-12 00:29:04 +00:00
davidbaumwald
29574d03bd Site Editor: Rename the default attachment template from "Media" to "Attachment".
Follow-up to [52062].

Props scruffian, costdev.
Fixes #55373.
Built from https://develop.svn.wordpress.org/trunk@52923


git-svn-id: http://core.svn.wordpress.org/trunk@52512 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-11 23:30:07 +00:00
Sergey Biryukov
08b97d13b8 Site Editor: Fix typo in the description of the tag template.
Follow-up to [52331].

Props scruffian.
Fixes #55374.
Built from https://develop.svn.wordpress.org/trunk@52922


git-svn-id: http://core.svn.wordpress.org/trunk@52511 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-11 15:24:02 +00:00
spacedmonkey
4c23c2f079 Taxonomy: Use get_terms instead of a database lookup in term_exists().
Replace raw SQL queries to the terms table, with a call to the `get_terms` function. Using `get_terms` means that `term_exists` is now cached. For developers using `term_exists` where cache invalidation is disabled, such as importing, a workaround was added to ensure that queries are uncached. 

Props Spacedmonkey, boonebgorges, flixos90, peterwilsoncc. 
Fixes #36949. 

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


git-svn-id: http://core.svn.wordpress.org/trunk@52510 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-11 11:07:05 +00:00
jorgefilipecosta
28b6093061 Block Editor: Improve Global Styles filtering order.
From the conceptual point it makes sense to execute global styles filters before post filters. So the post filters are always the last.

Props xknown, sergey, audrasjb, vortfu, oandregal, get_dave.
Built from https://develop.svn.wordpress.org/trunk@52895


git-svn-id: http://core.svn.wordpress.org/trunk@52484 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 23:27:04 +00:00
davidbaumwald
8cda35ebd3 Privacy: Fix "Retry" action after a personal data export failure.
When exporting personal data for a user request, if the export fails for any reason, a "Retry" link is displayed inline.  However, up to this point, clicking this link performed no action.  This change adds the `export-personal-data-handle` CSS class to the link to make sure it's picked up by the same delegated listener as the initial action.  Clicking this link will now retry the export.

Props hellofromTonya, nomnom99, rafiahmedd, SergeyBiryukov, hasanuzzamanshamim.
Fixes #53032.
Built from https://develop.svn.wordpress.org/trunk@52846


git-svn-id: http://core.svn.wordpress.org/trunk@52435 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 19:22:01 +00:00
audrasjb
95d72f2207 jquery-query
Built from https://develop.svn.wordpress.org/trunk@52844


git-svn-id: http://core.svn.wordpress.org/trunk@52433 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 18:54:02 +00:00
davidbaumwald
8fdb20e0f8 Media: Note ClipboardJS as a global in /js/_enqueues/admin/media.js.
Follow-up to [52842].

See #54426.
Built from https://develop.svn.wordpress.org/trunk@52843


git-svn-id: http://core.svn.wordpress.org/trunk@52432 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 18:43:02 +00:00
davidbaumwald
658f4e9367 Media: Add a "Copy URL to clipboard" function to the list table view.
Previously, a button was added to the modal view for a single media item in the "grid" view to copy the file URL to the user's clipboard.  This change adds a similar function to the "list" view for each media item.

Follow-up to [48232].

Props pbiron, ravipatel, alexstine, afercia.
Fixes #54426.
Built from https://develop.svn.wordpress.org/trunk@52842


git-svn-id: http://core.svn.wordpress.org/trunk@52431 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 18:24:03 +00:00
Sergey Biryukov
c771c6a79d Quick/Bulk Edit: Check the show_in_quick_edit taxonomy property when populating the data for the posts list table.
Previously, setting the `show_in_quick_edit` property to `false` removed the taxonomy from the inline edit form, but the terms were still being populated in the data for each table row via the `get_inline_data()` function, which only checked the `$taxonomy->show_ui` property.

This commit:
* Improves performance by ensuring that taxonomy terms are not unnecessarily populated for each table row when `show_in_quick_edit` is `false`.
* Properly populates the taxonomy terms when `show_in_quick_edit` is `true` and `show_ui` is `false`.

Follow-up to [31307].

Props jazbek, figureone, sabernhardt, ovidiul, webcommsat, SergeyBiryukov.
Fixes #42916, #49701.
Built from https://develop.svn.wordpress.org/trunk@52841


git-svn-id: http://core.svn.wordpress.org/trunk@52430 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 18:22:01 +00:00
davidbaumwald
12134c3435 Coding Standards: Fix minor alignment issue in wp_ajax_install_theme().
Follow-up to [52819].

See #54728.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52429 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 17:32:03 +00:00
hellofromTonya
2c9525edc3 Build/Test Tools: Add trash and restore of a single post e2e tests.
Adds an end-to-end (e2e) test case for:
* Emptying a post from the trash.
* Restoring a post from the trash.

Props pavanpatil1, pooja1210, justinahinon, kevin940726.
Fixes #54843.
Built from https://develop.svn.wordpress.org/trunk@52839


git-svn-id: http://core.svn.wordpress.org/trunk@52428 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 16:28:03 +00:00
hellofromTonya
d1565514e4 HTTP API: Fix typo in and improve readability of wp_parse_url() docblock.
Removes the "starting" word from "starting containing" as this is a typo. Includes minor formatting adjustments to improve readability.

Follow-up to [38726].

Props mehedi890, SergeyBiryukov, mukesh27.
Fixes #55355.
Built from https://develop.svn.wordpress.org/trunk@52838


git-svn-id: http://core.svn.wordpress.org/trunk@52427 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 16:02:01 +00:00
spacedmonkey
bbf017e550 Media: Store attachment’s file size in metadata.
Store the file size of all newly uploaded attachments, as part of the metadata stored in post meta. Storing file size means, developers will not have to resort to doing `filesize` function calls, that can be time consuming on assets on offloaded to services like Amazon’s S3. 

This change also introduces a new helper function called, `wp_filesize`. This is a wrapper around the `filesize` php function, that adds some helpful filters and ensures the return value is an integer.

Props Cybr, Spacedmonkey, SergeyBiryukov, johnwatkins0, swissspidy, desrosj, joemcgill, azaozz, antpb, adamsilverstein, uday17035. 
Fixes #49412. 


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


git-svn-id: http://core.svn.wordpress.org/trunk@52426 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 13:10:02 +00:00
spacedmonkey
8771a658ad Taxonomy: Only store term_ids and object_ids in WP_Term_Query query caches.
The query cache currently implemented in `WP_Term_Query` caches the final output of the query, depending on what fields are requested. This is wasteful, as if a user requests `fields` => `all`, then an unlimited array of `WP_Term` objects could be stored in the object cache. Instead of storing the whole WP_Term object, this change only the term_id is stored. To get an array the full WP_Term objects, the `_prime_term_caches` function is called with an array of ids. In instances where a persistent object cache is not in use, then this will result in another SQL query to be run. After `_prime_term_caches` is called if this term is requested again in the same page load, then it will already be loaded into memory.  If a user runs `WP_Term_Query` with the fields param set to `all_with_object_id`, an array of objects containing both the term_id and object_ids are stored in cache. 

This change also improves the logic to load term meta caches. This change ensures that term meta is always primed for all terms loaded in the term query. 

Props Spacedmonkey, boonebgorges, jbpaul17, peterwilsoncc, flixos90, pbearne.
Fixes #37189.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52425 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 10:58:09 +00:00
Peter Wilson
fa364267d4 Twenty Twenty-One: Reverse logic for prefers-reduced-motion media query.
Reverse the logic of the `prefers-reduced-motion` to enable transitions based on `no-preference` rather than disable them based on the `reduce` preference. This removes the need to disable transitions with the `! important` tag and unintended interactions with plugins as a result.

Props gregoiresailland, sabernhardt, ryokuhi.
Fixes #54174.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52424 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 05:21:03 +00:00
Peter Wilson
8752a2392a Sitemaps: Pass term object to wp_sitemaps_taxonomies_entry filter.
Add a forth parameter to the `wp_sitemaps_taxonomies_entry` filter to pass the entire `WP_Term` object. 

Correct the documentation for the second parameter of the `wp_sitemaps_taxonomies_entry` filter to indicate it is a term ID rather than term object.

Props RavanH, swissspidy, audrasjb.
Fixes #55239.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52423 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 04:01:05 +00:00
Sergey Biryukov
a1d974a2e1 Canonical: Check if the URL scheme exists in strip_fragment_from_url().
This avoids an "Undefined index" PHP notice when a schemeless URI is passed.

Props dd32, SergeyBiryukov.
Fixes #55333.
Built from https://develop.svn.wordpress.org/trunk@52833


git-svn-id: http://core.svn.wordpress.org/trunk@52422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-09 15:08:06 +00:00
Peter Wilson
a793be201b Media: Revert query string support for wp_check_filetype().
Revert [52829] due to fatal errors in some Multisite configurations.

Props dd32, SergeyBiryukov, audrasjb.
See #30377.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52421 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-09 00:48:05 +00:00
Sergey Biryukov
ac9f203a88 REST API: Correct the wording for show_in_nav_menus property description in post type visibility settings.
Follow-up to [51959].

Props pedromendonca.
Fixes #55340.
Built from https://develop.svn.wordpress.org/trunk@52831


git-svn-id: http://core.svn.wordpress.org/trunk@52420 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-08 14:51:07 +00:00
Peter Wilson
1b72380e10 Taxonomy: Improve code quality within _prime_term_caches().
Remove the second parameter on the call to `update_term_cache()` from within the function `_prime_term_caches()`. The since deprecated parameter of the former was at one point a string, never a boolean.

Props david.binda, SergeyBiryukov, azouamauriac.
Fixes #55162.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-08 04:25:06 +00:00
audrasjb
28f7345fce Media: Allow wp_check_filetype() to support query strings in URLs.
This changeset adjusts the regex in `wp_check_filetype()` to support query strings in URLs.

Follow-up to [30640], [32172].

Props voldemortensen, johnbillion, layotte, dd32, atomicjack, supercleanse, spencercameron, ianmjones, audrasjb.
Fixes #30377.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52418 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-07 22:52:05 +00:00
Sergey Biryukov
2399966d8c Themes: Correct the logic for displaying a _doing_it_wrong() notice for add_theme_support( 'html5' ).
* Calling `add_theme_support( 'html5' )` without passing an array of supported types should throw a `_doing_it_wrong()` notice: "You need to pass an array of types".
* If the second parameter is not specified, it should fall back to an array of `comment-list`, `comment-form`, and `search-form` for backward compatibility.
* If the second parameter is not an array, the function should return `false`.

The latter two points are covered by existing unit tests. The first one is now addressed by `@expectedIncorrectUsage`.

Follow-up to [25193], [25235], [25785].

Props audrasjb, peterwilsoncc, SergeyBiryukov.
Fixes #51657.
Built from https://develop.svn.wordpress.org/trunk@52828


git-svn-id: http://core.svn.wordpress.org/trunk@52417 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-07 14:44:01 +00:00
audrasjb
f33f3979ca Docs: Use third-person singular verbs for function descriptions in wp-includes/class-wp-user.php.
Props azouamauriac.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52416 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-07 13:07:03 +00:00
audrasjb
e6e88f4a2b Docs: Correct the indentation in delete_term_relationships filter.
See #54673.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52415 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-07 12:57:05 +00:00
Peter Wilson
f3d929163f General: Improve MS Edge user-agent sniff.
Update the `$is_edge` global to be `true` if the browser's user-agent contains `Edg` rather than `Edge`. Microsoft have dropped an E from the UA string.

Refer to [https://docs.microsoft.com/en-us/microsoft-edge/web-platform/user-agent-guidance#identifiers-for-microsoft-edge-on-various-platforms Microsoft's documentation on detecting edge].

Props costdev, abdullahramzan, mukesh27, Boniu91.
Fixes #55297.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52414 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-07 02:38:01 +00:00
Sergey Biryukov
c274ea83f3 Tests: Restore the original user role in the (add|remove)_user_role hooks test.
This makes sure the test does not unintentionally affect other tests.

Follow-up to [52823].

Fixes #54164.
Built from https://develop.svn.wordpress.org/trunk@52824


git-svn-id: http://core.svn.wordpress.org/trunk@52413 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-06 23:04:01 +00:00
Sergey Biryukov
78911c2f60 Users: Bring some consistency to user role hooks.
This standardizes the actions that one needs to hook to for tracking user role changes:

* `add_user_role` is only fired when the user has actually gained a new role.
* `remove_user_role` is only fired when the role was actually removed.

Both actions are now fired in `WP_User::set_role()` as appropriate.

Props dd32, SergeyBiryukov.
Fixes #54164.
Built from https://develop.svn.wordpress.org/trunk@52823


git-svn-id: http://core.svn.wordpress.org/trunk@52412 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-06 16:11:04 +00:00
Sergey Biryukov
4ae0744585 Query: Make sure WP_Query::get_queried_object() works for author_name before ::get_posts() is run.
Previously, the queried object with author data was not available before the posts loop when `author_name` is used in the query instead of `author`. With block themes, this use case appears to be more common to display the author name in the header.

This commit adjusts the logic in `WP_Query::get_queried_object()` to fall back to the `author_name` field if `author` is not present, similar to how taxonomy slugs are handled.

Follow-up to [1728], [3290], [10992].

Props dd32, swissspidy, SergeyBiryukov.
Fixes #55100.
Built from https://develop.svn.wordpress.org/trunk@52822


git-svn-id: http://core.svn.wordpress.org/trunk@52411 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-05 15:35:04 +00:00
Sergey Biryukov
c17ccc5490 Docs: Add inline comments for non-visible characters in sanitize_title_with_dashes().
This aims to clarify the list of characters that are stripped from URLs or converted to a hyphen.

Follow-up to [51984].

See #47912, #54729.
Built from https://develop.svn.wordpress.org/trunk@52821


git-svn-id: http://core.svn.wordpress.org/trunk@52410 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-04 14:11:02 +00:00
audrasjb
318205d459 Coding Standards: Improve formatting in /wp-admin/user-edit.php.
This change improves the formatting of `/wp-admin/user-edit.php` to avoid PHPCS failures when adding new code, which previously required new code to be indented multiple times, breaking alignment of the HTML parts. This change avoids disabling/enabling PHPCS for failing sniffs.

Props costdev, johnregan3, peterwilsoncc.
Fixes #54673.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52409 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-04 11:29:04 +00:00
Peter Wilson
8db01b9c6b Themes: Hide block themes' live preview link following installation.
Prevent the Customizer/Live Preview button from showing for installed block themes when on the theme installation page.

Props antonvlasenko, costdev, ironprogrammer.
Fixes #54878.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52408 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-04 02:39:03 +00:00
davidbaumwald
66ed09edeb Comments: Guard against potential PHP notices in get_comment_author and get_comment_ID.
In both `get_comment_author` and `get_comment_ID`, it's possible that these functions are called without a comment context.  Specifically, `get_comment_author` can be called without passing the `$comment_ID` parameter, and `get_comment_ID` relies on the `comment` global if there's no `$comment` parameter supplied.  This leads to a PHP notice of "Trying to get property of a non-object."

This change adds a check to both functions to ensure the `$comment->comment_ID` property is not empty before actually using its value.

Follow-up to [52223].

Props dd32.
Fixes #54379.
Built from https://develop.svn.wordpress.org/trunk@52818


git-svn-id: http://core.svn.wordpress.org/trunk@52407 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-03 20:33:59 +00:00
Sergey Biryukov
d71c435a82 Docs: Update the DocBlock for the wpmu_new_blog action to suggest wp_initialize_site as an alternative.
Follow-up to [43654], [52816].

See #49612.
Built from https://develop.svn.wordpress.org/trunk@52817


git-svn-id: http://core.svn.wordpress.org/trunk@52406 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-03 16:13:03 +00:00
Sergey Biryukov
b009374817 Networks and Sites: Suggest wp_initialize_site as an alternative for the deprecated wpmu_new_blog action.
The previously suggested alternative, `wp_insert_site`, does not get passed enough arguments and runs before the new site initialization routine is actually executed.

Follow-up to [43654].

Props asaquzzaman, henry.wright, MadtownLems.
Fixes #49612.
Built from https://develop.svn.wordpress.org/trunk@52816


git-svn-id: http://core.svn.wordpress.org/trunk@52405 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-03 15:58:03 +00:00
Sergey Biryukov
cc5bacb4e4 Docs: Add a @since note for WP::parse_request() about the new return value.
Includes minor code layout fixes for consistency. Additionally, this moves a more general unit test above the more specific one.

Follow-up to [52814].

See #10886.
Built from https://develop.svn.wordpress.org/trunk@52815


git-svn-id: http://core.svn.wordpress.org/trunk@52404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-02 15:40:01 +00:00
spacedmonkey
01040717aa Bootstrap/Load: Stop unnecessary queries when using the do_parse_request filter.
Developers of plugins and themes can use the `do_parse_request` filter to hot-wire requests and hook in early to render custom pages. However, even through these request may not need post queries and 404 lookups to be run, they run anyway. This can results in unnecessary SQL queries running on these requests. By adding a return value to the `parse_request` method of the `WP` class, these queries can now be skipped. 

Props junsuijin, ryan, westi, sivel, dd32, wonderboymusic, arnee, tyxla, DrewAPicture, lukecavanagh, SergeyBiryukov, davidbaumwald, Spacedmonkey, pbearne.
Fixes #10886.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52403 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-02 15:12:02 +00:00
Sergey Biryukov
f891f6f0c6 Administration: Require a valid action parameter to be set for admin-ajax.php requests.
This avoids `Array to string conversion` PHP notices when an array is passed as the `action` parameter.

Additionally, send an appropriate HTTP response status code when an invalid action is passed to `admin-post.php`.

Follow-up to [13175], [19738], [41120], [41926].

Props dd32.
Fixes #55212.
Built from https://develop.svn.wordpress.org/trunk@52813


git-svn-id: http://core.svn.wordpress.org/trunk@52402 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-02 15:00:11 +00:00
Sergey Biryukov
257b634b92 Themes: Make sure the current_theme_supports-{$feature} filter is consistently applied.
Previously, the filter was not applied if there are no arguments passed to `current_theme_supports()`.

Follow-up to [12350], [19682].

Props helgatheviking, azouamauriac, pavanpatil1, SergeyBiryukov.
Fixes #55219.
Built from https://develop.svn.wordpress.org/trunk@52812


git-svn-id: http://core.svn.wordpress.org/trunk@52401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-01 16:07:05 +00:00
Sergey Biryukov
4789371cfe External Libraries: Upgrade PHPMailer to version 6.6.0.
This is a minor feature release.

> Prior to this version, any OAuth provider needed to extend the provided `OAuth` base class, and this made it difficult to use with libraries other than ones based on the default [https://github.com/thephpleague/oauth2-client league] client packages. The OAuth property now accepts anything that implements the `OAuthProviderInterface`, making it much easier to use things like [https://github.com/googleapis/google-api-php-client Google's own OAuth classes]. Existing implementations that extend the provided `OAuth` base class will still work, as that base class now implements this interface too.
>
> When TLS errors occurred in PHPMailer, the error messages were often missing important info that might help diagnose/solve the problem. These error messages should now be more informative. A minor change is that a TLS error on SMTP connect will now throw an exception if exceptions are enabled.

Release notes:
https://github.com/PHPMailer/PHPMailer/releases/tag/v6.6.0

For a full list of changes in this update, see the PHPMailer GitHub:
https://github.com/PHPMailer/PHPMailer/compare/v6.5.4...v6.6.0

Follow-up to [50628], [50799], [51169], [51634], [51635], [52252], [52749].

Props jrf, Synchro, miken32.
Fixes #55277.
Built from https://develop.svn.wordpress.org/trunk@52811


git-svn-id: http://core.svn.wordpress.org/trunk@52400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-28 21:38:09 +00:00
Sergey Biryukov
e32e1750fd Docs: Use third-person singular verbs for function descriptions in wp-includes/formatting.php, per the documentation standards.
See #54729.
Built from https://develop.svn.wordpress.org/trunk@52810


git-svn-id: http://core.svn.wordpress.org/trunk@52399 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-28 16:03:00 +00:00
Sergey Biryukov
d0fb86dafb I18N: Add a $locale parameter for remove_accents().
This highlights the fact that `remove_accents()` is locale-aware and makes it easier to utilize the function with different locales without having to use `switch_to_locale()` or the `locale` filter.

Additionally, this commit relaxes the check for character replacements in German locales to include formal and informal variants of any `de_*` locale, even if WordPress does not have a native translation for some of them yet.

Props malthert, johnbillion, knutsp, ocean90, SergeyBiryukov.
Fixes #54415.
Built from https://develop.svn.wordpress.org/trunk@52809


git-svn-id: http://core.svn.wordpress.org/trunk@52398 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-28 15:42:05 +00:00
audrasjb
7e2b01d127 Administration: Consistency fixes on keyboard shortcuts instructions.
This changeset capitalizes the letter of keyboard shortcuts and replaces `CTRL` with `Ctrl`, for better consistency.

Props Presskopp, sabernhardt, joyously, SergeyBiryukov, audrasjb.
Fixes #40582.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-27 22:49:01 +00:00
Sergey Biryukov
01d22d18e6 Filesystem API: Include the ssh-ed25519 public key signature algorithm as an alternative to ssh-rsa.
The `ssh-rsa` signature algorithm is disabled by default as of OpenSSH 8.8, which breaks SSH2 uploads in WordPress on modern systems. `ssh-ed25519` is one of the suggested alternatives, supported since OpenSSH 6.5.

References:
* [https://www.openssh.com/txt/release-8.2 OpenSSH 8.2 release notes]
* [https://www.openssh.com/txt/release-8.7 OpenSSH 8.7 release notes]
* [https://www.openssh.com/txt/release-8.8 OpenSSH 8.8 release notes]

Follow-up to [8865].

Props richybkreckel, dd32.
Fixes #52409.
Built from https://develop.svn.wordpress.org/trunk@52807


git-svn-id: http://core.svn.wordpress.org/trunk@52396 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-27 15:02:04 +00:00
joedolson
1da8de78da Media: Use consistent mirroring check in media views.
Change the mirroring property verification method to be consistent with other usages across models and attachments, since we don't care whether it's assigned directly on inherited.

Props MMDeveloper, SergeyBiryukov.
Fixes #53856.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52395 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-27 00:56:00 +00:00
Sergey Biryukov
d143c7c47e Query: Correct the "matched rule" condition in WP::parse_request().
The `WP::$matched_rule` property is always set now, so we should check that it's not empty instead.

Follow-up to [52804].

See #55222.
Built from https://develop.svn.wordpress.org/trunk@52805


git-svn-id: http://core.svn.wordpress.org/trunk@52394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-26 14:34:01 +00:00
Sergey Biryukov
a47961e80e Query: Preinitialize the WP class properties to their default values.
This avoids an `array_keys() expects parameter 1 to be array, null given` PHP warning for the `query_vars` property in `WP::build_query_string()` when disabling request parsing via the `do_parse_request` filter.

Props dd32, SergeyBiryukov.
Fixes #55222.
Built from https://develop.svn.wordpress.org/trunk@52804


git-svn-id: http://core.svn.wordpress.org/trunk@52393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-26 14:28:01 +00:00
audrasjb
e89229886b Themes: Remove the Live Preview link when installing a block theme from a zip archive.
This changeset removes the Live Preview link for block-based themes when installing for a zip archive, since the customizer is disabled by default for block themes.

Follow-up to [52353].

Props alanjacobmathew, hellofromTonya, antonvlasenko, ironprogrammer.
Fixes #54578.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52391 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-26 08:16:02 +00:00
audrasjb
f1d4f7f0f7 Administration: Further enhancements on small text fields after [52649].
This changeset replaces `#mailserver_port` to a more generic selector, fixes a coding standard issue, and adds a bigger margin to the field.

Follow-up to [52649].

Props SergeyBiryukov, kebbet, pyrobd.
Fixes #50177.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52390 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-25 15:49:02 +00:00
Sergey Biryukov
7c2fcae011 Tests: Rename the $success variable to $result in the wp_mail() test for an empty home URL.
The previously name could be a bit confusing if the function is expected to fail.

Follow-up to [52799].

See #54730.
Built from https://develop.svn.wordpress.org/trunk@52800


git-svn-id: http://core.svn.wordpress.org/trunk@52389 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-25 14:09:59 +00:00
Sergey Biryukov
c2d8b48d97 Code Modernization: Check the return type of wp_parse_url() in wp_mail().
As per the PHP manual:
> If the `component` parameter is omitted, an associative array is returned.
> If the `component` parameter is specified, `parse_url()` returns a string (or an int, in the case of `PHP_URL_PORT`) instead of an array. If the requested component doesn't exist within the given URL, `null` will be returned.

Reference: [https://www.php.net/manual/en/function.parse-url.php#refsect1-function.parse-url-returnvalues PHP Manual: parse_url(): Return Values]

In PHP 8.1, if the home URL does not have a "host" component, it would lead to a `substr(): Passing null to parameter #1 ($string) of type string is deprecated` notice.

Changing the logic around and adding validation for the return type value of `wp_parse_url()` prevents that.

Follow-up to [48601], [51606], [51622], [51626], [51629], [51630].

Props dennisatyoast, jrf.
See #54730.
Built from https://develop.svn.wordpress.org/trunk@52799


git-svn-id: http://core.svn.wordpress.org/trunk@52388 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-25 13:48:00 +00:00
Sergey Biryukov
7d6885bc51 Tests: Add a @ticket reference for the current_theme_supports-{$feature} filter test.
Follow-up to [19682], [495/tests].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-25 13:09:00 +00:00
audrasjb
b26449d863 Media: Make get_post_galleries() only return galleries.
This change makes sure only gallery content is returned by `get_post_galleries()`. It fixes an issue where non gallery block content was also returned by the function.

Props BinaryMoon, costdev, glendaviesnz.
Fixes #55203.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-25 12:44:04 +00:00
spacedmonkey
2ae4784ca0 REST API: Pass WP_REST_Request object to the rest_index filter.
Props johnregan3, TimothyBlynJacobs, Spacedmonkey, hasanuzzamanshamim.
Fixes #48638. 

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


git-svn-id: http://core.svn.wordpress.org/trunk@52385 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-24 22:36:01 +00:00
audrasjb
631f08096b Docs: Correct return type for get_post_custom().
Props chouby, audrasjb.
Fixes #55249.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52384 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-24 21:26:02 +00:00
Sergey Biryukov
446c2afdc3 Docs: Add missing descriptions for some parameters of WP_Walker::paged_walk().
Props bhrugesh12.
Fixes #55225.
Built from https://develop.svn.wordpress.org/trunk@52794


git-svn-id: http://core.svn.wordpress.org/trunk@52383 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-24 13:33:01 +00:00
audrasjb
401e5d7175 Docs: Correct return type for get_block_metadata_i18n_schema().
Props jeremyfelt.
Fixes #55243.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52382 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-24 08:27:09 +00:00
joedolson
654d1477a9 Media: Stop arrow keys switching media if URL focused.
Keyboard handlers were prevented from navigating attachments in input fields, but the key handler excluded readonly fields, like the media URL field. This could prevent exploring the URL using the keyboard.

Props jrivett, joemcgill, afercia.
Fixes #43202.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52381 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-24 04:35:04 +00:00
audrasjb
4237c0a88b Themes: Avoid undefined variable warning on get_svg_filters().
This change fixes an undefined variable warning thrown when `duotone` color setting was set to null` in Block Themes `theme.json` file.

Follow-up to [52768].

Props aliakseyenkaihar, audrasjb, rafiahmedd.
Fixes #55241.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52380 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-23 23:17:01 +00:00
audrasjb
76e93c5d5f Plugins: Add focus style to plugin icon link in plugin cards.
This change adds a blue focus outline to the icon on plugin cards, for consistency with the text part of the link.

Props hitendra-chopda, SergeyBiryukov, afercia, themattroyal, imokol, sabernhardt, audrasjb.
Fixes #45209.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52379 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-23 21:20:06 +00:00
hellofromTonya
1f56c94459 Formatting: Make terms in wpautop() and shortcode_unautop() more welcoming and inclusive.
The developer facing humor in these functions were from a different era of WordPress. Tolerance for in-jokes and other developer facing humor has decreased over the years. Terms like "pee" and "tinkle" may make some folks chuckle while for others it makes them uncomfortable.

Terminology of the past is being (or has been) re-evaluated to transform words into a language that are inclusive and welcome for all. This commit is part of that effort as it replaces.

Follow-up [13], [9255].

Props ricomoorman, tzipporahwitty, ironprogrammer, peterwilsoncc, jeremyfelt, Viper007Bond, rmccue, SergeyBiryukov, hellofromTonya.
Fixes #25615.
Built from https://develop.svn.wordpress.org/trunk@52789


git-svn-id: http://core.svn.wordpress.org/trunk@52378 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-23 20:03:09 +00:00
audrasjb
2ac7dcd043 Help/About: Revert [52783].
Point releases about page changelog should not be committed to trunk. This changeset reverts [52783].

Unprops audrasjb.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52373 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-22 11:01:11 +00:00
audrasjb
9ce0a583a1 Help/About: Update the About page for WordPress 5.9.1.
Props hellofromTonya, audrasjb.
Fixes #55173.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52372 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-22 10:33:08 +00:00
audrasjb
53590e7cdc Twenty Twenty-Two: Bump theme version to 1.1.
This change bumps the version of the Twenty Twenty-Two bundled theme in preparation for release with WordPress 5.9.1.

Props peterwilsoncc, petaryoast, audrasjb, SergeyBiryukov, rafiahmedd.
Fixes #55056.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52370 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-21 20:55:02 +00:00
Sergey Biryukov
93e373b7be Docs: Use third-person singular verbs in some test descriptions in phpunit/tests/functions/.
Follow-up to [42971], [45371], [46159], [46175], [47779], [50962], [50964], [51910], [52778].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52369 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-21 14:52:06 +00:00
Sergey Biryukov
5040303d1a Docs: Fix typo in TracTickets::isTracTicketClosed() description.
Follow-up to [761/tests], [762/tests], [891/tests].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52368 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-20 10:14:04 +00:00
Sergey Biryukov
9253edeff3 Tests: Convert _wp_to_kebab_case() tests to use a data provider.
Follow-up to [51198], [51225].

See #54725.
Built from https://develop.svn.wordpress.org/trunk@52778


git-svn-id: http://core.svn.wordpress.org/trunk@52367 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-19 13:45:00 +00:00
Sergey Biryukov
38770aaf48 Docs: Correct parameter types for data_wp_validate_boolean().
Follow-up to [46159], [46224], [52775], [52776].

See #54725, #54729.
Built from https://develop.svn.wordpress.org/trunk@52777


git-svn-id: http://core.svn.wordpress.org/trunk@52366 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-19 13:26:58 +00:00
Sergey Biryukov
e7eda56175 Docs: Improve some DocBlocks in wp_validate_boolean() tests for consistency.
Follow-up to [46159], [46224], [52775].

See #54725, #54729.
Built from https://develop.svn.wordpress.org/trunk@52776


git-svn-id: http://core.svn.wordpress.org/trunk@52365 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-19 13:02:00 +00:00
Sergey Biryukov
72373078d1 Tests: Correct the order of expected and actual values in wp_validate_boolean() tests.
This corrects the order of the parameters when used in assertions so if/when they fail the failure message is correct.

Additionally, this commit moves the test function before the data provider, for consistency with other tests.

Follow-up to [46159], [46224].

See #54725.
Built from https://develop.svn.wordpress.org/trunk@52775


git-svn-id: http://core.svn.wordpress.org/trunk@52364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-19 12:42:01 +00:00
Sergey Biryukov
b7af78c1ce Tests: Correct the order of expected and actual values in wp_array_slice_assoc() tests.
This corrects the order of the parameters when used in assertions so if/when they fail the failure message is correct.

Follow-up to [45371].

See #54725.
Built from https://develop.svn.wordpress.org/trunk@52774


git-svn-id: http://core.svn.wordpress.org/trunk@52363 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-19 12:39:59 +00:00
Sergey Biryukov
bb395f9450 Tests: Correct the order of expected and actual values in get_status_header_desc() tests.
This corrects the order of the parameters when used in assertions so if/when they fail the failure message is correct.

Follow-up to [46107].

See #54725.
Built from https://develop.svn.wordpress.org/trunk@52773


git-svn-id: http://core.svn.wordpress.org/trunk@52362 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-19 12:38:05 +00:00
spacedmonkey
7a48bab20c Cache API: Add wp_cache_flush_runtime function
Add a new function called `wp_cache_flush_runtime` to existing caching functions found in WordPress. This function allows users to flush the runtime (in-memory) cache, without flushing the entire persistent cache. 

Props: Spacedmonkey, tillkruess, flixos90, adamsilverstein, SergeyBiryukov, barryhughes. 
Fixes: #55080.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52361 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-18 12:06:03 +00:00
hellofromTonya
76207c890b Editor: Automatically apply global styles duotone filters to render in post editor.
Global styles duotone filters were not rendering in the post editor. This fixes that by adding `wp_global_styles_render_svg_filters` to the `in_admin_header` so it renders in the body before the editor.

Follow-up [52757].

Props ajlende, abhanonstopnewsuk.
Fixes #55190.
Built from https://develop.svn.wordpress.org/trunk@52768


git-svn-id: http://core.svn.wordpress.org/trunk@52357 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 20:45:00 +00:00
audrasjb
d8b1150a4a Editor: Update block editor packages for WordPress 5.9.1.
The following packages were updated:

- @wordpress/block-directory@3.0.27
- @wordpress/block-editor@8.0.17
- @wordpress/block-library@6.0.26
- @wordpress/components@19.2.3
- @wordpress/core-data@4.0.10
- @wordpress/customize-widgets@2.0.27
- @wordpress/e2e-tests@2.5.18
- @wordpress/edit-post@5.0.27
- @wordpress/edit-site@3.0.27
- @wordpress/edit-widgets@3.1.22
- @wordpress/editor@12.0.21
- @wordpress/format-library@3.0.23
- @wordpress/interface@4.1.18
- @wordpress/list-reusable-blocks@3.0.20
- @wordpress/nux@5.0.20
- @wordpress/reusable-blocks@3.0.23
- @wordpress/server-side-render@3.0.20
- @wordpress/widgets@2.0.23

Props Mamaduka.
See #55179.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52354 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 19:18:25 +00:00
hellofromTonya
2b94ffdbc9 Editor: Adds an additional check to guard against incompete presets.
Adds an additional guard to ensure the value of `$preset_metadata['value_key']` actually exists as a key in the `$preset` array. Fixes `Warning: Undefined array key` error. 

Intentionally adds the check into the existing `isset()` as it's native to PHP, more efficient, and a good pattern.

Follow-up [52049].

Props jeherve, swissspidy, sergeybiryukov, jrf.
Fixes #55161.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52352 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 18:47:02 +00:00
Sergey Biryukov
8f904628e9 Tests: Correct the @ticket reference in a download_url() test with the Content-Disposition header.
Move the data provider next to the test, for consistency.

Follow-up to [51939], [52734].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52349 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 17:40:02 +00:00
audrasjb
26667ab0e1 Editor: Backport Duotone fixes for 5.9.1.
This changeset is a backport for the following Gutenberg PRs:

- Fix duotone theme cache gutenberg#36236
- Fix duotone render in non-fse themes gutenberg#37954
- Duotone: Allow users to specify custom filters gutenberg#38442

Props oandregal, scruffian, Mamaduka.
See #55179.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52346 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 16:18:03 +00:00
hellofromTonya
9ac43b6ade Editor: Grant only admins access to the "Navigation Menus" UI for block and non-block themes.
Restricts and grants access to only admin roles for the Navigation Menu UI screen, i.e. either directly through the URL wp-admin/edit.php?post_type=wp_navigation or via the Navigation block's "Manage menu" option (in the block's toolbar).

It resolves 2 issues:

- For non-block themes, fixes the issue where admins could not access the UI.
- For block themes, restricts access to only admin roles, i.e. non-admins no longer have access to the UI.

Non-admins will receive the "Sorry, you are not allowed to edit posts in this post type" error message.

Follow-up [52069], [52145], [52330], [52400].

Props ironprogrammer, costdev, noisysocks, talldanwp, hellofromTonya, manfcarlo, pyrobd.
Fixes #54889.
Built from https://develop.svn.wordpress.org/trunk@52755


git-svn-id: http://core.svn.wordpress.org/trunk@52344 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 15:11:01 +00:00
Dominik Schilling
f42e80b077 Script Loader: Prevent normalizing data URIs in _wp_normalize_relative_css_links().
This prevents making data URIs as in `mask-image:url('data:image/svg+xml;utf8,<svg...` relative to the WordPress installation.

Props staatic.
See #54243.
Fixes #55177.
Built from https://develop.svn.wordpress.org/trunk@52754


git-svn-id: http://core.svn.wordpress.org/trunk@52343 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 14:47:04 +00:00
jorgefilipecosta
007dec9ec6 Global Styles: Load the global styles before the theme styles in the editor.
This commit makes the site editor follow what we do in the front-end, where theme styles are loaded after global styles by default.

Props oandregal, ntsekouras.
Fixes #55188.
Built from https://develop.svn.wordpress.org/trunk@52752


git-svn-id: http://core.svn.wordpress.org/trunk@52341 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 14:14:01 +00:00
jorgefilipecosta
95bbd4c7d1 Global Styles: Fix PHP warning in WP_REST_Global_Styles_Controller if no styles exist.
There is a PHP warning in WP_REST_Global_Styles_Controller because we are assuming that every theme.json has styles property, which is not always the case.

Props ntsekouras.
Fixes #54900.
Built from https://develop.svn.wordpress.org/trunk@52750


git-svn-id: http://core.svn.wordpress.org/trunk@52339 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 13:47:59 +00:00
Sergey Biryukov
c70e24e0ab External Libraries: Upgrade PHPMailer to version 6.5.4.
The latest release includes some minor PHP cross-version improvements and a safeguard against hosters disabling security functions. Note to hosting providers: don't disable `escapeshellarg()` and `escapeshellcmd()`; it's not safe!

Release notes:
https://github.com/PHPMailer/PHPMailer/releases/tag/v6.5.4

For a full list of changes in this update, see the PHPMailer GitHub:
https://github.com/PHPMailer/PHPMailer/compare/v6.5.3...v6.5.4

Follow-up to [50628], [50799], [51169], [51634], [51635], [52252].

Props jrf, Synchro.
Fixes #55187.
Built from https://develop.svn.wordpress.org/trunk@52749


git-svn-id: http://core.svn.wordpress.org/trunk@52338 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 13:23:04 +00:00
audrasjb
ab2c6d696b Themes: Allow extending WP_Theme_JSON and WP_Theme_JSON_Resolver classes.
This change updates methods visibility from `private` to `protected` and adds late static binding.

Original PRs from Gutenberg repository:
- https://github.com/WordPress/gutenberg/pull/38625
- https://github.com/WordPress/gutenberg/pull/38671

Props oandregal, Mamaduka, kapilpaul.
Fixes #55178.
See #55179.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52333 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 09:04:05 +00:00
jorgefilipecosta
cb3e78b0c3 Script Loader: Improvements to the load block support styles mechanism.
This commit applies feedback given to commit 52741. It changes the new function name, the file where it is located, and improves its documentation and marks.

Follow-up to [52741].
Props hellofromtonya, swissspidy, oandregal.
See #55148.
Built from https://develop.svn.wordpress.org/trunk@52743


git-svn-id: http://core.svn.wordpress.org/trunk@52332 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-16 22:20:01 +00:00
Sergey Biryukov
a5d6245d60 External Libraries: Update random_compat to version 2.0.21.
The latest release includes improved compatibility with PHP 8.1, as well as some bug fixes for Windows platforms.

Release notes:
https://github.com/paragonie/random_compat/releases/tag/v2.0.21

For a full list of changes in this update, see the random_compat GitHub:
https://github.com/paragonie/random_compat/compare/v2.0.11...v2.0.21

Follow-up to [42130].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52331 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-16 21:19:04 +00:00
jorgefilipecosta
a73446f6ed Script Loader: Load block support styles in the head for block themes.
The dynamic block styles for layout and elements should be loaded in the head for block themes. While that should also be the case for classic themes, the current mechanism we use (render_block) does not allow us to do that, hence, this PR doesn't change anything for them and will be loaded the body.

Props oandregal, youknowriad, wpsoul.
Fixes #55148.
Built from https://develop.svn.wordpress.org/trunk@52741


git-svn-id: http://core.svn.wordpress.org/trunk@52330 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-16 17:28:01 +00:00
Sergey Biryukov
a04ccd9c90 Twenty Seventeen: Remove bottom border (box-shadow) from linked images.
Props mikachan, sabernhardt, nidhidhandhukiya, mukesh27, scruffian.
Fixes #55141.
Built from https://develop.svn.wordpress.org/trunk@52740


git-svn-id: http://core.svn.wordpress.org/trunk@52329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-16 13:46:00 +00:00
audrasjb
8f5f8b19c5 Script Loader: Load block themes styles in the head section.
Previously, some logic was added to load the global stylesheet in the bottom of `<body>` for classic themes that opted-in into loading individual block styles instead of a single stylesheet for them all. At the time, block themes always loaded the global stylesheet in the `<head>`. When block themes landed in core during WordPress 5.9 this logic wasn’t updated to consider them, hence the global stylesheet loaded in the `<body>` for them. This changeset fixes this.

Props oandregal, aristath.
Fixes #55148.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52327 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-16 10:36:02 +00:00
audrasjb
ca76abd7e8 Networks and Sites: Remove unnecessary commented code from remove_user_from_blog().
This change removes a call to `wp_revoke_user()` from `remove_user_from_blog()`: this line has been commented out since forever.

Props Faison.
Fixes #55170.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52326 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-15 21:21:00 +00:00
audrasjb
fd752670a2 Administration: Fix a CSS issue on the Welcome Panel when the "Dashboard" heading is missing.
This change adds a CSS exception for when the "Dashboard" heading is missing or located below the Welcome Panel.

Props critterverse, sabernhardt, rolfsiebers, audrasjb.
Fixes #54977.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52324 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-15 18:12:00 +00:00
Clorith
c3ff2a1cc6 Filesystem API: Use a temp folder for Content-Disposition files.
#38231 added support for files fetched remotely to have their filename defined by the host using the `Content-Disposition` header. This would then take priority over the existing temporary file name created with `wp_tempnam()` earlier in the process.

The change unintentionally omitted the temporary directory path used during uploads, since the `wp_tempnam()` function would have added it previously, so that files with this header ended up being stored in the WordPress root folder, or wp-admin folder, when triggered by WP_Cron or user interactions respectively.

This change makes sure the file path includes the temporary directory location when the header is used.

Follow-up to [51939].

Props antonynz, azouamauriac.
Fixes #55109.
Built from https://develop.svn.wordpress.org/trunk@52734


git-svn-id: http://core.svn.wordpress.org/trunk@52323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-15 17:49:00 +00:00
Dominik Schilling
79971103c5 Editor: Prevent front-end assets of a block from being enqueued in the block editor.
Since WordPress 5.9 you can set a view script for a block which is supposed to be only loaded on the front end. Unfortunately it's currently also loaded in the editor which can cause unexpected behaviour and also performance issues depending on the size of the scripts.
This is caused by the preloading of REST API routes via `block_editor_rest_api_preload()` which doesn't happen in an encapsulated process and so does pollute any global state like the one for scripts and styles.
Similar to the global `$post`, core now backups the globals `$wp_scripts` and `$wp_styles` and restores the backup after the preloading.

Props gziolo, ocean90.
Fixes #55151.
Built from https://develop.svn.wordpress.org/trunk@52733


git-svn-id: http://core.svn.wordpress.org/trunk@52322 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-15 17:30:02 +00:00
Sergey Biryukov
fc26a05498 Coding Standards: Rename some variables in iis7_add_rewrite_rule() for consistency.
Follow-up to [52721].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52321 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-15 13:49:04 +00:00
audrasjb
8475350f0e Widgets: Missing markup from Widgets Group block.
This change fixes an issue in the Widgets editor: widgets group was missing a `.wp-widget-group__inner-blocks` container.

Props noisysocks, ironprogrammer.
Fixes #55072.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52319 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-15 09:58:04 +00:00
audrasjb
f4a871189a Twenty Twenty-One: Allow editor styles to control block margins.
This change removes some overrides that prevented site editor updates in 5.9 from controlling vertical margins via `var(--global--spacing-vertical)`.

Props stacimc, Boniu91, aristath, ironprogrammer, nidhidhandhukiya.
Fixes #54250.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52315 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-14 21:55:08 +00:00
Sergey Biryukov
21a51e9993 Media: Display an error message in grid view if the attachment could not be deleted.
Previously, the attachment was silently removed from the grid but reappeared after a page reload.

Follow-up to [22869].

Props kapilpaul, costdev, mukesh27, azouamauriac, SergeyBiryukov.
Fixes #55158.
Built from https://develop.svn.wordpress.org/trunk@52725


git-svn-id: http://core.svn.wordpress.org/trunk@52314 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-14 14:21:05 +00:00
audrasjb
3c27e50dd6 Twenty Fifteen: Add gradient background options using the theme color scheme.
This change implements gradient background options that fit the color scheme used in Twenty Fifteen.

Props ianbelanger, itsamoreh, pls78, audrasjb.
Fixes #49760.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52313 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-13 21:47:01 +00:00
Sergey Biryukov
556d42ac71 Coding Standards: Fix WPCS issues in wp-admin/includes/misc.php.
* Use strict comparison in various conditions.
* Fix a `Variable "$system_webServer_node" is not in valid snake_case format` WPCS warning.

Includes minor code layout fixes for better readability.

Follow-up to [10607], [11350], [22253], [26137].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52310 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-13 17:09:05 +00:00
Sergey Biryukov
77b1aa0cf3 Docs: Fix typo in a comment in wp_get_image_mime().
Follow-up to [39831].

Props dilipbheda.
Fixes #55154.
Built from https://develop.svn.wordpress.org/trunk@52719


git-svn-id: http://core.svn.wordpress.org/trunk@52308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-12 14:45:00 +00:00
Sergey Biryukov
1e1fb78c07 Code Modernization: Use file_get_contents() in wp_get_webp_info().
`file_get_contents()` is faster than `fread()`, because the PHP core can decide how to best read the remaining file; it could decide to issue just one `read()` call or `mmap()` the file first.

Per the PHP manual, `file_get_contents()` or `stream_get_contents()` is the preferred way to read the contents of a file into a string. It will use memory mapping techniques if supported by the OS to enhance performance.

Reference: [https://www.php.net/manual/en/function.file-get-contents.php PHP Manual: file_get_contents()].

Follow-up to [50810], [52696], [52698], [52701].

Props maxkellermann.
See #55069.
Built from https://develop.svn.wordpress.org/trunk@52718


git-svn-id: http://core.svn.wordpress.org/trunk@52307 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-12 13:13:59 +00:00
Sergey Biryukov
c128cd263a Coding Standards: Remove unnecessary try/catch block in wp_get_webp_info().
This appears to be redundant, as none of the functions used inside the block throw an exception.

Follow-up to [50810].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52306 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-12 13:08:01 +00:00
Sergey Biryukov
11691e8207 Docs: Improve @return tags for wp_cache_*_multiple() functions:
* `wp_cache_add_multiple()`
* `wp_cache_set_multiple()`
* `wp_cache_get_multiple()`
* `wp_cache_delete_multiple()`

This aims to provide more details about the returned value types.

Follow-up to [52700], [52702], [52703].

See #54729, #54574.
Built from https://develop.svn.wordpress.org/trunk@52708


git-svn-id: http://core.svn.wordpress.org/trunk@52297 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-11 19:21:01 +00:00
spacedmonkey
a4026420cc Cache: Use wp_cache_*_multiple() in core functions.
Implement the `wp_cache_add_multiple`, `wp_cache_set_multiple` and `wp_cache_delete_multiple` in a number of core functions after they were introduced in [52700]

Props: spacedmonkey, adamsilverstein, flixos90, mitogh.
Fixes: #55029.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52296 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-11 18:51:59 +00:00
Sergey Biryukov
6f3fcdcb4b Cache API: Reorder object cache functions and methods for consistency.
The original order was alphabetical, which became less obvious as newer functions got added, resulting in a somewhat random order.

This commits aims to organize the functions and related `WP_Object_Cache` methods in a more predictable order:

* `wp_cache_init()`
* `wp_cache_add()`
* `wp_cache_add_multiple()`
* `wp_cache_replace()`
* `wp_cache_set()`
* `wp_cache_set_multiple()`
* `wp_cache_get()`
* `wp_cache_get_multiple()`
* `wp_cache_delete()`
* `wp_cache_delete_multiple()`
* `wp_cache_incr()`
* `wp_cache_decr()`
* `wp_cache_flush()`
* `wp_cache_close()`
* `wp_cache_add_global_groups()`
* `wp_cache_add_non_persistent_groups()`
* `wp_cache_switch_to_blog()`
* `wp_cache_reset()`

Follow-up to [3011], [6543], [7986], [13066], [18580], [21403], [47938], [52700], [52703-52705].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52295 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-11 18:49:03 +00:00
Sergey Biryukov
d3f69d117c Docs: Correct the suggested alternative for the deprecated wp_cache_reset() function.
While this was previously added and reverted more than once as part of various documentation cleanup efforts, `wp_cache_switch_to_blog()` appears to be the correct alternative for `wp_cache_reset()`, per the latter's DocBlock.

This commit also corrects the `@deprecated` tag for `WP_Object_Cache::reset()` to link to the `::switch_to_blog()` method of the class, instead of the function of the same name.

Follow-up to [13066], [21403], [22111], [33678], [34225], [34226], [40929].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52294 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-11 18:33:00 +00:00
Sergey Biryukov
42e1bea8f1 Docs: Correct @since tag for wp_cache_reset().
The function was added in WordPress 3.0, not 2.6.

Follow-up to [13066].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52293 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-11 18:05:03 +00:00
Sergey Biryukov
7f36a90e0e Docs: Update DocBlocks for some object cache functions per the documentation standards.
Follow-up to [47060], [47938], [47944], [52700].

See #54729, #54574.
Built from https://develop.svn.wordpress.org/trunk@52703


git-svn-id: http://core.svn.wordpress.org/trunk@52292 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-11 17:44:01 +00:00
Sergey Biryukov
2ca9b92cef Tests: Remove some extra wp_cache_set() calls from wp_cache_set_multiple() test.
These appear to be a copy/paste from the `wp_cache_get_multiple()` test and are not required here.

Follow-up to [47938], [52700].

See #54574.
Built from https://develop.svn.wordpress.org/trunk@52702


git-svn-id: http://core.svn.wordpress.org/trunk@52291 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-11 17:41:01 +00:00
Sergey Biryukov
734960733e Code Modernization: Use file_get_contents() in wp_get_image_mime().
`file_get_contents()` is faster than `fread()`, because the PHP core can decide how to best read the remaining file; it could decide to issue just one `read()` call or `mmap()` the file first.

Per the PHP manual, `file_get_contents()` or `stream_get_contents()` is the preferred way to read the contents of a file into a string. It will use memory mapping techniques if supported by the OS to enhance performance.

Reference: [https://www.php.net/manual/en/function.file-get-contents.php PHP Manual: file_get_contents()].

Follow-up to [50810], [52696], [52698].

Props maxkellermann.
See #55069.
Built from https://develop.svn.wordpress.org/trunk@52701


git-svn-id: http://core.svn.wordpress.org/trunk@52290 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-11 15:50:05 +00:00
spacedmonkey
a3f3c5c959 Cache: Add wp_cache_*_multiple functions.
Add new caching functions named `wp_cache_add_multiple`, `wp_cache_set_multiple` and `wp_cache_delete_multiple`. All of these functions allow for an array of data to be passed, so that multiple cache objects can be created / edited / deleted in a single function call. This follows on from [47938] where the `wp_cache_get_multiple` function was introduced and allowed for multiple cache objects to be received in one call. 

Props: spacedmonkey, tillkruess, adamsilverstein, flixos90, mitogh, pbearne. 
Fixes: #54574.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52289 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-11 12:51:59 +00:00
gziolo
a877a9806b I18n: Standardize the script paths for blocks
When providing file paths to scripts (editorScript, script or viewScript), when there is a trailing ./ included then there was a different md5 generated for the file that didn't match the one used with the file generated in the translations folder.

Props Rahe.
See #54797.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52288 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-11 12:14:04 +00:00
Sergey Biryukov
8a62f7dc05 Code Modernization: Use file_get_contents() in get_file_data().
`file_get_contents()` is faster than `fread()`, because the PHP core can decide how to best read the remaining file; it could decide to issue just one `read()` call or `mmap()` the file first.

Per the PHP manual, `file_get_contents()` or `stream_get_contents()` is the preferred way to read the contents of a file into a string. It will use memory mapping techniques if supported by the OS to enhance performance.

Reference: [https://www.php.net/manual/en/function.file-get-contents.php PHP Manual: file_get_contents()].

Follow-up to [12044], [49073], [52696].

Props maxkellermann.
See #55069.
Built from https://develop.svn.wordpress.org/trunk@52698


git-svn-id: http://core.svn.wordpress.org/trunk@52287 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-10 15:03:04 +00:00
audrasjb
fbb9d52774 Query: Check if the theme supports block-templates before calling locate_block_template() in get_query_template().
This change improves performance for classic themes by removing an unnecessary query and fixes an issue where a classic theme would show "Empty template: Index" on the frontend when an empty `(block-)templates/index.html` file exists.

Props johnbillion, ianatkins, Mamaduka, costdev, manfcarlo, dolphingg, audrasjb, madeinua, kapilpaul, rafiahmedd, SergeyBiryukov.
Fixes #54844.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52286 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-09 13:22:03 +00:00
Sergey Biryukov
4f856dfae0 Code Modernization: Use stream_get_contents() in POMO_FileReader::read_all().
`stream_get_contents()` is faster than `fread()`, because the PHP core can decide how to best read the remaining file; it could decide to issue just one `read()` call or `mmap()` the file first.

Per the PHP manual, `file_get_contents()` or `stream_get_contents()` is the preferred way to read the contents of a file into a string. It will use memory mapping techniques if supported by the OS to enhance performance.

Reference: [https://www.php.net/manual/en/function.file-get-contents.php PHP Manual: file_get_contents()].

Follow-up to [12174].

Props maxkellermann.
See #55069.
Built from https://develop.svn.wordpress.org/trunk@52696


git-svn-id: http://core.svn.wordpress.org/trunk@52285 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-09 12:33:05 +00:00
audrasjb
f76b77b7c3 Script Loader: Prevent normalizing HTML IDs in _wp_normalize_relative_css_links().
This change fixes an issue where `_wp_normalize_relative_css_links()` was not only matching urls, but also HTML IDs.

Follow-up to [52036].

Props mahype, costdev, audrasjb, SergeyBiryukov.
Fixes #54922.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52284 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-08 23:41:00 +00:00
Peter Wilson
2fa1d729ba Options: Disable transients while installing.
Prevent the transient setters and getters from attempting to use the database table before they exist during the installation process. 

During installation transients now use the `wp_cache_*()` functions on all sites, including those without a persistent cache, to prevent database errors. The use of the caching functions stores the data in memory for the duration of the request to account for transient data that is used multiple times during installation.

Props dd32, audrasjb, tnolte, antonvlasenko, noisysocks, peterwilsoncc.
Fixes #54849.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52283 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-08 23:30:03 +00:00
audrasjb
22c9355e2d Docs: Fix an error in wp_kses_attr() docblock.
Props kebbet.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52282 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-08 16:25:01 +00:00
audrasjb
2b8f6781bb Docs: Typo correction in class-wp-theme-json docblocks.
Props kebbet.
See #54729.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52281 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-08 16:11:03 +00:00
Sergey Biryukov
7d9b54b131 Posts, Post Types: Pass the $update parameter to wp_insert_post_data and wp_insert_attachment_data filters.
This makes it easier to determine in a callback function whether this is an existing post being updated or not.

Follow-up to [8635], [8702], [27130], [27138], [28106], [28788], [47633].

Props nhadsall, mukesh27.
Fixes #46228.
Built from https://develop.svn.wordpress.org/trunk@52691


git-svn-id: http://core.svn.wordpress.org/trunk@52280 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-08 12:24:02 +00:00
audrasjb
bab3bdf2df Twenty Twelve: Typo correction a bundled pattern.
This change fixes a typo in the "Left-aligned Large Quote" block pattern.

Props tobifjellner, rafiahmedd, mukesh27.
Fixes #55099.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52279 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-07 18:29:04 +00:00
Sergey Biryukov
602b46626c Coding Standards: Rename the $profileuser variable to $profile_user in wp-admin/user-edit.php.
This brings the naming more in line with other variables like `$current_user`.

Follow-up to [2872].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52278 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-07 15:26:01 +00:00
Sergey Biryukov
1b22e56ad0 Coding Standards: Use strict comparison in wp-admin/user-edit.php.
Follow-up to [2872], [13941], [12722], [14043], [14802], [23364], [42688].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52276 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-07 14:47:02 +00:00
audrasjb
ca5f3d0af6 Twenty Twenty-Two: Restore custom padding for group blocks with a background color.
This change partially reverts [52679] which accidentally removed custom padding for group blocks with a background color.

Follow-up to [52679].

Props kjellr.
Fixes #55103.
See #54944.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-07 14:38:59 +00:00
Sergey Biryukov
a584be05eb Coding Standards: Rename $r variable to $args for clarity in walk_page_tree().
Follow-up to [9830], [32617], [45667], [52684].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52274 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-07 14:21:01 +00:00
Sergey Biryukov
a39f5f9d4f Coding Standards: Rename $r variable to $args for clarity in walk_nav_menu_tree().
Follow-up to [14248], [32612], [45667].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52273 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-07 14:01:05 +00:00
Sergey Biryukov
3015d1ca44 Tests: Rename the test file and class for wp_get_global_stylesheet() tests.
This matches the name of the function being tested.

Follow-up to [52675-52677].

See #54782.
Built from https://develop.svn.wordpress.org/trunk@52682


git-svn-id: http://core.svn.wordpress.org/trunk@52271 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-05 13:21:01 +00:00
audrasjb
54514a5451 Twenty Twenty-Two: Fix headings consistency in Pricing table pattern.
This change fixes a consistency issue where "Pigeon" was a h3, while "Sparrow" and "Falcon" were h2. Let's treat these birds equally 🐦

Props kjellr, jffng.
Fixes #54929.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52270 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-05 08:00:05 +00:00
audrasjb
68f58d46a5 Docs: Typo corrections in various API docblocks.
Props hasanuzzamanshamim.
Fixes #55073.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52269 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-04 16:28:00 +00:00
audrasjb
70fe8c8cea Twenty Twenty-Two: Remove negative side margins on group blocks with a background.
This change fixes an issue where applying a background color to a group block aligned it to the left in the editor.

Props eddystile, audrasjb, webmandesign, sabernhardt, petaryoast.
Fixes #54944.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-04 15:16:01 +00:00
Sergey Biryukov
1b81823244 Tests: Use more appropriate assertions in wp_get_global_stylesheet() tests.
This replaces instances of `assertTrue( str_contains( ... ) )` with `assertStringContainsString()` to use native PHPUnit functionality.

Follow-up to [52675], [52676].

See #54782.
Built from https://develop.svn.wordpress.org/trunk@52677


git-svn-id: http://core.svn.wordpress.org/trunk@52266 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-04 14:35:00 +00:00
Sergey Biryukov
4cbad9a9aa Coding Standards: Use strict type check for in_array() in wp_get_global_stylesheet().
Use multi-line comment syntax for some comments, per the documentation standards.

Follow-up to [52675].

See #54782.
Built from https://develop.svn.wordpress.org/trunk@52676


git-svn-id: http://core.svn.wordpress.org/trunk@52265 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-04 14:18:59 +00:00
jorgefilipecosta
e8e20a2823 Fix: Classic themes using default presets are not working.
This commit makes the presets provided by the theme via add_theme_support always create CSS Custom Properties, whether or not the theme has a theme.json file. This way, if the overwrites a core preset, the core CSS variables are also overwritten and use the theme value.

Props oandregal, hellofromTonya, desrosj, costdev, pbearne, johnstonphilip, webmandesign.
Fixes #54782.
Built from https://develop.svn.wordpress.org/trunk@52675


git-svn-id: http://core.svn.wordpress.org/trunk@52264 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-04 13:52:00 +00:00
audrasjb
e175e8aa0a Toolbar: Don't hide admin bar text labels from screen readers on small screens.
This change replaces `display: none` with `screen-reader-text` styles so the text labels are available for screen readers on small screens.

Props legendusmaximus, sabernhardt, konradyoast.
Fixes #54895.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52263 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-04 12:56:00 +00:00
Clorith
2d20fd7cc1 External libraries: Update version string for hoverIntent.
Updating the version string will help invalidate caches, ensuring the new version of the library is loaded where applicable.

Follow-up to [52429].

Props david.binda.
Fixes #54904.
Built from https://develop.svn.wordpress.org/trunk@52673


git-svn-id: http://core.svn.wordpress.org/trunk@52262 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-04 10:52:08 +00:00
joedolson
aa3db62410 Comments: Only render term update notices on term screens.
Prevent blank notices from appearing when adding custom fields or terms in the post editor.

Props gadhiyaravi, Boniu91, ravipatel, sabernhardt.
Fixes #54955. See #42937.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-04 01:22:02 +00:00
joedolson
f5d588bf26 Comments: Verify 'mirroring' property exists in media views.
Checks that the media collection has a mirroring property before accessing the property in media views.

Props MMDeveloper, mukesh27.
Fixes #53856.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52260 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-04 01:00:04 +00:00
Sergey Biryukov
84f61343d4 Docs: Fix typo in the is_post_status_viewable() function description.
Follow-up to [50130].

Props rafiahmedd.
Fixes #55068.
Built from https://develop.svn.wordpress.org/trunk@52670


git-svn-id: http://core.svn.wordpress.org/trunk@52259 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-03 21:25:02 +00:00
spacedmonkey
db603605ac Taxonomy: Remove cache expiry limitation in WP_Term_Query.
Remove the one day expiry limitation from query caches found in the `WP_Term_Qurery` class. Removing this limitation means that the caches will remain in object caching, as long as possible. Ensure that all term / taxonomy cache clear functions invalidate query caches, by deleting the last_changed value in the terms cache group. 

Props spacedmonkey, adamsilverstein, boonebgorges, tillkruess, dlh, flixos90.
Fixes #54511.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52258 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-03 17:43:06 +00:00
audrasjb
ca9b189085 Editor: Remove standard post type UI for templates and template parts.
In [52158] the standard post type UI was added back for templates and template parts, because these features had been temporarily removed from the site editor in the rush to get 5.9 ready for December. Since 5.9 these features were properly added back to the site editor, the `show_ui` values for these post types should be returned back to `false`.

Follow-up to [52158].

Props manfcarlo, audrasjb.
Fixes #54908.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52257 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-03 09:03:04 +00:00
audrasjb
63888dec3e Twenty Twenty-Two: Make 404 pattern search label and button translatable.
This changes makes the Twenty Twenty-Two "hidden-404" pattern fully prepared for translation.

Props kjellr, walbo.
Fixes #54928.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52253 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-02 23:43:02 +00:00
Peter Wilson
69e9e78cf4 Upgrade: Add follow up ticket ID to upgrade_590() comment.
Follow up to [52656].

Props audrasjb.
See #54906.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52251 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-02 23:22:06 +00:00
Sergey Biryukov
051bd96994 Twenty Twenty: Add Noto Serif as a fallback font before Garamond.
This aims to provide better experience on Chromebooks. Noto Serif is also the fallback font for Android devices.

Follow-up to [46271].

Props sabernhardt, nmschaller.
Fixes #50723.
Built from https://develop.svn.wordpress.org/trunk@52661


git-svn-id: http://core.svn.wordpress.org/trunk@52250 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-02 15:13:04 +00:00
davidbaumwald
a5c45366cb Options, Meta APIs: Correct some inline docs for update_post_meta and delete_post_meta.
In `update_post_meta` and `delete_post_meta`, code was added to fetch the parent post if these functions were called for a revision post ID.  In [9252], the code was apparently copied from `add_post_meta`, and the inline comment describing the new block of code was not updated to mention either "updated" or "deleted" respectively.  This change corrects the comment in both functions to reflect the current action instead of "added".

Props thelovekesh, rehanali.
Fixes #54835.
Built from https://develop.svn.wordpress.org/trunk@52660


git-svn-id: http://core.svn.wordpress.org/trunk@52249 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-01 17:12:03 +00:00
Sergey Biryukov
fefd1930c5 General: Remove inaccurate reference to the link_updated field from the wp_insert_link() DocBlock.
The `link_updated` field is unused as of WordPress 3.0 and was never updated via `wp_insert_link()`, only via the `wp-admin/update-links.php` file removed in [13744].

Follow-up to [13744], [49487].

Props dshanske, dharm1025, SergeyBiryukov.
Fixes #54880.
Built from https://develop.svn.wordpress.org/trunk@52659


git-svn-id: http://core.svn.wordpress.org/trunk@52248 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-01 12:30:02 +00:00
audrasjb
4894efc122 Twenty Twenty-One: Replace GitHub with .org link in Theme URI.
Theme URI is the URL of a public web page where users can find more information about the theme. For bundled themes, it should be a link to the theme’s page on the Theme Repository.

Props kafleg.
Fixes #55018.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52247 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-01 10:31:04 +00:00
Clorith
d09e18c5cf External libraries: Update jQuery Color to 2.2.0
The NPM package for jQuery Color was updated in [50543], but a bundled version still existed within core.
This removes that bundled version, in favor of expanding the Grunt build steps to include the package from NPM instead.

Fixes #55016. See #51405.
Built from https://develop.svn.wordpress.org/trunk@52657


git-svn-id: http://core.svn.wordpress.org/trunk@52246 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-01 01:22:04 +00:00
Peter Wilson
1ee362004f Upgrade: Prevent warnings upgrading cron array.
An unvisited site may have an undefined cron array, resulting in `_get_cron_array()` returning the value `false`. Previously this would trigger warning in `upgrade_590()` as the function assumed `_get_cron_array()` would alway return an array.

No database version change is required as the upgrade routine was successful on sites with a cron array during 5.9.0. On sites without a cron array, the error has already been thrown if they are running db version 51917. This fix is only required for new sites or those upgrading that have skipped 5.9.0.

Follow up to [51917].

Props chrisvanpatten, kapilpaul, SergeyBiryukov.
Fixes #54906.
See #53940.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52245 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-01 00:14:06 +00:00
Sergey Biryukov
8de9cdf559 Docs: Add a comment to clarify the username_exists() check in wpmu_validate_blog_signup().
Creating a new site that matches an existing user's login name is not allowed, unless it's the user's own username.

Follow-up to [https://mu.trac.wordpress.org/changeset/550 mu:550], [https://mu.trac.wordpress.org/changeset/1364 mu:1364].

Props henry.wright, joyously, swissspidy, SergeyBiryukov.
Fixes #54326.
Built from https://develop.svn.wordpress.org/trunk@52655


git-svn-id: http://core.svn.wordpress.org/trunk@52244 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-31 13:07:03 +00:00
John Blackbourn
eb338bd22d Build/Test Tools: Switch to some more appropriate assertions.
See #54725

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


git-svn-id: http://core.svn.wordpress.org/trunk@52243 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-30 19:42:00 +00:00
John Blackbourn
aed11c4067 Role/Capability: Correct the documented accepted types for the capability argument of WP_User_Query.
See #16841, #54729

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


git-svn-id: http://core.svn.wordpress.org/trunk@52242 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-30 19:34:00 +00:00
John Blackbourn
ecc08a41f6 Docs: Increase the specificity of types in various inline documentation.
See #54729

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


git-svn-id: http://core.svn.wordpress.org/trunk@52241 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-30 19:25:03 +00:00
Sergey Biryukov
effadc5da9 Twenty Twenty-Two: Optimize the assets/images/ducks.jpg image.
The new file should have a much better balance of quality and file size.

Follow-up to [52081], [52107].

Props kafleg, kjellr, jffng, kapilpaul.
Fixes #54911.
Built from https://develop.svn.wordpress.org/trunk@52651


git-svn-id: http://core.svn.wordpress.org/trunk@52240 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-30 11:56:03 +00:00
Sergey Biryukov
b3aae615bb Users: Return a WP_Error from wp_insert_user() if the user_url field is too long.
The `user_url` database field only allows up to 100 characters, and if the value is longer than that, the function should return a proper error message instead of silently failing.

This complements similar checks for `user_login` and `user_nicename` fields.

Follow-up to [45], [1575], [32299], [34218], [34626].

Props mkox, sabernhardt, tszming, SergeyBiryukov.
Fixes #44107.
Built from https://develop.svn.wordpress.org/trunk@52650


git-svn-id: http://core.svn.wordpress.org/trunk@52239 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-29 14:25:03 +00:00
audrasjb
c0cbf007f0 Administration: Add a top margin to Mail Server Port field on small screens.
This change fixes an overlapping issue on small screens in the Writing Settings screen.

Props pravinparmar2404, afercia, utz119, thimalw, sabernhardt, audrasjb.
Fixes #50177.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52238 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-28 21:50:04 +00:00
Clorith
7ea33988e9 External libraries: Update jQuery UI to 1.13.1
Some regressions happened alongside the release of jQuery UI 1.13.0, this brings the fixes from 1.13.1 downstream to WordPress, notably relating to Widget, Autocomplete, Sortable, and Tooltip modules.

See the changelog between version 1.13.0 and 1.13.1 at https://github.com/jquery/jquery-ui/compare/1.13.0...1.13.1

Props blogaid, linux4me2, mgol.
Fixes #54902.
Built from https://develop.svn.wordpress.org/trunk@52648


git-svn-id: http://core.svn.wordpress.org/trunk@52237 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-28 16:44:05 +00:00
Sergey Biryukov
445d687680 Themes: Correct the width of theme preview on Add Themes screen.
This ensures that the preview ratio remains accurate for the user's screen size when the sidebar is open.

Follow-up to [19995], [20110], [20133], [20138], [28033].

Props shreyasikhar26, costdev, sumitsingh, SergeyBiryukov.
Fixes #54764.
Built from https://develop.svn.wordpress.org/trunk@52647


git-svn-id: http://core.svn.wordpress.org/trunk@52236 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-28 12:10:04 +00:00
audrasjb
1d561e1fa6 Media: Remove target blank attribute from media uploader edit links.
This change removes a dispensable target blank attribute from Edit links displayed in the asynchronous file uploader.

Follow-up to [22755].

Props kebbet, SergeyBiryukov.
Fixes #54945.
See #23432.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52235 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-27 22:17:00 +00:00
audrasjb
b3d3adaa2b Docs: Fix incorrect type in translations_api and translations_api_result docblocks.
Before this changeset, `translation_api` and `translation_api_result` filters were incorrectly marked as taking object as their first argument. The correct type is an array as `json_decode()` is asked to return an associative array.

Props volodymyrkolesnykov.
Fixes #54959.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52234 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-27 21:15:03 +00:00
Sergey Biryukov
66dc00211b Upgrade/Install: Make sure the "Show hidden updates" button is visible and works as expected.
The [https://api.jquery.com/toggle-event/ .toggle( handler, handler )] method signature was deprecated in jQuery 1.8 and removed in jQuery 1.9. 

This commit updates the click handler function to work with jQuery 1.9+.

Follow-up to [9441], [9543], [42785], [48323].

Props malinevskiy, SergeyBiryukov.
Fixes #54886.
Built from https://develop.svn.wordpress.org/trunk@52644


git-svn-id: http://core.svn.wordpress.org/trunk@52233 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-26 13:11:29 +00:00
Sergey Biryukov
2eaeae58ff Docs: Update spelling for inline comments in a few files.
Per the [https://make.wordpress.org/core/handbook/best-practices/spelling/ spelling] and [https://make.wordpress.org/docs/style-guide/language-grammar/word-choice/ word choice] documentation guidelines, American (US) spelling should be preferred.

Props mohadeseghasemi, subrataemfluence, rehanali, SergeyBiryukov.
Fixes #46837.
Built from https://develop.svn.wordpress.org/trunk@52640


git-svn-id: http://core.svn.wordpress.org/trunk@52229 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-25 13:55:05 +00:00
Sergey Biryukov
6329aacac8 Docs: Correct @global tag in wp_kses_xml_named_entities().
This updates the variable name in the DocBlock to the correct one.

Follow-up to [48072], [52229].

Props david.binda.
Fixes #54899.
Built from https://develop.svn.wordpress.org/trunk@52639


git-svn-id: http://core.svn.wordpress.org/trunk@52228 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-25 11:16:05 +00:00
davidbaumwald
fe7d62fe13 Upgrade/Install: Update $_old_files for 5.9.
Props SergeyBiryukov, davidbaumwald.
Fixes #54894.
Built from https://develop.svn.wordpress.org/trunk@52637


git-svn-id: http://core.svn.wordpress.org/trunk@52225 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-24 18:24:02 +00:00
desrosj
2900d9eccf Editor: Bump editor packages to include the latest fixes.
This merges the latest package updates for the block editor to include the fix for https://github.com/WordPress/gutenberg/pull/38175.

Props hellofromTonya, mamaduka, joen, talldanwp, cbravobernal, poena.
Fixes #54487.
Built from https://develop.svn.wordpress.org/trunk@52633


git-svn-id: http://core.svn.wordpress.org/trunk@52221 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-24 15:57:28 +00:00
audrasjb
0e9a48e0cb Docs: Docblock corrections for get_block_file_template().
Follow-up to [52324].

Props johnbillion, SergeyBiryukov, costdev.
Fixes #54879.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52219 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-24 15:28:02 +00:00
Dominik Schilling
70a7faa9dc Plugins/Themes: Allow to install/activate plugins/themes which require the WordPress version currently in development.
Twenty Twenty-Two requires WordPress 5.9 but currently can't be (re)activated in the 5.9 branch because `version_compare( '5.9-RC3-52627', '5.9', '>=' )` as used by `is_wp_version_compatible()` returns `false`. To appreciate the testing of upcoming versions any `-alpha`, `-RC`, `-beta` suffixes are now stripped off from the WordPress version before checking for compatibility.

Fixes #54882.
Built from https://develop.svn.wordpress.org/trunk@52628


git-svn-id: http://core.svn.wordpress.org/trunk@52216 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-24 10:41:01 +00:00
Peter Wilson
0c51a7f11b Help/About: Update Freedoms page for 5.9.
Fixes #54270.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52214 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-24 09:41:03 +00:00
noisysocks
939758a2b5 Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- Block Editor: Mark last change as persistent on save
- Site Editor: Restore ?styles=open functionality
- Site Editor: Fix resizable box scrollbars in blocks
- Add classic menus to menu switcher

See #54487.
Props talldanwp.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52212 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-24 07:46:21 +00:00
noisysocks
01cb359adc Customizer: Remove Widgets panel when a theme does not support widgets
By setting 'theme_supports' on the panel, we ensure that the Widgets panel is
removed if a theme does not have support for 'widgets'.

This makes the behaviour of the Widgets and Menus panels consistent.

Follows [52621].
See #54888.
Props hellofromTonya, costdev, peterwilsoncc.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52210 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-24 05:37:01 +00:00
noisysocks
4aaa1803ec Customizer: Remove Menus panel when a theme does not support menus
By overriding check_capabilities(), we can ensure that the Menus panel
is removed if a theme does not have support for 'menus' nor 'widgets'.

This ensures that the Menus panel does not appear when using a block
theme, which is confusing to users.

See #54888.
Props hellofromTonya, costdev, peterwilsoncc.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52209 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-24 05:34:04 +00:00
Sergey Biryukov
997f8b9921 Coding Standards: Use a more appropriate variable name in link_advanced_meta_box().
Follow-up to [45667].

Props mkox, SergeyBiryukov.
Fixes #54856.
Built from https://develop.svn.wordpress.org/trunk@52620


git-svn-id: http://core.svn.wordpress.org/trunk@52208 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-23 09:03:05 +00:00
desrosj
d332f43f60 Bundled Themes: Bump the versions for bundled themes for release.
This bumps the versions of the default bundled themes in preparation for release with WordPress 5.9.

The new versions are:
- Twenty Ten: 3.6
- Twenty Eleven: 4.0
- Twenty Twelve: 3.6
- Twenty Thirteen: 3.5
- Twenty Fourteen: 3.3
- Twenty Fifteen: 3.1
- Twenty Sixteen: 2.6
- Twenty Seventeen: 2.9
- Twenty Nineteen: 2.2
- Twenty Twenty: 1.9
- Twenty Twenty-One: 1.5

Props audrasjb.
Fixes #54783.
Built from https://develop.svn.wordpress.org/trunk@52618


git-svn-id: http://core.svn.wordpress.org/trunk@52206 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-22 14:07:05 +00:00
desrosj
d6c4545f83 Bundled Themes: Reverts [52549].
[52549] updated some default presets in use by default themes to the new format. However, this change would cause elements to lose their styling when active on an older version of WordPress.

See #54782.
Built from https://develop.svn.wordpress.org/trunk@52615


git-svn-id: http://core.svn.wordpress.org/trunk@52203 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-21 19:52:02 +00:00
desrosj
fb4199b676 Twenty Twenty-Two: Re-add the link to the theme’s HelpHub changelog.
See #54318.
Built from https://develop.svn.wordpress.org/trunk@52613


git-svn-id: http://core.svn.wordpress.org/trunk@52201 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-21 19:42:01 +00:00
jffng
1229d642a2 Twenty Twenty-Two: update the required version.
This commit updates the required WordPress version of the 2022 default theme to 5.9 in advance of its release on January 25.

Props hellofromtonya, kjellr, desrosj.
See #54318.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52200 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-21 19:05:07 +00:00
Sergey Biryukov
7f5d7f1b56 Date/Time: Add a unit test for the return type of current_datetime().
Follow-up to [45883].

Props pbearne.
Fixes #53484.
Built from https://develop.svn.wordpress.org/trunk@52611


git-svn-id: http://core.svn.wordpress.org/trunk@52199 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-21 06:00:00 +00:00
audrasjb
99bac7e17c Docs: Replace "Current theme" with "Active theme" in various DocBlocks.
This change replaces "Current theme" with "Active theme" in various DocBlocks for better consistency with user-facing strings.

Follow-up to [52580].

Props Presskopp, audrasjb, costdev.
Fixes #54831.
See #54770.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52198 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-20 23:53:05 +00:00
Sergey Biryukov
e07b5af042 General: Clarify the deprecation messages in the _deprecated_*() functions family.
This makes the strings easier to translate and provides more details about what exactly is deprecated: a PHP function, a file name, or a WordPress hook.

The changes apply to:
* `_deprecated_function()`
* `_deprecated_constructor()`
* `_deprecated_file()`
* `_deprecated_argument()`
* `_deprecated_hook()`
* `_doing_it_wrong()`

Follow-up to [6514], [7884], [12536], [12584], [16939], [16942], [16945], [24439], [24723], [32989], [37861], [39315].

Props mukesh27, audrasjb, SergeyBiryukov.
Fixes #54658.
Built from https://develop.svn.wordpress.org/trunk@52609


git-svn-id: http://core.svn.wordpress.org/trunk@52197 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-20 13:13:01 +00:00
audrasjb
d4306e8d8a Administration: Properly handle HTML entities in the News & Events dashboard widget.
This change adds support for various HTML entities in the News & Events dashboard widget.

Props nickciske, kpegoraro, iandunn, shedonist, sayedulsayem, sabernhardt, audrasjb, SergeyBiryukov, ocean90.
Fixes #41208.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52196 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-20 09:19:07 +00:00
Sergey Biryukov
f8c10a28f5 Users: Revert the variable change in [52606] that caused the tests to fail.
Follow-up to [52604-52606].

Props audrasjb.
See #54690.
Built from https://develop.svn.wordpress.org/trunk@52607


git-svn-id: http://core.svn.wordpress.org/trunk@52195 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-19 13:39:01 +00:00
Sergey Biryukov
3bc7449859 Docs: Further update the send_retrieve_password_email filter documentation for consistency.
Follow-up to [52604], [52605].

See #54690.
Built from https://develop.svn.wordpress.org/trunk@52606


git-svn-id: http://core.svn.wordpress.org/trunk@52194 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-19 13:18:00 +00:00
audrasjb
0dcc9fd03a Docs: Docblocks consistency fixes after [52604].
Follow-up to [52604].

Fixes #54690.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52193 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-19 12:42:01 +00:00
audrasjb
e87e3dcf58 Users: Add new hooks to filter retrieve password emails.
This change introduces two new hooks to help developers to filter retrieve password emails:

- `send_retrieve_password_email` can be used to filter whether to send the retrieve password email;
- `retrieve_password_notification_email` can be used to filter the contents of the reset password notification email sent to the user.

This changesets also adds unit tests for these new filters.

Props connapptivity, costdev, audrasjb, johnbillion.
Fixes #54690.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52192 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-19 12:17:01 +00:00
Sergey Biryukov
48aa21e9d9 I18N: Improve the context for color-related strings in WP_Theme::translate_header().
* Use the `color scheme` context for the "Light" string, for more accuracy.
* Add the same context to the "Dark" string too, for consistency.

Follow-up to [37946], [52588].

Fixes #54804.
Built from https://develop.svn.wordpress.org/trunk@52603


git-svn-id: http://core.svn.wordpress.org/trunk@52191 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-19 10:35:03 +00:00
Peter Wilson
f7151a6f3a Script loader: Prevent DB errors during Multisite install.
Prevent the script loader from attempting to create nonces during the installation process for Multisite configurations.

Prior to this fix, multiple "Table does not exist" errors were thrown during installation if `MULTISITE` was defined in the `wp-config.php` file but the salt constants were not defined. Without the salts defined in PHP, WP was attempting to use the database fallbacks prior to table creation.

Props schlessera, johnbillion, hellofromTonya, audrasjb, costdev.
Fixes #54800.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52190 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-18 23:47:01 +00:00
hellofromTonya
1543616cff Editor: @wordpress package updates.
Update packages to include these bug fixes from Gutenberg:

* Navigation Block: update micromodal to `0.4.10` to fix menu close button on mobile

Props ryelle, poena, get_dave, talldanwp, aristath, kjellr, audrasjb, desrosj.
See #54487.
Built from https://develop.svn.wordpress.org/trunk@52598


git-svn-id: http://core.svn.wordpress.org/trunk@52186 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-18 21:34:18 +00:00
Sergey Biryukov
ef5a994a3c Docs: Fix typos in some DocBlocks.
Props kebbet.
See #54729.
Built from https://develop.svn.wordpress.org/trunk@52597


git-svn-id: http://core.svn.wordpress.org/trunk@52185 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-18 20:29:06 +00:00
noisysocks
cd191ca6fe Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- Stop keypresses being caught by other elements when they happen in a CustomSelectControl
- Remove color, spacing, and layout options for Template Part block
- Try: parse shortcode blocks outside the content
- Fix aria-modal attribution with multiple navs on page
- Gallery block: Remove warning notice about mobile version required
- Fix Home template description typo 
- Fix enqueueing additional styles for blocks only when rendered
- fix typo (hanle -> handle)
- SelectControl: mark the children prop as optional
- Remove warning for enqueued styles in Editor
- Add context to font style and font weight related translation strings
- Temporarily remove text decoration from Nav block
- Fix empty secondary sidebar overlapping widget editor content on mobile viewports
- Fix hiding the bottom of tablet/mobile preview in Site Editor

See #54487.
Props isabel_brison.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52183 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-18 03:39:26 +00:00
hellofromTonya
e158979d3d Editor: Explicitly load remote block patterns in the block and site editor screens.
Remote block patterns from wp.org were to be loaded through a callback hooked into the `current_screen` filter. Within 2 callbacks, i.e. `_load_remote_featured_patterns()` and `_load_remote_block_patterns()`, a guard clause bailed out early if the `$current_screen->is_block_editor` is `false`.

However, the `current_screen` filter is unreliable to detect the block editor. Why? In the block and Site Editor screens, `$current_scren->is_block_editor` is not set until after the filter is executed. Whoopsie.

This commit no longer uses the `current_screen` filter. Instead, it explicitly loads the remote block patterns by invoking both private functions (now not callbacks) directly in the screen files for the block and site editor screens.

With this change, passing `WP_Screen` object into these functions is no longer needed. As the `_load_remote_block_patterns()` function was introduced in 5.8.0, its function parameter is now deprecated and the guard clause retained for backwards compatibility.

Follow-up to [51021], [52377].

Props poena, noisysocks, peterwilsoncc, hellofromTonya, audrasjb.
Fixes #54806.
Built from https://develop.svn.wordpress.org/trunk@52593


git-svn-id: http://core.svn.wordpress.org/trunk@52181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-17 22:42:03 +00:00
hellofromTonya
c20c8a99bd Administration: Revert [51946].
Reverting changeset due to reported issue of menu being hidden after clicking on certain mobile devices.

Props dhusakovic, audrasjb, SergeyBiryukov, costdev, joedolson.
See #54837, #53587.
Built from https://develop.svn.wordpress.org/trunk@52591


git-svn-id: http://core.svn.wordpress.org/trunk@52179 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-17 19:55:04 +00:00
jffng
56b4c0e838 Twenty Twenty-Two: Sync updates from GitHub from RC3.
This commit syncs minor changes for the default theme from its active development repository to core. 

This is a follow up to [52081], [52107], [52164], [52222], [52283], [52335], [52375], [52392], [52430], and [52555]. It includes fixes to the group, cover, and template part block padding and removes unnecessary group block wrappers from many patterns.

To view the full set of changes, visit 69d5c512c6...91f8748566.

Props kjellr, richtabor, audrasjb.
See #54318.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52177 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-17 15:43:59 +00:00
audrasjb
442b46dc2f i18n: Contextualize "light" color translation strings.
This change helps translators to distinguish between color and font-family contexts.

Props ironprogrammer, audrasjb, tobifjellner, Presskopp, SergeyBiryukov, hellofromTonya.
Fixes #54804.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52176 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-17 15:38:01 +00:00
Sergey Biryukov
ab263f93e5 Upgrade/Install: Check if the disk_free_space() function exists before calling it.
In PHP 8+, `@` no longer suppresses fatal errors:
> The `@` operator will no longer silence fatal errors (`E_ERROR`, `E_CORE_ERROR`, `E_COMPILE_ERROR`, `E_USER_ERROR`, `E_RECOVERABLE_ERROR`, `E_PARSE`).

Reference: [https://www.php.net/manual/en/migration80.incompatible.php PHP 8: Backward Incompatible Changes].

`disk_free_space()` may be disabled by hosts, which will throw a fatal error on a call to undefined function.

This change prevents the fatal error, and falls back to `false` when `disk_free_space()` is unavailable.

Follow-up to [25540], [25774], [25776], [25831], [25869].

Props costdev, jrf, swb1192, SergeyBiryukov.
Fixes #54826. See #54730.
Built from https://develop.svn.wordpress.org/trunk@52585


git-svn-id: http://core.svn.wordpress.org/trunk@52175 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-17 11:41:03 +00:00
Sergey Biryukov
c6829b3afc Coding Standards: Rename the $val variable to $site for clarity in WP_MS_Users_List_Table::column_blogs().
Follow-up to [12603], [13918], [16607], [32757], [52583].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52174 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-16 08:40:00 +00:00
Sergey Biryukov
81a1fc33cb Coding Standards: Use strict comparison in wp-admin/includes/class-wp-ms-users-list-table.php.
Follow-up to [16607], [32630], [32757], [47219].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52173 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-16 08:16:04 +00:00
audrasjb
8669c16e04 Docs: Miscellaneous docblock corrections in REST API and Sitemaps API.
Props kebbet.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-15 21:22:02 +00:00
Sergey Biryukov
0bc24dd81f Coding Standards: Use strict comparison in wp-admin/includes/class-wp-users-list-table.php.
This mirrors a similar check a few lines below and includes minor code layout fixes for better readability.

Follow-up to [9955], [13931], [14176], [15315], [45407], [50129].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52171 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-15 20:49:06 +00:00
audrasjb
e05557e222 Administration: Replace "Current theme" with "Active theme" in user facing strings.
This change replaces "Current theme" with "Active theme" in user-facing strings. It brings better consistency across the Administration.

Props Presskopp, audrasjb, costdev.
Fixes #54770.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52170 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-15 08:44:03 +00:00
audrasjb
ab28757878 Docs: Typo correction in WP_REST_Response class docblocks.
Follow-up to [34928].

Props kebbet.
Fixes #54823.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52168 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-14 21:15:04 +00:00
Sergey Biryukov
59287c1157 Tests: Avoid duplicate queries in some WP_Query tests.
When passing args to the `WP_Query::__construct()` method, it internally executes the `WP_Query::get_posts()` method and stores the result in the `WP_Query::posts` property.

When calling `WP_Query::get_posts()` again, the same SQL query gets executed, and the result is again stored in the `WP_Query::posts` property.

Thus, the correct usage is to read the posts already stored in the `WP_Query::posts` property.

Follow-up to [1062/tests], [1065/tests], [1066/tests], [1070/tests], [29805], [31286], [49900], [51144].

Props david.binda.
Fixes #54822.
Built from https://develop.svn.wordpress.org/trunk@52577


git-svn-id: http://core.svn.wordpress.org/trunk@52167 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-14 17:52:01 +00:00
audrasjb
d73a6bcc64 Upgrade/Install: Typo correction in a Core_Upgrader class inline comment.
Follow-up to [45046].

Props kebbet.
Fixes #54821.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52166 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-14 15:14:00 +00:00
audrasjb
ed1421fa32 XML-RPC: Fix typos in some XMLRPC related docblocks.
Props kebbet, shreyasikhar26.
Fixes #54820.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52165 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-14 14:45:05 +00:00
audrasjb
0439ef8279 Media: Add a missing / in post thumbnail lazy loading regex.
This change avoids a warning thrown by a missing slash in a post thumbnail lazyload related regular expression.

Follow-up to [52065].

Props SierraTR, audrasjb, costdev.
Fixes #54815.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52164 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-14 11:02:06 +00:00
audrasjb
b4de570d35 Media: Typo correction in wp_image_maybe_exif_rotate docblock.
Follow-up to [46202].

Props mitogh.
Fixes #54816.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52163 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-13 19:14:05 +00:00
Sergey Biryukov
e840d56df5 Docs: Correct description for two HTTP API functions:
* `wp_remote_retrieve_response_code()`
* `wp_remote_retrieve_response_message()`

If incorrect parameter value is given, these functions return an empty string, not an empty array.

Follow-up to [8516].

Props chesio, johnbillion.
Fixes #54796.
Built from https://develop.svn.wordpress.org/trunk@52572


git-svn-id: http://core.svn.wordpress.org/trunk@52162 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-13 01:04:01 +00:00
audrasjb
b14d7a8149 Administration: Fix an erroneous translators comment after changeset [52569].
This change also fixes the indentation of the translators comment.

Fixes #54798.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52161 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-12 23:45:01 +00:00
audrasjb
b00a83b996 Tests: Trac ticket number correction after changeset [52569].
Follow-up to [52569].

See #54798.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52160 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-12 23:30:59 +00:00
audrasjb
725e1d02af Administration: Ensure an integer is used for menu priority in add_menu_page().
This change adds a verification of the `$position` parameter in `add_menu_page()` to ensure an integer is used. If not, the function informs developers of the wrong parameter type via a `_doing_it_wrong` message. This brings consistency with a similar check used in `add_submenu_page()`.

This change also typecasts any floating number to string to ensure that in case a float value was passed, at least it doesn't override existing menus.

Follow-up to [46570].

Props kirtan95.
Fixes #54798. See #48249.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52159 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-12 23:25:08 +00:00
Sergey Biryukov
23be3c2b55 Coding Standards: Remove an extra variable in get_author_posts_url().
This fixes a `Variable "$auth_ID" is not in valid snake_case format` WPCS warning by using the existing `$author_id` variable, and brings consistency with a similar fragment in `get_author_feed_link()`.

Follow-up to [979], [5087], [6364], [6365].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52158 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-12 11:17:08 +00:00
ryelle
c3c39a22b9 Help/About: Update the About section for 5.9.
Use the correct Field Guide link. Update the SVGs used on Freedoms and Privacy. Add more spacing between sections on the About page, fixed spacing between rows on Freedoms page.

Props critterverse, audrasjb, versusbassz.
See #54270.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52153 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-11 18:36:00 +00:00
ryelle
908a08696b Administration: Update design of the Dashboard welcome panel.
Tone down the brightness of the dashboard panel by using a white background behind the main text, and use the highlight color from each color scheme for the main background. This also introduces a `$scheme-name` SCSS variable to allow overrides for specific color schemes.

Props critterverse, sabernhardt, joedolson, audrasjb.
See #54489.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52152 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-11 18:27:03 +00:00
davidbaumwald
f950eec323 Script Loader: Fix a variable typo in wp_enqueue_block_style.
In `wp_enqueue_block_style` when `rtl` versions of CSS files are detected, `wp_style_add_data` is called to add the metadata to the registered sheet.  However, the stylesheet `handle` argument is misspelled as `hanle`.  This change corrects the argument name.

Props omaeyusuke.
Fixes #54786.
Built from https://develop.svn.wordpress.org/trunk@52558


git-svn-id: http://core.svn.wordpress.org/trunk@52148 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-11 17:16:00 +00:00
hellofromTonya
2a686addf0 Editor: Fix enqueueing additional styles in wp_enqueue_block_style() to print only when blocks render.
In a block theme, additional block styles registered using the `wp_enqueue_block_style` function should only get printed when the block exists on a page. However, they currently always get rendered.

This commit is a backport from Gutenberg that fixes the issue by printing the styles when a block renders.

Follow-up to [52069].

Props poena, aristath, Mamaduka.
Fixes #54787.
Built from https://develop.svn.wordpress.org/trunk@52556


git-svn-id: http://core.svn.wordpress.org/trunk@52146 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-11 16:00:01 +00:00
jffng
fcdf1ce242 Twenty Twenty-Two: Sync updates from GitHub for RC 2.
This commit syncs changes for the default theme from its active development repository to core.

This is a follow up to [52081], [52107], [52164], [52222], [52283], [52335], [52375], [52392], and [52430]. It includes fixes to the theme's spacing and adds a search template.

To view the full set of changes, visit 8564fd281f...f0346e1ad2.

Props richtabor, kjellr, danieldudzic, scruffian.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52145 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-11 15:58:02 +00:00
hellofromTonya
3abe551097 Site Editor: Fix typo in home template translatable description.
The home template's description should be: "Displays as the site's home page, or as the Posts page when a static home page isn't set." This commit fixes the typo changing "it" to "isn't".

Follow-up to [52331].

Props kharisblank, talldanwp.
Fixes #54787.
Built from https://develop.svn.wordpress.org/trunk@52554


git-svn-id: http://core.svn.wordpress.org/trunk@52144 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-11 15:18:03 +00:00
Sergey Biryukov
56d10309d0 Database: Add missing AS after INNER JOIN in some queries.
While `AS` is an optional keyword in SQL, it is commonly considered best practice to include it for better readability and compatibility. This also makes the queries more consistent with other queries using aliases in core.

Follow-up to [6359], [30238].

Props costdev, domainsupport.
Fixes #54769.
Built from https://develop.svn.wordpress.org/trunk@52553


git-svn-id: http://core.svn.wordpress.org/trunk@52143 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-11 04:12:05 +00:00
noisysocks
114bff87cf Update packages to include these bug fixes from Gutenberg:
- [Block Library - Query Pagination Next]: Hide block if custom query has no results
- [WP 5.9] Fix: HTML tags like inline images in nav links break submenu layout
- Check for nextpage to display page links for paginated posts
- Navigation: Set the default for --navigation-layout-align to "flex-start" when using vertical orientation
- [Block Library - Query Loop]: Use gap for the grid view
- Update page list flex variables to match navigation.
- Site logo: Fix range control on landscape logo
- Restore canvas padding for classic themes
- RichText: Fix dead key input on Windows
- Fix: Impossible to clear colors if color palettes are removed.
- Gallery block: pass any custom attributes through the gallery v2 migration script
- Reduce specificity of legacy font sizes defined by core
- Update: Improve escaping on the search block

See #54487.
Props isabel_brison.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52141 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-11 03:13:33 +00:00
jorgefilipecosta
83dc7c318b Fix: Update some default presets in use by default themes to the new format.
Themes that use the same preset slugs as WordPress uses need to be updated.
From the devnote https://make.wordpress.org/core/2022/01/08/updates-for-settings-styles-and-theme-json/
The CSS for some of the presets defined by WordPress (font sizes, colors, and gradients) was loaded twice for most themes in WordPress 5.8: in the block-library stylesheet plus in the global stylesheet. Additionally, there were slight differences in the CSS in both places.
In WordPress 5.9 those were consolidated into a single place, the global stylesheet whose name is global-styles-inline-css that is now loaded for all themes in the front-end.
For themes to override the default values they can use the theme.json and provide the same slug. Themes that do not use a theme.json can still override the default values by enqueuing some CSS that sets the corresponding CSS Custom Property. This commit does the second for the twenty twenty theme.

Props oandregal.
Fixes #54782.
Built from https://develop.svn.wordpress.org/trunk@52549


git-svn-id: http://core.svn.wordpress.org/trunk@52139 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-10 18:29:02 +00:00
jorgefilipecosta
6d30d2a5d6 Fix: WordPress default presets aren't loaded for all themes.
The default preset styles of WordPress (font sizes, colors, gradients) are now provided via the global stylesheet to avoid duplication of styles. This stylesheet can be found in the front-end with the name global-styles-inline-css.
The default presets are important to support old content that may use them and also patterns, that can use cross-theme styles.

Props oandregal.
Fixes #54781.
Built from https://develop.svn.wordpress.org/trunk@52547


git-svn-id: http://core.svn.wordpress.org/trunk@52137 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-10 17:29:03 +00:00
davidbaumwald
2d8ba6acd9 Build/Test Tools: Re-enable E2E tests for the 5.8 branch.
After the 5.9 branch was created, [52449] updated the workflow for testing old branches to include 5.9.  However, the E2E tests `-branch` condition was updated to 5.9 instead of adding an additional branch condition for 5.9.  This commit re-enables the E2E tests for 5.8.

Props desrosj, hellofromTonya.
Fixes #54749.
Built from https://develop.svn.wordpress.org/trunk@52546


git-svn-id: http://core.svn.wordpress.org/trunk@52136 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-10 16:45:04 +00:00
audrasjb
8cd983dee4 Help/About: Correction in "Managing Themes" HelpHub Docs link.
This change updates the HelpHub Documentation link to "Managing Themes" to make it more consistent with other Help tabs.

Props SergeyBiryukov, jdy68.
Fixes #54707.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52135 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-10 08:50:01 +00:00
Sergey Biryukov
b2ac6dcca8 Coding Standards: Correct alignment in get_block_editor_settings().
This fixes an `Array double arrow not aligned correctly` WPCS warning.

Follow-up to [52054].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52134 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-10 01:56:02 +00:00
audrasjb
461cd1373e Help/About: Change the HTML title of Themes Screen and add related HelpHub Docs link.
This change replaces the title of the Appearance Themes Screen to make it consistent with the main heading of the screen and with other Admin screens. It also adds a link to the related HelpHub Documentation in the Help tab of the screen.

Props jdy68.
Fixes #54707.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52133 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-09 23:14:04 +00:00
Sergey Biryukov
6dde735e3e Coding Standards: Use strict comparison in wp-admin/themes.php.
Follow-up to [15646], [30697].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52130 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-08 01:22:02 +00:00
davidbaumwald
aeb5d2ef17 Upgrade/Install: Fix parameter count in error call when an automatic core upgrade fails.
During automatic core upgrades, if installation results in a `WP_Error`, the `error` method is called on the skin with the details.  However, in this case, two parameters are passed to `$skin->error`, but only one is accepted.  This change passes only the running `WP_Error` instance as the sole parameter to `$skin->error`.

Also, this change adds an additional error to `$upgrade_result` before finally being passed to `$skin->error`, indicating that the installation failed.  This adds additional context to the failure.

Props desrosj, sainthkh, devutpol, SergeyBiryukov.
Fixes #53284.
Built from https://develop.svn.wordpress.org/trunk@52539


git-svn-id: http://core.svn.wordpress.org/trunk@52129 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-07 17:55:01 +00:00
Sergey Biryukov
10e842a662 Coding Standards: Use strict comparison in wp-admin/revision.php.
Follow-up to [7913], [12751].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52128 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-07 16:47:00 +00:00
audrasjb
286e4fa9b0 Taxonomy: Typo correction in context used for the navigation link block title.
This change fixes a wrong translation context on the navigation link block title.

Follow-up to [50527].

Props Chouby.
Fixes #54566.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52127 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-07 11:21:04 +00:00
audrasjb
68136b50c4 Tests: Update qUnit test fixtures after [52535].
See #54745.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52126 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-06 23:28:22 +00:00
audrasjb
f88037f0f4 REST API: Typo correction in a link description object.
This change fixes a wrong punctuation in a link description object of the menu items controller endpoint.

Props la-geek, audrasjb, tobifjellner, hellofromtonya.
Fixes #54745.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52125 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-06 23:27:14 +00:00
Sergey Biryukov
e38bb277ea Coding Standards: Use strict comparison in wp-admin/plugin-install.php.
Follow-up to [11366].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52124 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-06 23:26:06 +00:00
desrosj
77a972838c Formatting: Correctly encode ASCII characters in post slugs.
Props zieladam, whyisjake, xknown, peterwilsoncc, desrosj, iandunn.
Built from https://develop.svn.wordpress.org/trunk@52457


git-svn-id: http://core.svn.wordpress.org/trunk@52049 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-06 17:10:00 +00:00
desrosj
638ef7815e Upgrade/Install: Avoid using unserialize() unnecessarily.
Props vortfu, xknown, dd32.
Built from https://develop.svn.wordpress.org/trunk@52456


git-svn-id: http://core.svn.wordpress.org/trunk@52048 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-06 17:07:03 +00:00
desrosj
c9c4dabcc1 Query: Improve sanitization within WP_Meta_Query.
Props vortfu, xknown, dd32.
Built from https://develop.svn.wordpress.org/trunk@52455


git-svn-id: http://core.svn.wordpress.org/trunk@52047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-06 17:05:02 +00:00
desrosj
271b1f60cd Query: Improve sanitization within WP_Tax_Query.
Props dd32, xknown, peterwilsoncc, ehtis.
Built from https://develop.svn.wordpress.org/trunk@52454


git-svn-id: http://core.svn.wordpress.org/trunk@52046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-06 17:03:05 +00:00
audrasjb
a02b7770f4 Help/About: Change the Learn WP link in the about page.
The workshops page doesn't specifically show 5.9 content at this stage (and likely won't until much later), so it needs to be changed to learn.wordpress.org homepage.

Props hlashbrooke, audrasjb, davidbaumwald.
Fixes #54755.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-06 09:18:06 +00:00
audrasjb
2699b3032a Help/About: Correction on the documentation link about adding new themes.
In the Themes Screen Help Tab, the "Documentation on Adding New Themes" link previously targeted the "Using Themes" HelpHub post whereas it had to target the "Install Themes" section of "Appearance Themes Screen" HelpHub post, which is more relevant.

Props jdy68.
Fixes #54709.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52044 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-05 22:14:59 +00:00
Sergey Biryukov
c9cf90786c Upgrade/Install: Make first comment URLs translatable.
This allows translators to localize the `https://wordpress.org/` and `https://gravatar.com/` URLs in the first comment on a new installation.

Follow-up to [2409], [37888], [37921].

Props kebbet, desrosj.
Fixes #54535.
Built from https://develop.svn.wordpress.org/trunk@52451


git-svn-id: http://core.svn.wordpress.org/trunk@52043 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-05 21:07:00 +00:00
davidbaumwald
55aaefe766 Login and Registration: Remove aria-expanded from "Generate Password" button.
During password resets, the 'Generate Password" button has a `aria-expanded="true"` attribute, but the button itself does not expand or collapse anything.  This change adds a `skip-aria-expanded` class to the button which is referenced in JavaScript to skip updating the `aria-expanded` attribute on the button itself when clicked.  

This change also resets the `aria-expanded` attribute to `false` for the parent form after it's submitted.

Props alexstine, johnjamesjacoby, sabernhardt.
Fixes #54538.
Built from https://develop.svn.wordpress.org/trunk@52450


git-svn-id: http://core.svn.wordpress.org/trunk@52042 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-05 17:37:03 +00:00
hellofromTonya
9f9440a039 Build/Test Tools: Add the 5.9 branch to the workflow for testing branches.
Built from https://develop.svn.wordpress.org/trunk@52449


git-svn-id: http://core.svn.wordpress.org/trunk@52041 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 21:31:01 +00:00
Sergey Biryukov
5fc6f2a488 Trunk is now 6.0-alpha.
Built from https://develop.svn.wordpress.org/trunk@52448


git-svn-id: http://core.svn.wordpress.org/trunk@52040 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 20:54:00 +00:00
Sergey Biryukov
e61c53f2e1 Post WordPress 5.9 RC1 version bump.
Built from https://develop.svn.wordpress.org/trunk@52446


git-svn-id: http://core.svn.wordpress.org/trunk@52038 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 20:41:02 +00:00
Sergey Biryukov
d7f62c5732 WordPress 5.9 RC1.
Built from https://develop.svn.wordpress.org/trunk@52445


git-svn-id: http://core.svn.wordpress.org/trunk@52037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 20:15:08 +00:00
hellofromTonya
790d5ac07a Help/About: Use "refactoring" noun form in WordPress 5.9 About Page.
Follow-up to [52438].

Props tobifjellner, costdev, marybaum.
See #54270.
Built from https://develop.svn.wordpress.org/trunk@52444


git-svn-id: http://core.svn.wordpress.org/trunk@52036 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 19:50:01 +00:00
ryelle
cfd9559523 Administration: Add missing texture image for Welcome panel & About page.
See #54489, #54270.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52035 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 19:18:01 +00:00
ryelle
6868a257c1 Administration: Refresh the Dashboard Welcome panel.
With its last major update in 3.5, the welcome panel was feeling stale. This bright new design showcases links to recent features, including patterns, the site editor, and styles, depending on whether you have a block theme active.

Props jameskoster, desrosj, noisysocks, critterverse, karmatosed, hellofromtonya, smit08, melchoyce, poena, audrasjb, webcommsat, marybaum.
See #54489.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52034 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 19:13:02 +00:00
davidbaumwald
5d9af9adac HTTP API: Improve docs for wp_remote_retrieve_header function return value.
This change updates the `@return` docs for `wp_remote_retrieve_header` to specify that an array can also be returned if the requested header key has multiple values.

Props robtarr, johnjamesjacoby, felipeelia, hellofromTonya, costdev.
Fixes #51736.
Built from https://develop.svn.wordpress.org/trunk@52441


git-svn-id: http://core.svn.wordpress.org/trunk@52033 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 18:54:00 +00:00
hellofromTonya
79a705c8d8 Coding Standard: Remove empty space at end of inline comment in _add_default_theme_supports().
Follow-up to [52439].

See #54731.
Built from https://develop.svn.wordpress.org/trunk@52440


git-svn-id: http://core.svn.wordpress.org/trunk@52032 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 18:49:00 +00:00
hellofromTonya
e414b65dfe Themes: Make block themes support HTML5 by default.
For block themes, [52369] added HTML5 support for `'comment-list'`, `'comment-form'`, `'style'`, and `'script'`. However, when sites upgrade to 5.9 with non-block content such as a gallery and caption, the markup was not HTML5. 

This commit adds full HTML5 theme feature support for block themes. Non-block content such as a `[gallery]` and `[caption]` shortcodes will natively be in HMTL5 markup without block themes needing to specifically add `add_theme_support( 'html5, .. )` to the theme. 

Follow-up to [24417], [27302], [34261], [52369], [52383], [52386].

Props @joyously, costdev, hellofromTonya, audrasjb, Mamaduka, ocean90.
Fixes #54731. See #54597.
Built from https://develop.svn.wordpress.org/trunk@52439


git-svn-id: http://core.svn.wordpress.org/trunk@52031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 18:40:00 +00:00
ryelle
ee6093c4eb Help/About: WordPress 5.9 About Page.
Introducing the new About page for 5.9.

Props dansoschin, critterverse, webcommsat, marybaum, nalininonstopnewsuk, sabernhardt, costdev, chanthaboune, cbringmann, mkaz, davidbaumwald, ryelle, melchoyce, annezazu, paaljoachim, audrasjb, hellofromtonya, walbo, tobifjellner, mitogh


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


git-svn-id: http://core.svn.wordpress.org/trunk@52030 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 18:35:03 +00:00
audrasjb
90100ff883 Embeds: Fix oEmbed host script enqueueing on block-based themes.
This change fixes oEmbed host script enqueueing on front-end when using block themes.

It deprecates `wp_oembed_add_host_js` in favor of `wp_maybe_enqueue_oembed_host_js`. The action is still triggered in `default-filters.php` to ensure backward compatibility for websites that are removing the action. There is now a `has_action()` check in `wp_maybe_enqueue_oembed_host_js()` to see if `wp_oembed_add_host_js()` has not been unhooked from running at the `wp_head` action.

Follow-up to [52132], [52151], [52153], [52325].

Props swissspidy, westonruter, flixos90, kafleg.
Fixes #44632.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 15:23:59 +00:00
audrasjb
b042b70e68 REST API: Add unit tests for the 404 template slug handler.
Props ockham, SergeyBiryukov, hellofromTonya, rachelbaker.
Fixes #54680.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52028 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 14:25:02 +00:00
audrasjb
937398741b Login and registration: Rename login_language_switcher_args to login_language_dropdown_args.
This change adds better consistency with the other `*_dropdown_args` filters, like `taxonomy_parent_dropdown_args` or `widget_archives_dropdown_args`. It is also more consistent with the new `login_display_language_dropdown` filter.

Props SergeyBiryukov, faisal03.
Fixes #54696.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52027 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 08:30:04 +00:00
noisysocks
28a12c8bce Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- Site Logo: Add option to set site icon from Site Logo block
- Navigation: Enable even more compact setup state.
- Remove template parts from post content inserter an __unstable filter
- Template Editor Mode: Hide editor mode switcher
- Avoid using CSS variables for block gap styles
- Try to fix auto resizing in template part focus mode
- Lower the specificity of font size CSS Custom Properties in the editor
- Site icon: Fix site icon styling to display non-square site icons within a square button
- [Site Editor]: Register block editor shortcuts
- Update regex to handle 404 template slug
- Site Editor: Remove dead code
- [Block Editor]: Restrict delete multi selected blocks shortcut
- Fix: Gradients are not being applied by class
- Update: Make the global styles subtitles font smaller
- Post Content/Title: Reflect changes when previewing post
- ServerSideRender: Fix loading state
- [Block Library]: Fix editable post blocks in Query Loop with zero queryId
- Post Excerpt: Fix previews
- WP59: Contextualize "Export" string to differentiate it from other occurrences in WP Core
- Tools Panel: Fix race conditions caused by conditionally displayed ToolsPanelItems
- ToolsPanel: Allow items to register when panelId is null
- Font Size Picker: Allow non-integers as simple CSS values and in hints
- [Components - FontSizePicker]: Use incremental sequence of numbers as labels for the available font-sizes at the segmented control (conditionally)

See #54487.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 05:39:28 +00:00
audrasjb
15b614acc3 Revisions: Improve _set_preview for case when autosave is missing.
This change fixes an issue where autosaves are deleted when a new autosave is sent with the same data. In the block editor, this causes the preview data to be missing on post previews. The end result of this is that if one set a preview image using a block theme on a published post and preview it, the featured image is not displayed correctly. Skipping deleting the previous autosave fixes the issue.

Props adamsilverstein, walbo, audrasjb, Mamaduka, hellofromTonya.
Fixes #54708.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52025 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 00:20:01 +00:00
audrasjb
4f16b910f3 Login and registration: Rename two filters related to language dropdown for better consistency.
This change renames two filters introduced in WP 5.9 development cycle. It replaces `display_login_language_dropdown` with `login_display_language_dropdown` and `wp_login_language_switcher_args` with `login_language_switcher_args`, for better consistency with the other existing `login_*` filters.

Props kebbet, mukesh27, audrasjb, Clorith, hellofromTonya.
Fixes #54696.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52024 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-03 22:14:00 +00:00
Sergey Biryukov
65ebdf45d8 Coding Standards: Use strict comparison in wp-admin/options.php.
Follow-up to [21852], [47874], [51075].

See #53359.
Built from https://develop.svn.wordpress.org/trunk@52431


git-svn-id: http://core.svn.wordpress.org/trunk@52023 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-03 21:28:01 +00:00
audrasjb
ed53ea3ace Twenty Twenty-Two: Sync updates from GitHub for RC 1.
This commit syncs changes for the default theme from its active development repository to core.

This is a follow up to [52081], [52107], [52164], [52222], [52283], [52335], [52375], and [52392].

To view the full set of changes, visit 2ce387178f...8564fd281f.

This changeset also deletes three unused files. These were removed from the dev repo, but never removed from core.

Props richtabor, kjellr.
See #54318.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52022 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-03 20:26:04 +00:00
hellofromTonya
cfcff52de3 External Libraries: Update jQuery hoverIntent to version 1.10.2.
This updates the `jquery-hoverintent` dependency from 1.10.1 to 1.10.2, which fixes the deprecation of `jQuery.isFunction`.

For a full list of changes, see https://github.com/briancherne/jquery-hoverIntent/compare/v1.10.1...v1.10.2.

Follow-up to [50521].

Props titsmaker.
Fixes #54722. See #51812.
Built from https://develop.svn.wordpress.org/trunk@52429


git-svn-id: http://core.svn.wordpress.org/trunk@52021 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-03 15:03:18 +00:00
Sergey Biryukov
54b155f4a5 Coding Standards: Use strict comparison in wp-admin/options-reading.php.
Follow-up to [16816].

See #53359.
Built from https://develop.svn.wordpress.org/trunk@52428


git-svn-id: http://core.svn.wordpress.org/trunk@52020 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-02 16:47:05 +00:00
Sergey Biryukov
5abfff6c70 Happy New Year! 🎄
Update copyright year to 2022 in `license.txt` and bundled themes.
Built from https://develop.svn.wordpress.org/trunk@52427


git-svn-id: http://core.svn.wordpress.org/trunk@52019 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-01 00:15:02 +00:00
audrasjb
c8050da1d3 Users: Use the "Posts" post type general name to contextualize the string used in Users posts count column label.
Since some locales may differentiate "Posts" generic post type name (works for both posts, pages, and custom post types) and "Posts" when speaking about blogposts, this change aims to contextualize the use of the "Posts" string in the "Users" admin screen. This change reuses the string used for the "Posts" post type registration, to avoid introducing any new string to translate.

Props audrasjb, jdy68, SergeyBiryukov.
Fixes #54712.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52018 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-31 15:30:01 +00:00
Sergey Biryukov
3ec2d2fcfa Build/Test Tools: Update PHPCompatibilityWP to version 2.1.3.
The latest release takes the new polyfills added in WordPress 5.9 into account.

This commit also removes redundant inline ignore comments for WP-polyfilled functionality. The PHPCompatibilityWP ruleset explicitly excludes those polyfills, so they don't need to be annotated as ignored.

Release notes:
https://github.com/PHPCompatibility/PHPCompatibilityWP/releases/tag/2.1.3

For a full list of changes in this update, see the PHPCompatibilityWP GitHub:
https://github.com/PHPCompatibility/PHPCompatibilityWP/compare/2.1.2...2.1.3

Follow-up to [46290], [51543].

Props jrf.
Fixes #54711.
Built from https://develop.svn.wordpress.org/trunk@52425


git-svn-id: http://core.svn.wordpress.org/trunk@52017 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-31 13:55:03 +00:00
Sergey Biryukov
2e8ac63be2 Tests: Add a unit test for the recommended MariaDB version in readme.html.
Per the [https://mariadb.org/about/#maintenance-policy MariaDB maintenance policy], MariaDB releases are supported for 5 years from the first stable (GA) release.

The test ensures that the recommended MariaDB version in `readme.html` is not older than 5 years.

Follow-up to [31291], [35759], [52319], [52358], [52418], [meta11407], [52420], [52421].

Fixes #41490.
Built from https://develop.svn.wordpress.org/trunk@52424


git-svn-id: http://core.svn.wordpress.org/trunk@52016 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-30 16:29:02 +00:00
John Blackbourn
1a137ef17a Docs: Further corrections and improvements to the inline documentation for wpdb.
See #53399, #54610

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


git-svn-id: http://core.svn.wordpress.org/trunk@52015 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-29 23:14:01 +00:00
John Blackbourn
678f2ceb0d Docs: Miscellaneous inline documentation improvements.
See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@52014 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-29 17:28:00 +00:00
Sergey Biryukov
9fb855eb48 Tests: Correct the check for the recommended MySQL version in readme.html.
This updates the regular expression in the test to retrieve the date of the first, instead of the last, GA release for the recommended MySQL branch, in order to properly track the EOL date.

Additionally, as the currently recommended MySQL 5.7 branch moved from active support to extended support on 2020-10-21, and WordPress core is not fully compatible with MySQL 8.0 at this time, this commit increases the “supported” period from 5 to 8 years to include extended support.

Follow-up to [31291], [35759], [meta11407], [52420].

See #41490.
Built from https://develop.svn.wordpress.org/trunk@52421


git-svn-id: http://core.svn.wordpress.org/trunk@52013 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-29 16:36:05 +00:00
Sergey Biryukov
aef38ab0e6 General: Bump the recommended MySQL and MariaDB versions in readme.html.
* MySQL 5.6 has reached EOL (“End of Life”) in February 2021. The recommended minimum is bumped to 5.7 for now.
* MariaDB 10.1 has reached EOL in October 2020. The recommended minimum is bumped to 10.2 for now.

Follow-up to [31291], [35759], [52319], [52358], [meta11407].

Props JavierCasares, SergeyBiryukov.
See #41490, #meta5999.
Built from https://develop.svn.wordpress.org/trunk@52420


git-svn-id: http://core.svn.wordpress.org/trunk@52012 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-28 17:38:04 +00:00
Sergey Biryukov
05a3e19924 Plugins: Escape the WordPress.org plugin page URL in the Plugin Installation modal.
Follow-up to [8540], [38953].

Props chintan1896, Presskopp, dimadin, henry.wright, aezazshekh, SergeyBiryukov.
Fixes #54362.
Built from https://develop.svn.wordpress.org/trunk@52419


git-svn-id: http://core.svn.wordpress.org/trunk@52011 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-27 16:06:02 +00:00
Sergey Biryukov
2caff694aa Tests: Separate the tests for recommended PHP and MySQL versions in readme.html
This aims to simplify the individual tests and reduce duplication using a helper function.

Follow-up to [52260], [52319], [52358].

See #41490.
Built from https://develop.svn.wordpress.org/trunk@52418


git-svn-id: http://core.svn.wordpress.org/trunk@52010 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-26 23:42:05 +00:00
audrasjb
3366e3859f Login and Registration: Use secondary button style for the Language switcher.
This change avoids having two primary buttons in the login screen.

Props rainbowgeek, audrasjb.
Fixes #54692.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52009 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-25 11:36:59 +00:00
audrasjb
d738794637 Docs: Typo correction in validate_file() comments.
See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52008 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-25 11:17:04 +00:00
Sergey Biryukov
ef7cf47ec4 Administration: Make sure the $customize_url variable is always defined in the admin menu.
This avoids an `Undefined variable` PHP warning when displaying other admin menu items.

Follow-up to [52069], [52134], [52158], [52178], [52414].

Props afragen.
Fixes #54682.
Built from https://develop.svn.wordpress.org/trunk@52415


git-svn-id: http://core.svn.wordpress.org/trunk@52007 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-25 03:32:03 +00:00
Sergey Biryukov
7996e87f38 Toolbar: Show the Customize link on front end when using a block theme if any plugins use the Customizer.
In WordPress 5.9, when a block theme is being used, the `Appearance → Customize` admin menu item is not present unless a plugin uses the Customizer.

The Customize admin bar node should be shown on the front end if any plugins are using the Customizer, even if the current theme is a block theme.

This commit mirrors a similar check in the admin menu to determine if the Customize link should be displayed.

Follow-up to [52069], [52134], [52158], [52178].

Props pbiron, audrasjb, sabernhardt, costdev.
Fixes #54683.
Built from https://develop.svn.wordpress.org/trunk@52414


git-svn-id: http://core.svn.wordpress.org/trunk@52006 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-25 03:17:04 +00:00
Sergey Biryukov
aea5f0cbde External Libraries: Update the SimplePie library to version 1.5.8.
This minor update corrects the `SIMPLEPIE_VERSION` constant and updates the changelog after the previous release.

Release notes: https://github.com/simplepie/simplepie/releases/tag/1.5.8

For a full list of changes in this update, see the SimplePie GitHub:
https://github.com/simplepie/simplepie/compare/1.5.7...1.5.8

Follow-up to [47733], [49176], [52393].

Props faisal03, jrf, audrasjb, SergeyBiryukov.
Fixes #54659.
Built from https://develop.svn.wordpress.org/trunk@52413


git-svn-id: http://core.svn.wordpress.org/trunk@52005 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-24 18:06:06 +00:00
Sergey Biryukov
67b9822eda Build/Test Tools: Allow the PHPCS plugin in Composer configuration.
The `dealerdirect/phpcodesniffer-composer-installer` Composer plugin is used to register external PHPCS standards with PHPCS.

As of Composer 2.2, Composer plugins need to be explicitly allowed to run. This commit adds the necessary configuration for that to prevent Composer asking every single time `composer install` or `composer update` is run.

Reference: [https://blog.packagist.com/composer-2-2/#more-secure-plugin-execution Composer 2.2: More secure plugin execution].

Props jrf, johnbillion.
Fixes #54686.
Built from https://develop.svn.wordpress.org/trunk@52412


git-svn-id: http://core.svn.wordpress.org/trunk@52004 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-23 20:12:03 +00:00
Sergey Biryukov
ee282eba1b Build/Test Tools: Restore the https URL for browserify-aes.
Follow-up to [52000], [52156], [52402].

See #54487.
Built from https://develop.svn.wordpress.org/trunk@52411


git-svn-id: http://core.svn.wordpress.org/trunk@52003 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-23 17:03:04 +00:00
audrasjb
b788e6255a Docs: Typo correction in wp_get_layout_style() introduced in 5.9.
Follow-up to [52069].

See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52002 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-22 23:20:04 +00:00
Sergey Biryukov
4a22a4cec3 Editor: Add missing default template areas to the post/page editor settings.
This ensures that default template area settings are displayed when editing a template in the post/page editor, which previously got lost during backporting for 5.9.

Follow-up to [52232].

Props Mamaduka, costdev, gziolo.
Fixes #54679.
Built from https://develop.svn.wordpress.org/trunk@52409


git-svn-id: http://core.svn.wordpress.org/trunk@52001 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-22 13:00:03 +00:00
Sergey Biryukov
9cb7908de2 Post WordPress 5.9 Beta 4 version bump.
Built from https://develop.svn.wordpress.org/trunk@52408


git-svn-id: http://core.svn.wordpress.org/trunk@52000 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 21:14:59 +00:00
Sergey Biryukov
e88674b232 WordPress 5.9 Beta 4.
Built from https://develop.svn.wordpress.org/trunk@52407


git-svn-id: http://core.svn.wordpress.org/trunk@51999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 20:32:59 +00:00
hellofromTonya
673ab8a677 Administration: Add "File" to Theme/Plugin Editor menu names and relocate "Plugin File Editor" to Tools for block themes.
[52232] relocated the Theme Editor menu item from Appearance to Tools for block themes. This commit relocates the Plugin  Editor menu item from Plugins to Tools for block themes for a consistent workflow.

Both the Theme Editor and Plugin Editor menu items are renamed to "Theme File Editor" and "Plugin File Editor" respectively. Why? To better identify their purpose, i.e. to directly edit the code in the theme or plugin files. The rename is not limited to only block themes. 

Follow-up to [52232].

Props poena, annezazu, audrasjb, clorith, courane01, costdev, dryanpress, desrosj, hellofromTonya, ipstenu, jameskoster, joen, johnbillion, joyously, manfcarlo, marybaum, pbiron, SergeyBiryukov, walbo, youknowriad.
Fixes #54382.
Built from https://develop.svn.wordpress.org/trunk@52406


git-svn-id: http://core.svn.wordpress.org/trunk@51998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 20:06:02 +00:00
audrasjb
5e08149bf4 Coding Standards: Remove unwanted whitespaces after [52404].
Follow-up to [52404].

See #54675.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51997 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 19:00:00 +00:00
audrasjb
d0b3567730 Login and registration: Add a filter to allow to disable the Login screen language dropdown.
This change introduces the `display_login_language_dropdown` filter which allows to disable the Login screen language dropdown. 

Follow-up to [52058].

Props rickcurran, audrasjb, ocean90, hellofromtonya, costdev, johnbillion.
Fixes #54675.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51996 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 18:52:03 +00:00
Sergey Biryukov
e6b9b96130 Docs: Improve the @since 5.9.0 note for WP_Theme_JSON::PRESETS_METADATA.
Follow-up to [52320], [52401].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@52403


git-svn-id: http://core.svn.wordpress.org/trunk@51995 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 10:20:04 +00:00
isabel_brison
4939393799 Update @wordpress packages for Beta 4
Update packages with these bug fixes from Gutenberg:

Navigation: Remove hardcoded typography units
Handle parsed request
Navigation: Refactor modal padding to be simpler and more flexible
Show notice on save in site editor
Add aria-pressed true/false to Toggle navigation button based on state
Components FontSizePicker: Use incremental sequence of numbers
Custom keys from theme.json: fix kebabCase conversion
Template Part: Fix 'isMissing' condition check
Multi-Entity Saving: Decode HTML entities in item titles
Font sizes: update default values
Query Loop: Add useBlockPreview, fix Query Loop wide alignment
Only add dialog role to navigation when modal is open
Fix navigation appender
Show a UI warning when user does not have permission to update/edit a Navigation block
Block editor: Fix Enter handling for nested blocks
Update: Use subtitle styles for the palette names
Allow publishing a post while not saving changes to non-post entities
Update: Block top level useSetting paths
Fix Site Logo block alignment issues
Editor: when Toggle navigation receives state false, focus
ToolsPanel: Allow items to register when panelId is null
Block Support Panels - Make block support tools panels compatible
Gallery: Fix block registration hook priority
Navigation: Fix page list issues in overlay
Ensure the overlay menu works when inserting navigation block pattern
Restrict Navigation permissions and show UI warning if cannot create
Add block gap support for group blocks
Try cascading nav styles through classnames
Fix: Impossible to edit theme and default colors
Fix: Color editor discards colors with default name
Site Editor: Fix template author avatar check
Template Editing Mode: Fix options dropdown
Avoid undo issues when reset parent blocks for controlled blocks
Add comment-form and comment-list to html5 theme support and fix comment layout

Props hellofromtonya.
See #54487.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51994 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 07:02:34 +00:00
hellofromTonya
af941fc10c Editor: Add support for nameless font sizes in WP_Theme_JSON.
With nameless font sizes support, themes use the defaults by not declaring the `"name"` setting for their `fontSizes` in `theme.json`.

Backport from Gutenberg https://github.com/WordPress/gutenberg/pull/37410.

Follow-up to [50973], [52049], [52275], [52320].

Props ntsekouras, costdev, hellofromTonya.
Fixes #54640. See #54487.
Built from https://develop.svn.wordpress.org/trunk@52401


git-svn-id: http://core.svn.wordpress.org/trunk@51993 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 06:02:06 +00:00
hellofromTonya
770e631dfc Editor: Add 'edit_theme_options' capabilities to wp_navigation post type.
Adds `'edit_theme_options'` capabilities top restrict Navigation permission.

Partial backport from Gutenberg https://github.com/WordPress/gutenberg/pull/37454.

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

Props spacedmonkey, get_dave, hellofromTonya.
See #54487.
Built from https://develop.svn.wordpress.org/trunk@52400


git-svn-id: http://core.svn.wordpress.org/trunk@51992 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 04:26:00 +00:00
hellofromTonya
84229df562 REST API: Support . in theme directory names in WP_REST_Global_Styles_Controller, WP_REST_Templates_Controller, and WP_REST_Themes_Controller.
Regex changes from [52376] are reverted to restore the original regex patterns. Why? [52376] used an include characters pattern, which was too limiting. It did not account for localized characters, such as `é`, or other valid directory name characters.

The original theme directory regex pattern, i.e. `[^.\/]+(?:\/[^.\/]+)?` excluded the period `.` character. Removing the `.` character resolves the reported issue by allowing matching for `themes/theme-dirname-1.0/` or `themes/<subdirname>/theme-dirname-1.0/`.

As the pattern used an exclude approach, all characters are valid for matching except for `/`. However, not all characters are cross-platform valid for directory names. For example, the characters `/:<>*?"|` are not valid on Windows OS. The pattern now excludes those characters.

The theme's directory (or subdirectory) name pattern matching is now used in `WP_REST_Global_Styles_Controller`, `WP_REST_Templates_Controller`, and `WP_REST_Themes_Controller`.

Follow-up to [51003], [52051], [52275], [52376].

Props costdev, hellofromTonya, spacedmonkey, TimothyBlynJacobs, bijayyadav, kafleg.
Fixes #54596.
Built from https://develop.svn.wordpress.org/trunk@52399


git-svn-id: http://core.svn.wordpress.org/trunk@51991 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 04:14:00 +00:00
hellofromTonya
28b0710360 Application Passwords: Show HTTPS required message without filtering when not enabled or not in local environment.
When `add_filter( 'wp_is_application_passwords_available', '__return_false' )` exists, HTTPS requirement message is shown even if HTTPS is enabled on the site. This happens because `wp_is_application_passwords_available_for_user()` first invokes `wp_is_application_passwords_available()` which is filterable. The situation could happen if the `'wp_is_application_passwords_available_for_user'` filter returns `false`.

To fix this, the check for HTTPS (or if in a 'local' environment) is moved to a new function called `wp_is_application_passwords_supported()`. Then the return from this function is used as an OR condition for the Application Passwords section and for displaying the HTTPS required message.

Tests are included for both `wp_is_application_passwords_supported()` and `wp_is_application_passwords_available()`.

Follow-up to [51980], [51988].

Props davidbinda, SergeyBiryukov, ocean90, felipeelia, costdev, hellofromTonya.
Fixes #53658.
Built from https://develop.svn.wordpress.org/trunk@52398


git-svn-id: http://core.svn.wordpress.org/trunk@51990 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 02:45:03 +00:00
hellofromTonya
f067011b59 Editor: Explicitly declare $post_types and $area properties in WP_Block_Template class.
The `$post_types` and `$area` properties are assigned in the `_build_block_template_result_from_file()` and `_build_block_template_result_from_post()` functions. However, neither property was explicitly declared in the `WP_Block_Template` class.

This commit explicitly declares both properties in the class. Why? (1) To make the code more readable and maintainable; (2) to avoid a `Deprecated: Creation of dynamic property WP_Block_Template::$post_types is deprecated` deprecation when PHP 8.2 is released.

Ref:
* PHP 8.2 Deprecate dynamic properties https://wiki.php.net/rfc/deprecate_dynamic_properties

Follow-up to [52062].

Props jrf.
Fixes #54670.
Built from https://develop.svn.wordpress.org/trunk@52397


git-svn-id: http://core.svn.wordpress.org/trunk@51989 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 00:28:00 +00:00
hellofromTonya
bf60226e36 General: Fix 'rel' argument in Tests_Functions_wpListBookmarks test datasets.
`wp_list_bookmarks()` arguments include `'link_rel'`, but not `'rel'`. This commit fixes this argument in the test datasets. It also adds an expected `'rel=""'` result check, i.e. instead of only checking for `'noopener'`.

Follow-up to [52395].

Props davidbinda.
Fixes #53839.
Built from https://develop.svn.wordpress.org/trunk@52396


git-svn-id: http://core.svn.wordpress.org/trunk@51988 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 00:12:03 +00:00
hellofromTonya
a3dedd1d4d Script Loader: Skip getting 'can_compress_scripts' option in script_concat_settings() during install.
When installing a multisite, there is a potential access to a non-existent database table that needs to be skipped to avoid warnings/errors. This fix checks is WordPress is not installing before getting the `'can_compress_scripts'` option.

Props schlessera.
Fixes #54634.
Built from https://develop.svn.wordpress.org/trunk@52395


git-svn-id: http://core.svn.wordpress.org/trunk@51987 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-20 23:53:01 +00:00
audrasjb
ea138fdcb9 Docs: Typo correction in wp_dropdown_languages() DocBlock.
Follow-up to [52058].

See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51986 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-20 22:26:02 +00:00
Sergey Biryukov
c3112cab39 External Libraries: Update the SimplePie library to version 1.5.7.
This version shows significant improvements in the compatibility of SimplePie with PHP 8.0, 8.1, and even contains an initial PHP 8.2 fix. The release also contains a number of other bug fixes.

Release notes: https://github.com/simplepie/simplepie/releases/tag/1.5.7

For a full list of changes in this update, see the SimplePie GitHub:
https://github.com/simplepie/simplepie/compare/1.5.6...1.5.7

Follow-up to [47733], [49176].

Props jrf, SergeyBiryukov.
Fixes #54659.
Built from https://develop.svn.wordpress.org/trunk@52393


git-svn-id: http://core.svn.wordpress.org/trunk@51985 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-20 19:33:00 +00:00
jffng
9759353922 Twenty Twenty-Two: Sync updates from GitHub for Beta 4.
This commit syncs changes for the default theme from its active development repository to core. 

This is a follow up to [52081], [52107], [52164], [52222], [52283], [52335], and [52375]. It updates the theme's font size presets and fixes an issue with query padding.

To view the full set of changes, visit 623a4d7982...d6cb56cce4.

Props schlessera, williampatton, hellofromtonya, kjellr.
See #54318.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51984 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-20 16:50:05 +00:00
Sergey Biryukov
cc5119e5e1 Tests: Use shared fixtures in block theme tests.
This removes duplicate test data and aims to avoid future confusion about which themes to use in which tests.

Follow-up to [52049], [52246], [52247], [52279].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@52391


git-svn-id: http://core.svn.wordpress.org/trunk@51983 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-19 16:25:02 +00:00
John Blackbourn
3324ed52ad Build/Test Tools: Remove the assertion in filter_rest_url_for_leading_slash().
This assertion can mask the fact that some other tests don't perform an assertion.

Fixes #54661

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


git-svn-id: http://core.svn.wordpress.org/trunk@51982 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-19 14:29:00 +00:00
John Blackbourn
1af8544d80 Build/Test Tools: Reduce the use of unnecessary randomness in tests.
This increases the overall reliability of the tests.

Props johnillo

Fixes #37371

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


git-svn-id: http://core.svn.wordpress.org/trunk@51981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-19 13:44:00 +00:00
Sergey Biryukov
3d4ac53c89 Tests: Fix typo in a data provider name.
Follow-up to [52261], [52387].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@52388


git-svn-id: http://core.svn.wordpress.org/trunk@51980 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-18 21:46:00 +00:00
Sergey Biryukov
28b48cecd6 Tests: Fix typo in a test method name.
Follow-up to [52261].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@52387


git-svn-id: http://core.svn.wordpress.org/trunk@51979 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-18 21:17:59 +00:00
Sergey Biryukov
d37081cac2 Tests: Move the tests for theme features that block themes should support by default to a more appropriate place.
As these tests are intended for the `_add_default_theme_supports()` function rather than `WP_Theme` class methods, the `tests/theme.php` file is a more logical place for them than `tests/theme/wpTheme.php`.

Follow-up to [52369], [52383].

See #54597.
Built from https://develop.svn.wordpress.org/trunk@52386


git-svn-id: http://core.svn.wordpress.org/trunk@51978 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-18 21:10:03 +00:00
audrasjb
8698dc9721 Site Health: Typo correction in Site Health help tab.
Follow-up to [52053].

Props pedromendonca.
Fixes #54656.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51977 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-18 21:02:04 +00:00
antpb
a6a27970a9 Media: Fix selections in Media Library Featured Image modal on open.
In [50829] infinite scrolling was removed from the Media Library and modal which introduced unintended behavior for featured images where only the selected image shows when opening the library. This change reverts only the logic that caused this and applies a proper fix when opening the library.

Props benitolopez, hellofromTonya, joedolson, peterwilsoncc, circlecube, danielbachhuber, PieWP, sabernhardt, szaqal21, dariak, sergeybiryukov.
Fixes #53765.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51976 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-17 20:17:05 +00:00
Sergey Biryukov
0795991b6f Tests: Add unit tests for theme features that block themes should support by default.
By default, block themes should have a few theme supports enabled:
* `post-thumbnails`
* `responsive-embeds`
* `editor-styles`
* `html5` for `comment-form`, `comment-list`, `style`, `script`
* `automatic-feed-links`

They should also load core block assets only when the blocks are rendered. This commit adds the associated tests.

Follow-up to [52369].

Props costdev.
See #54597.
Built from https://develop.svn.wordpress.org/trunk@52383


git-svn-id: http://core.svn.wordpress.org/trunk@51975 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-16 14:47:04 +00:00
Sergey Biryukov
1eb2a65984 Tests: Mock the HTTP request response in download_url() tests.
This aims to speed up the tests and minimize unrelated failures by avoiding an unnecessary external HTTP request, while still performing the intended functionality checks.

Update similar helpers in some other tests to use more consistent terminology.

Follow-up to [37907], [46175], [51626].

See #54420, #53363.
Built from https://develop.svn.wordpress.org/trunk@52382


git-svn-id: http://core.svn.wordpress.org/trunk@51974 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-15 20:01:00 +00:00
Sergey Biryukov
df494e0987 Tests: Add an assertion to test the WP_REST_Server::add_site_logo_to_index() method.
Additionally:
* Move the test for `WP_REST_Server::add_active_theme_link_to_index()` to a more logical place.
* Replace `assertEquals()` with `assertSame()` in site icon test to also check the type of the value.
* Use a more consistent pattern for the tests.

Follow-up to [51241], [52080].

Props ignatggeorgiev, desrosj, SergeyBiryukov.
Fixes #53516. See #53363.
Built from https://develop.svn.wordpress.org/trunk@52381


git-svn-id: http://core.svn.wordpress.org/trunk@51973 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-15 18:08:05 +00:00
isabel_brison
7b3c904f37 Fix deprecated usage of passing null to explode()
As of PHP 8.1, explode() does not permit null as its second argument. This results in warnings being spat out on every page because of a usage of this in wp-includes/block-supports/layout.php.

See #53635.
Props noisysocks.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51972 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-15 04:08:04 +00:00
Sergey Biryukov
e02e7be1b6 Post WordPress 5.9 Beta 3 version bump.
Built from https://develop.svn.wordpress.org/trunk@52379


git-svn-id: http://core.svn.wordpress.org/trunk@51971 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 21:25:01 +00:00
Sergey Biryukov
58bb50562c WordPress 5.9 Beta 3.
Built from https://develop.svn.wordpress.org/trunk@52378


git-svn-id: http://core.svn.wordpress.org/trunk@51970 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 20:25:59 +00:00
hellofromTonya
4132ac0f48 Editor: Add "Featured" patterns from pattern directory to Patterns in block inserter.
This commit backports the remote "Featured" category request and loads it into the Featured Patterns in the block inserter.

Props ryelle.
Fixes #54623.
Built from https://develop.svn.wordpress.org/trunk@52377


git-svn-id: http://core.svn.wordpress.org/trunk@51969 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 19:39:06 +00:00
hellofromTonya
84d67f77f6 REST API: Add block theme support for valid non-alphanumeric characters in theme's directory name.
Themes whose `wp-content/themes/<dirname>` include valid non-alphanumeric (cross-platform) characters work for non-block themes, but did not previously resolve for block themes. For example, a block theme in `wp-content/themes/twentytwentytwo-0.4.0/` directory resulted a 404 "No route was found matching the URL and request method" response when attempting to customize it in the Site Editor.

This commit adds support for the following characters in a theme's root directory: `_`, `.`, `@`, `[`, `]`, `(`, and `)`. Subdirectory themes and `-` are already supported.

Follow-up to [51003], [52051], [52275].

Props mkaz, costdev, hellofromTonya, jffng, justinahinon, peterwilsoncc, spacedmonkey, TimothyBlynJacobs.
Fixes #54596.
Built from https://develop.svn.wordpress.org/trunk@52376


git-svn-id: http://core.svn.wordpress.org/trunk@51968 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 18:24:01 +00:00
jffng
b3c06d8bb1 Twenty Twenty-Two: Sync updates from GitHub for Beta 3.
This commit syncs minor changes for the default theme from its active development repository to core. 

This is a follow up to [52081], [52107], [52164], [52222], [52283], and [52335]. The two main changes introduce global padding to site content while still allowing content to be full-width, and re-organize block patterns into Core's existing categories. 

To view the full set of changes, visit da994d1fe5...88a8f2e3b4.

Props onemaggie, joen, youknowriad, scruffian, sabernhardt, kjellr.
See #54318.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51967 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 17:11:01 +00:00
spacedmonkey
f1f71a0798 REST API: Ensure that the get_theme_item method should respect fields param.
Fix the `get_theme_item` method in the `WP_REST_Global_Styles_Controller` class to respect the fields param context filtering and to return links. 

Props spacedmonkey, hellofromtonya, peterwilsoncc, costdev.
Fixes #54595.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51966 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 16:31:00 +00:00
John Blackbourn
0124d01d1d Database: Correct and improve documentation for properties and parameters in wpdb.
See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@51965 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 16:24:02 +00:00
hellofromTonya
65a4199149 Themes: Rename public static functions in WP_Theme_JSON_Resolver to remove custom_post_type references.
WordPress Core is not really custom and does not reference "custom post type" in its function naming. This commit renames 2 public static methods:

* `WP_Theme_JSON_Resolver::get_user_custom_post_type_id()` renamed to `WP_Theme_JSON_Resolver::get_user_global_styles_post_id()`.
* `WP_Theme_JSON_Resolver::get_user_data_from_custom_post_type()` renamed to `WP_Theme_JSON_Resolver:: get_user_data_from_wp_global_styles()`.

Follow-up to [52049], [52051], [52069], [52232], [52275], [52364].

Props antonvlasenko, bernhard-reiter, costdev, desrosj, hellofromTonya, noisysocks, oandregal, SergeyBiryukov.
Fixes #54517.
Built from https://develop.svn.wordpress.org/trunk@52372


git-svn-id: http://core.svn.wordpress.org/trunk@51964 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 16:14:01 +00:00
hellofromTonya
edf755823b Customize: Overlay incompatible banner for block themes.
Starting in 5.9, block themes are not compatible with (do not support) Customizer; rather, they use the Site Editor. Viewing installed themes in Customizer, this commit adds an overlay message to alert users and give them a way to activate the block theme. Clicking on the "Activate" button activates the block theme and redirects back to the Appearance > Themes interface, where the user can then enter the Site Editor for customization.

Non-block themes are not affected by this change and continue to work in Customizer.

Follow-up to [41648], [41893], [52279].

Props antonvlasenko, costdev, hellofromTonya, jffng, joyously, noisysocks, poena, shaunandrews.
Fixes #54549.
Built from https://develop.svn.wordpress.org/trunk@52371


git-svn-id: http://core.svn.wordpress.org/trunk@51963 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 15:33:01 +00:00
hellofromTonya
dfef2c917f Formatting: Use is_scalar() in sanitize_key().
This is a follow-up to [52292] which introduced `is_string()` to check the given key is a string to be sanitized, else the key is set to an empty string. 

`sanitize_key()` is clearly identified (in the documentation) to only work with ''string'' keys. However, it had a bug in it that allowed non-strings to pass through it:
* A non-scalar "key" would throw a PHP Warning (which was resolved in [52292]. 
* A non-string scalar "key" was handled by the PHP native `strtolower()` which converted it into a string.

While `is_string()` is valid, non-string scalar types passed as the key to be sanitized were being set to an empty string. Given that `strtolower()` handles these without error or deprecation as of PHP 8.1, `is_scalar()` protects the website from issues while retaining the past behavior of converting integer keys (for example) into a string.

Changes include:
* Using `is_scalar()` instead of `is_string()`
* Refactor for readability and less code
* More tests

Please note, this does not change the behavior of the function, nor redefine it to now accept non-string scalars.

References:
* https://developer.wordpress.org/reference/functions/sanitize_key/
* https://www.php.net/manual/en/function.strtolower.php

Follow-up [52292].

Props wppunk, hellofromTonya, costdev, jrf.
Fixes #54160.
Built from https://develop.svn.wordpress.org/trunk@52370


git-svn-id: http://core.svn.wordpress.org/trunk@51962 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 15:01:03 +00:00
audrasjb
9b694a6f49 Editor: Activate missing default theme features for block themes.
By default, block themes should have a few theme supports enabled by default. These are: `post-thumbnails`, `responsive-embeds`, `editor-styles`, `html5`, `automatic-feed-links`. This changeset backports the changes introduced in https://github.com/WordPress/gutenberg/pull/35593.

Props noisysocks, ocean90, youknowriad, audrasjb, hellofromTonya.
Fixes #54597.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51961 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 09:49:00 +00:00
audrasjb
1309e62457 Posts, Post Types: Add missing translation context on FSE related post types labels.
This makes it easier for translators to identify the context of each label. This change also brings consistency with other built-in post types.

Follow-up to [52145], [52069], [52062], [52041], [51003].

Props audrasjb, hellofromTonya.
Fixes #54611.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51960 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 09:09:01 +00:00
audrasjb
bcb9285589 Docs: Use generic references to "Database" in wp-config-sample.php.
This replaces the references to "MySQL" info in the WordPress configuration sample file. Using the generic term "Database" now refers to either MySQL or MariaDB.

Props Ov3rfly, audrasjb, hellofromTonya.
Fixes #54610.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51959 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 08:44:02 +00:00
audrasjb
e5a1ed2fb2 Docs: Typo correction in TinyMCE related JS file.
Follow-up to [45066].

See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51958 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 08:30:04 +00:00
noisysocks
3cd0e25c03 Filter custom block templates with PHP
This method calls get_block_templates once and uses block template properties
directly for filtering. This way, we can avoid hitting the database for each
public post type.

The previous method is useful when we already know the current post type we
request templates for, like when using REST API.

Follows [52334].
See #54335.
Props mamaduka, youknowriad.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51957 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 02:46:00 +00:00
noisysocks
935058d178 Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- Image block: Set image display to grid when no alignment sent to properly align caption on resize
- Update and align template descriptions
- Site Editor - prevent loading state from showing the admin menu.
- Add client side routing for Site Editor
- Navigation: Add clearance for appender in submenus.
- Fix CSS Custom Properties for presets in the site editor
- Add/navigation blocks post processing after migration from menu items
- Allow selector ordering to ensure theme.json root selector margin takes precedence 
- Do not remove theme presets if defaults are hidden
- Format library: fix unsetting highlight color
- FSE: Fix template resolution to give precedence to child theme PHP templates over parent theme block templates with equal specificity
- ColorPalette: Improving accessibility and visibility
- Update: Make the color popover on the gradient picker appear as expected
- Site Editor: Display a notice if export fails
- Fix docs and function naming for gallery block registration in PHP
- Switch to addEventListener for load event in the navigation block view script
- Fix mistake in _remove_theme_attribute_in_block_template_content
- Better synchronisation between Gutenberg and Core code
- Move the block page templates hook into compat/5.9 folder
- Moves to the template loader hooks and functions into lib/compat folder
- Refactor the gutenberg_is_fse_theme function to use wp_is_block_theme
- Site Editor: Update support doc URL in Welcome Guide
- Global Styles: Add Welcome Guide toggle
- Hide remove control point when removing would break gradient control
- Don't request the deprecated navigation areas endpoint outside of the Gutenberg plugin
- Image: Fix resizer controls being hidden in Safari when switching between alignments
- Remove Navigation Menus from WP Admin sidebar
- Site Editor: Hide the block appender in the Template Part editor
- Site Editor: Use server definition for the Template Areas
- Synchronize wp_is_block_theme and block-templates block support with Core
- E2E: Retry login again after a bad nonce request to prevent intermittent test failures 
- Fix theme requirement validation with WP 5.8
- Fix WP 5.9 check for conditionally running code
- Fix post comment form input width
- Border Style Control: Update styling for consistency with border width control
- Fix form-submit styles by adding button classes to the submit-button in post-comments block
- Site Editor: Fix edit template part link in header dropdown
- Move duotone palette to the bottom of global styles gradients
- Fix how appearanceTools works
- Move WP 5.9 wp-admin menus compatibility code to lib/compat folder
- Revert "Site Editor: Set the <title> on the list page to be same as the CPT name"
- Site Editor: Document Actions: add SR text to heading 1
- Do not register global styles CPT in WordPress 5.9
- Global Styles: Move the 'Edit colors' button to a standard menu item
- Fix styles for previews and patterns
- Site Editor: Fix failing E2E test
- Templates: Search for old template names in the parent theme too
- Remove 4 instances of 'gutenberg' text domain from WordPress core
- Fix content loss when ungrouping template parts or reusable blocks
- Simplify the RESET_BLOCK action to fix template part focus mode content loss
- [Global Styles]: Make Blocks section more distinguishable
- Only use block markup for comment form button when using a block theme
- Navigation: Fix vertical alignment of page list in modal.
- Fix: ToggleGroupControl active state
- Remove gutenberg_ prefix from @wordpress/block-library

Props ocean90, oandregal, hellofromtonya, youknowriad.
See #54487.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 01:57:26 +00:00
spacedmonkey
120b1ab117 REST API: Ensure that the parent link, uses the rest_get_route_for_post function.
In [51962] the `rest_get_route_for_post` function was implemented in all places where link to a post's REST API endpoint is needed. However in this commit, the up link, which links to the parent post of the current object, did not use this function.   

Props Spacedmonkey, SergeyBiryukov.
Fixes #53656.



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


git-svn-id: http://core.svn.wordpress.org/trunk@51955 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-13 15:20:03 +00:00
Sergey Biryukov
d09d194f12 Docs: Capitalize "ID", when referring to a widget ID or sidebar ID, in a more consistent way.
Follow-up to [48104], [52357], [52361].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@52362


git-svn-id: http://core.svn.wordpress.org/trunk@51954 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-13 10:21:07 +00:00
audrasjb
cfd6406f8f Docs: Capitalize "ID", when referring to a sidebar ID in a more consistent way.
Follow-up to [52016].

See #53399.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51953 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-12 19:01:02 +00:00
audrasjb
f4683efbc9 Docs: Document the global used in upgrade_590() function.
Follow-up to [51917].

See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51952 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-12 17:57:00 +00:00
Sergey Biryukov
02e384322f Build/Test Tools: Disable WP Cron when installing PHPUnit tests.
During the WordPress installation process when running the test suite, an HTTP request was always fired by a cron task and failed, because tests are run in CLI mode only.

To avoid that, the `DISABLE_WP_CRON` constant was previously added to the `bootstrap.php` file. However, the constant is not passed to the `install.php` script. This commit makes a similar change to `install.php`.

Follow-up to [760/tests], [872/tests].

Props Chouby.
Fixes #54612.
Built from https://develop.svn.wordpress.org/trunk@52359


git-svn-id: http://core.svn.wordpress.org/trunk@51951 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-12 15:48:00 +00:00
Sergey Biryukov
88bf87de8c General: Mark the recommended MariaDB version number in readme.html with a <strong> tag.
This brings consistency with the MySQL version number.

Follow-up to [52319].

See #41490.
Built from https://develop.svn.wordpress.org/trunk@52358


git-svn-id: http://core.svn.wordpress.org/trunk@51950 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-12 14:58:00 +00:00
Sergey Biryukov
6cb050d878 Docs: Capitalize "ID", when referring to a post ID, term ID, etc. in a more consistent way.
Follow-up to [48104].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@52357


git-svn-id: http://core.svn.wordpress.org/trunk@51949 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-12 14:54:00 +00:00
Sergey Biryukov
75fc6b755b Docs: Update a comment in wp-admin/load-styles.php per the documentation standards.
Follow-up to [52352].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@52356


git-svn-id: http://core.svn.wordpress.org/trunk@51948 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-12 14:52:02 +00:00
Sergey Biryukov
8bdaf90a14 Docs: Update some @var tags per the documentation standards.
Follow-up to [27398], [29487], [41626], [51003].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@52355


git-svn-id: http://core.svn.wordpress.org/trunk@51947 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-11 19:50:59 +00:00
audrasjb
adee0cbf6b Docs: Docblock adjustments in some 5.9 block related functions.
Adds missing `@since` mention to `wp_enqueue_block_style()` and `_wp_multiple_block_styles()`, and a few other minor changes. 

Follow-up to [52069].

See #53359.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51946 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-11 11:16:03 +00:00
hellofromTonya
f847144952 Themes: Show only "Customize" or "Activate" button in block theme's Theme Details modal.
At the bottom of a block theme's "Theme Details" modal, only one button will be displayed:
* "Customize" button when the block theme is activated;
* Else, the "Activate" button.

The "Live Preview", "Editor beta", and "Navigation Menus" buttons are removed.

Follow-up to [15646], [52341], [52346].

Props poena, ryelle, kafleg, antonvlasenko, costdev, SergeyBiryukov, hellofromTonya.
Fixes #54578.
Built from https://develop.svn.wordpress.org/trunk@52353


git-svn-id: http://core.svn.wordpress.org/trunk@51945 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-10 20:33:00 +00:00
Sergey Biryukov
3beb1d25ab Docs: Correct the format of some comments per the documentation standards.
Follow-up to [10357], [10939], [43309], [51003], [51266], [51653], [51738], [52110].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@52352


git-svn-id: http://core.svn.wordpress.org/trunk@51944 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-10 20:30:05 +00:00
Peter Wilson
88b1019dc3 Upgrade/install: Revert upgrader rollback features.
Revert the rollback features introduced for theme and plugin upgrades during the WordPress 5.9 cycle. A bug (suspected to be in third party virtualisation software) causes the upgrades to fail consistently on some set ups. The revert is to allow contributors further time to investigate mitigation options.

Reverts [52337], [52289], [52284], [51951], [52192], [51902], [51899], [51898], [51815].

Props pbiron, dlh, peterwilsoncc, galbaras, SergeyBiryukov, afragen, costdev, bronsonquick, aristath, noisysocks, desrosj, TobiasBg, hellofromTonya, francina, Boniu91.
See #54543, #54166, #51857.



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


git-svn-id: http://core.svn.wordpress.org/trunk@51943 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-10 00:06:04 +00:00
Sergey Biryukov
852fad7531 Coding Standards: Remove a trailing comma from a compact() call in _wp_customize_include().
This fixes a `Trailing comma's are not allowed in function calls in PHP 7.2 or earlier` error in the PHP compatibility check.

Follow-up to [52348].

See #53359.
Built from https://develop.svn.wordpress.org/trunk@52350


git-svn-id: http://core.svn.wordpress.org/trunk@51942 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-09 15:32:01 +00:00
Sergey Biryukov
7ffc7c29cc Editor: Add an editor settings flag to enable the new gallery for mobile apps for 5.9.
Currently the WordPress mobile apps rely on the `__unstableGalleryWithImageBlocks` flag being set in order to enable the new gallery block format.

This commit includes the value in the `get_default_block_editor_settings()` function in order to ensure that versions of the mobile app >= 18.2 will be able to add and edit gallery blocks in the new format.

Props glendaviesnz, ocean90, hellofromTonya, noisysocks.
Fixes #54583.
Built from https://develop.svn.wordpress.org/trunk@52349


git-svn-id: http://core.svn.wordpress.org/trunk@51941 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-09 15:25:01 +00:00
Sergey Biryukov
d8934f9acb Coding Standards: Simplify or wrap some long conditions in wp-includes/theme.php for better readability.
Includes adjusting some DocBlocks per the documentation standards.

Follow-up to [35595], [41937], [52256].

See #53359, #53399.
Built from https://develop.svn.wordpress.org/trunk@52348


git-svn-id: http://core.svn.wordpress.org/trunk@51940 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-09 15:13:04 +00:00
youknowriad
0441885c15 Themes: Auto-enable block-templates support for all block themes.
Block themes without theme.json file used to have block-templates support disabled.
This commit brings this in sync with the behavior in the gutenberg plugin.

See #54335.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51939 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-09 09:56:04 +00:00
Sergey Biryukov
62574145ce Coding Standards: Use camel case with a lowercase first letter for the blockTheme array key.
This matches the WordPress JS naming conventions and the naming of other keys in the `$prepared_themes` array.

Follow-up to [52341].

See #54578, #53359.
Built from https://develop.svn.wordpress.org/trunk@52346


git-svn-id: http://core.svn.wordpress.org/trunk@51938 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-08 10:16:05 +00:00
audrasjb
12369a6425 Coding Standards: Correct alignment in blocks.php and class-wp-rest-templates-controller.
See #53359.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51937 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 22:49:59 +00:00
Sergey Biryukov
abed17b03d Post WordPress 5.9 Beta 2 version bump.
Built from https://develop.svn.wordpress.org/trunk@52344


git-svn-id: http://core.svn.wordpress.org/trunk@51936 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 21:58:01 +00:00
Sergey Biryukov
600aa23dd6 WordPress 5.9 Beta 2.
Built from https://develop.svn.wordpress.org/trunk@52343


git-svn-id: http://core.svn.wordpress.org/trunk@51935 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 21:20:59 +00:00
spacedmonkey
ec370a0af4 REST API: Improve permission handling in global style endpoint.
The new wp_global_styles post type is registered to use edit_theme_options in the capability settings. The WP_REST_Global_Styles_Controller class's permission checks methods use the capability in a hard coded form rather than looking up the capability via the post type object. Changing the permission callbacks to lookup capabilities via the post type object, allows theme and plugin developers to modify the capability used for editing global styles via a filter and these values to be respected via the Global Styles REST API.

Props Spacedmonkey, peterwilsoncc, hellofromTonya , antonvlasenko, TimothyBlynJacobs, costdev, zieladam.
Fixes #54516.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51934 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 20:58:00 +00:00
hellofromTonya
9aba2584bb Themes: Hide "Live Preview" button for FSE block themes.
Currently, the Site Editor does not have a live preview feature for non-activated block themes.

This commit is a stop-gate to remove the "Live Preview" button for those themes. It avoids confusing users and avoiding a notification message that doesn't make sense.

Props antonvlasenko, costdev, hellofromTonya, kafleg, paaljoachim.
Fixes #54578.
Built from https://develop.svn.wordpress.org/trunk@52341


git-svn-id: http://core.svn.wordpress.org/trunk@51933 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 20:07:00 +00:00
spacedmonkey
40b22d1209 REST API: Ensure that the export template endpoint returns a valid WP_Error object.
Ensure that the export template endpoint returns a WP_Error object, including code and message, so that the site editor can display an error message. 
Add some basic unit tests to ensure that permission checks are working as expected. 

Follow-up to [52286].

Props Spacedmonkey, dlh, hellofromTonya , Mamaduka, TimothyBlynJacobs.
Fixes #54448.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51932 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 18:38:02 +00:00
audrasjb
153e27f625 Coding Standards: Replace else if with elseif after [52338].
Follow-up to [52338].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51931 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 17:49:01 +00:00
audrasjb
cdafa716f7 Script Loader: Allow for wp_register_script() to be called after wp_enqueue_script().
When a plugin registers styles/scripts on `wp_enqueue_scripts` (as plugin authors are encouraged to do), and conditionally enqueues their script/style on `the_content` filter, things "just work". In block themes, `the_content` is run prior to the header being processed, which results in the above scenario failing.

This change makes a `wp_enqueue_script( 'example' ); wp_register_script( 'example' );` work, where as currently the enqueue silently fails (no "doing it wrong" message) and the following register has no impact. Scripts can therefore be enqueued and dequeued (by "handle") before they are registered.

Fixes #54529.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51930 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 17:46:01 +00:00
hellofromTonya
4f0c8ef665 Upgrade/Install: Fix moving plugins folder in WP_Upgrader:: move_to_temp_backup_dir().
[51815] introduced the creation of a temporary backup of plugins before updating.

The `move()` (and later, `move_dir()`) call) uses a `$src` parameter.
For Hello Dolly, this is `<path>/wp-contents/plugins/.` (note the period at the end).

For users on Linux and Mac, this doesn't appear to cause any problems.
However, on Windows, the move causes the plugins folder to be moved which then causes a failure when attempting to call `mkdir()`.

This commit skips any plugin whose slug is `'.'` as this slug results in the `$src` value ending in a period. 

Follow-up to [51815].

Props costdev, boniu91, hellofromTonya.
Fixes #54543.
Built from https://develop.svn.wordpress.org/trunk@52337


git-svn-id: http://core.svn.wordpress.org/trunk@51929 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 16:51:03 +00:00
youknowriad
ec25c4ee57 Site Editor: Render the template descriptions properly.
The initializaion of the editor was a bit different between Gutenberg and Core.
This brings them in sync which solves the missing descriptions from the template header
in the site editor.

See #54337.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51928 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 16:40:01 +00:00
jffng
ef4271cfee Twenty Twenty-Two: Sync updates from GitHub.
This commit syncs minor changes for the default theme from its active development repository to core. 

This is a follow up to [52081], [52107], [52164], [52222], and [52283]. It reduces the size of a video asset, renames the templates and template parts directories, and adds CSS for button hover states. To view the full set of changes, visit 1a121e0224...da994d1fe5.

Props kjellr, mburridge, sabernhardt, hellofromtonya, scruffian.
See #54318.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51927 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 16:38:02 +00:00
youknowriad
76419adcaa Block Editor: Only list custom block templates in the template selector.
Previously all block templates including the hierarchy templates were being shown in the CPT template selector.

Props mamaduka.
See #54335.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51926 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 16:33:05 +00:00
hellofromTonya
177a4d830b REST API: Pass post type name to rest_get_route_for_post_type_items().
The new `rest_get_route_for_post_type_items()` function accepts a string, not an object. This commit passes the post type name instead of the object to resolve a notice in the site editor page.

Follow-up to [52281].

Props walbo.
Fixes #54536.
Built from https://develop.svn.wordpress.org/trunk@52333


git-svn-id: http://core.svn.wordpress.org/trunk@51925 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 16:15:02 +00:00
John Blackbourn
39bff93b6b Docs: Various inline documentation corrections and improvements.
See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@51924 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 12:20:02 +00:00
youknowriad
bc3356601e Site Editor: Update the block template descriptions.
Align the template descriptions with the latest changes from the Gutenberg plugin.

Props jameskoster, SergeyBiryukov.
See #54335.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51923 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 12:12:04 +00:00
hellofromTonya
f70fb51f99 Themes: Better names for WP_Theme::is_block_theme() and wp_is_block_theme() and make wp_is_block_theme() a wrapper.
This commit renames the following method and function to better represent block theme terminology:

* `WP_Theme::is_block_based()` to `WP_Theme::is_block_theme()`
* `wp_is_block_template_theme()` to `wp_is_block_theme()`

It also changes `wp_is_block_theme()` to be a helper wrapper (sugar syntax) for `wp_get_theme()->is_block_theme();`. Why? To ensure both the method and function behave the same, to help Gutenberg maintain WordPress cross-version compatibility, and to make it less cumbersome to port changes from Gutenberg to Core.

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

Props antonvlasenko, costdev, hellofromTonya, noisysocks.
Fixes #54550.
Built from https://develop.svn.wordpress.org/trunk@52330


git-svn-id: http://core.svn.wordpress.org/trunk@51922 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 00:02:02 +00:00
hellofromTonya
2e2829904b Editor: Allow theme.json to take precedence in setting the root level element's reset margin value.
Any margin added to the root element via `theme.json` is overwritten by a CSS reset margin value provided by the Gutenberg Plugin.

This commit makes `theme.json` setting take precedence by generating the global styles body reset prior to processing the theme.json.

Follow-up to [52049].

Props get_dave, hellofromTonya.
Fixes #54550.
Built from https://develop.svn.wordpress.org/trunk@52329


git-svn-id: http://core.svn.wordpress.org/trunk@51921 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-06 22:42:00 +00:00
Sergey Biryukov
47c4ff7102 HTTP API: Revert changeset [52244].
Reverting Requests 2.0.0 changes and moving to WordPress 6.0 cycle. Why? The namespace and file case renaming revealed 2 issues in Core's upgrader process.

See https://core.trac.wordpress.org/ticket/54504#comment:22 for more information.

Follow-up to [52327].

See #54562, #54504.
Built from https://develop.svn.wordpress.org/trunk@52328


git-svn-id: http://core.svn.wordpress.org/trunk@51920 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-06 21:30:03 +00:00
hellofromTonya
8045f6a42b HTTP API: Revert changeset [52315].
Reverting Requests 2.0.0 changes and moving to WordPress 6.0 cycle. Why? The namespace and file case renaming revealed 2 issues in Core's upgrader process.

See https://core.trac.wordpress.org/ticket/54504#comment:22 for more information.

See #54562, #54504.
Built from https://develop.svn.wordpress.org/trunk@52327


git-svn-id: http://core.svn.wordpress.org/trunk@51919 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-06 18:31:05 +00:00
Sergey Biryukov
18d741be37 KSES: Use the polyfilled PHP 8 string functions in _wp_kses_allow_pdf_objects():
* `str_contains()`
* `str_ends_with()`
* `str_starts_with()`

Additionally, include a test for a PDF file in an `<object>` tag with an unsupported protocol.

Follow-up to [51963], [52039], [52040], [52304], [52309].

Props TobiasBg, ramonopoly.
See #54261.
Built from https://develop.svn.wordpress.org/trunk@52326


git-svn-id: http://core.svn.wordpress.org/trunk@51918 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-06 11:08:01 +00:00
Sergey Biryukov
a9edd7ba88 Build/Test Tools: Remove the replace:emoji-banner-text Grunt task.
The task was previously used to ensure that `/*! This file is auto-generated */` comment is not included on front end as part of the inline emoji detection script.

As the `wp-emoji-loader.js` script is now included via `file_get_contents()` and `wp_print_inline_script_tag()` instead of `grunt-include` to simplify the logic, the task does not find anything to replace and is no longer necessary.

Additionally, include a line break before the `wp-emoji-loader.js` script content for better line wrapping.

Follow-up to [48096], [50651], [52132].

See #44632, #44306, #53363.
Built from https://develop.svn.wordpress.org/trunk@52325


git-svn-id: http://core.svn.wordpress.org/trunk@51917 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-06 10:14:06 +00:00
noisysocks
3060ce0b59 Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- Gallery block: turn on auto-migration of v1 Gallery blocks to v2 format when edited
- Add accessible labelling to submenu buttons.
- Improve performance of wp_navigation lookup. 
- Various inline docblock corrections
- Use core version of template and template part post types and REST endpoints for WP 5.9, with back compat for 5.8
- Gradients: Enable adding custom gradient when gradients are disabled
- Custom color palette: add default color name
- Color Picker: Re-instate debounce and controlled value to fix issue with gradient picker
- Add aria-current="page" to active navigation item
- Site Editor: Templat list fallback to slug
- Fix: Custom color picker popover position
- Fix: php 5.6 error in theme JSON class.
- Update the WP_Theme_JSON_Gutenberg class to be like the core one
- Update the WP_Theme_JSON_Resolver_Gutenberg class to be like the core one
- Move Global Styles code to lib/compat/wordpress-5.9 folder
- E2E Tests: Fix failing image e2e test by waiting for required element
- Navigation: Try removing absorb toolbar prop.
- Navigation: Fix navigation justifications.
- Fix wordbreak for URLs
- Polish unset color indicator.
- Template revert flow: Make label description source agnostic
- [Block Library - Navigation]: Fix vertical layout
- Add: Corners to custom color picker popover
- Add: Missing margin to the color picker clear button
- Gradient: Fix clearing a custom gradient from throwing a React warning
- [Block Library]: Rename Query Pagination blocks
- PHP Unit Tests: Use global transients 
- Remove CSS that causes conflict with theme.json
- Add actions which fire during the loading process of block template parts
- Fix usage of useSetting('color.palette')
- Update micromodal, include click-through fix
- Site Editor: Remove unused PHP code
- Don't try and render unstable location if Nav block has ID
- Fix gutenberg prefixed function references in core
- Card: support the extraSmall option for the size prop
- Gallery block: enable the new gallery block by default if running in core 
- Block fixtures: Change port to 8889 to placate KSES
- Full Site Editing: Remove block template resolution unit tests
- Site Editor: Sync export API

See #54487.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51916 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-06 06:20:27 +00:00
Sergey Biryukov
f5d79e0b23 Docs: Add missing summary for WP_Theme_JSON_Resolver::get_merged_data().
Follow-up to [50959].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@52323


git-svn-id: http://core.svn.wordpress.org/trunk@51915 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-05 18:02:08 +00:00
Sergey Biryukov
6e09421269 Coding Standards: Break the $path reference after a foreach loop in block_editor_rest_api_preload().
When using a `foreach` loop with a value assigned by reference, the variable continues to point to the last array element even after the loop, so it is recommended to destroy it by `unset()` to avoid unexpected behavior later on.

See [https://www.php.net/manual/en/control-structures.foreach.php PHP Manual: foreach].

Follow-up to [52312], [52313].

Props TobiasBg.
See #54558.
Built from https://develop.svn.wordpress.org/trunk@52322


git-svn-id: http://core.svn.wordpress.org/trunk@51914 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-04 17:20:00 +00:00
Sergey Biryukov
6b84ae03ad Docs: Further update some @since notes in WP_Theme_JSON methods for clarity.
Follow-up to [52049], [52306], [52320].

See #53399, #54336.
Built from https://develop.svn.wordpress.org/trunk@52321


git-svn-id: http://core.svn.wordpress.org/trunk@51913 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-04 15:57:01 +00:00
Sergey Biryukov
7f9d7a5905 Docs: Some documentation improvements for WP_Theme_JSON and WP_Theme_JSON_Resolver classes:
* Make the `@since 5.9.0` notes more specific. When mentioning that parameters or values have been added or changed, it is generally also helpful to include their exact names and the nature of changes for future reference.
* Update some DocBlocks per the documentation standards.

Follow-up to [52049], [52306].

See #53399, #54336.
Built from https://develop.svn.wordpress.org/trunk@52320


git-svn-id: http://core.svn.wordpress.org/trunk@51912 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-04 12:58:01 +00:00
audrasjb
3d5b5f21e1 General: Add MariaDB in the readme.html requirements.
This change updates the WordPress `readme.html` file to reflect WordPress.org requirements: as of WordPress 5.9, MariaDB 10.1 and higher versions are supported by WP. See https://wordpress.org/about/requirements/. 

Fixes #41490.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51911 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-03 23:09:59 +00:00
audrasjb
9a9afacf38 Docs: Replace @since 5.9 with @since 5.9.0 in block-template-utils.php.
Follow-up to [52317], [52275], [52062].

See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51910 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-03 22:26:59 +00:00
audrasjb
a945234aba Docs: Miscellaneous Docblock corrections for block-template-utils.php file.
Follow-up to [52275], [52062].

See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51909 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-03 22:09:59 +00:00
hellofromTonya
64fe3efe28 Editor: Resolve template request ?_wp-find-template=true for new posts and pages.
The template resolution system makes a request like `/?page_id=1234&_wp-find-template=true`, depending on `WP_Query` to resolve a page or post using the page_id or p (post_id) in the query string. With new posts/pages, a placeholder post with the status auto-draft is created. But by default `WP_Query` will not resolve these posts, unless the query is specifically set to look for them.

This commit handles the query string to properly resolve a page or post. It adds 2 private callbacks for the processing.

Props poena, noisysocks, bernhard-reiter, costdev, hellofromTonya.
Fixes #54553.
Built from https://develop.svn.wordpress.org/trunk@52316


git-svn-id: http://core.svn.wordpress.org/trunk@51908 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-03 19:39:00 +00:00
hellofromTonya
b32e8f7284 HTTP API: Fix classname WpOrg\Requests\Proxy\Http in WP_Http::request().
Renaming the classname was missed in [52244] when updating changes in `WP_Http::request()` for the Requests 2.0.0 external library upgrade. `HTTP` class no longer exists and caused a fatal error `Fatal error: Uncaught Error: Class 'WpOrg\Requests\Proxy\HTTP' not found`.

This commit renames the class to `Http` and resolves the fatal error.

Follow-up to [52244].

Props alexeydemidov, costdev, mukesh27.
Fixes #54562.
Built from https://develop.svn.wordpress.org/trunk@52315


git-svn-id: http://core.svn.wordpress.org/trunk@51907 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-03 18:03:59 +00:00
hellofromTonya
6f51efd066 Editor: Enable incomplete unit tests in Tests_Block_Template_Utils:: test_get_block_template_from_file().
At the time tests were backported from Gutenberg, a block template theme was not available in the test suite; thus, the test was marked as `markTestIncomplete()`.

Now that `block-theme` and `block-theme-child` test fixture block template themes are available, this commit removes the `markTestIncomplete()` and adjusts the test to run by switching to the `block-theme` test fixture.

Follow-up to [51003], [52062], [52247].

Props bernhard-reiter.
Fixes #54551.
Built from https://develop.svn.wordpress.org/trunk@52314


git-svn-id: http://core.svn.wordpress.org/trunk@51906 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-03 16:59:00 +00:00
audrasjb
b09f0e4fdd Coding standards: Address a few coding standards issues after [52312].
Follow-up to [52312].

See #54558.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51905 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-03 15:36:00 +00:00
audrasjb
dc86357471 Editor: Avoid undefined index notices in the Template Parts Editor.
This changes adds a leading slash when needed in the `?context=edit` path to avoid an `undefined index` notice in the Template Parts Editor.

Follow-up to [52275].

Props kafleg, costdev, mukesh27, Boniu91.
Fixes #54558.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51904 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-03 15:30:08 +00:00
audrasjb
cbadb65a2a REST API: Use global transients for URL details endpoint.
Follow-up to [51973].

Props peterwilsoncc, costdev.
Fixes #54499.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51903 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-03 11:36:09 +00:00
Sergey Biryukov
9ff51215ad Tests: Fix typo in a WP_Test_REST_Posts_Controller test method name.
Follow-up to [42423].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@52310


git-svn-id: http://core.svn.wordpress.org/trunk@51902 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-03 05:59:01 +00:00
Peter Wilson
37180741b4 KSES: Accept port number in PDF upload paths.
Improves the URL validation in `_wp_kses_allow_pdf_objects()` to account for sites using an upload path that contains a port, for example wp.org:8080.

Follow up to [51963], [52304].

Props ocean90, ramonopoly, talldanwp.
See #54261.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51901 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-03 02:44:00 +00:00
audrasjb
ddfe23a9aa Editor: Allow child theme PHP templates to take precedence over parent theme block templates.
This change fixes template resolution to give precedence to child theme PHP templates over parent theme block templates with equal specificity.

Before this change, when a theme was using a PHP template of a certain specificity (e.g. `page-home.php`), and it happened to be a child theme of another theme which had a block template for the same specificity (e.g. `page-home.html`), WordPress was picking the parent theme’s block template over the child theme’s PHP template to render the page. If the PHP and block template have equal specificity, the child theme's template should be used.

The issue was fixed before in Gutenberg so the fix now needs to happen in Core.

This change also re-enables the preexisting template resolution unit tests.

Follow-up to [51003].

Props bernhard-reiter, youknowriad.
Fixes #54515.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51900 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-02 23:36:59 +00:00
audrasjb
53096e6796 Docs: Docblock typo correction in WP_Theme_JSON_Schema.
Follow-up to [52306].

See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51899 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-02 20:45:01 +00:00
audrasjb
ef4fe197b8 Docs: Add missing @since tag to WP_Theme_JSON_Schema functions.
Follow-up to [52049].

See #53399, #54336.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51898 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-02 20:27:07 +00:00
Sergey Biryukov
2d6493056b Docs: Fix typo in some get_edit_term_link() test DocBlocks.
Follow-up to [52180], [52255].

See #50225, #53399.
Built from https://develop.svn.wordpress.org/trunk@52305


git-svn-id: http://core.svn.wordpress.org/trunk@51897 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-02 05:41:04 +00:00
Peter Wilson
2d944ca1d9 KSES: Allow attributes to be restricted via callbacks.
Add callback validation to HTML tag attributes for increased flexibility over an array of values only.

In `object` tags, validate the `data` attribute via a callback to ensure it is a PDF and matches the `type` attribute. This prevents mime type mismatches in browsers.

Follow up to [51963].

Props Pento, dd32, swissspidy, xknown, peterwilsoncc.
Fixes #54261.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51896 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-02 00:56:01 +00:00
audrasjb
8d723966d0 Docs: Add missing @param to wp_set_unique_slug_on_create_template_part().
Follow-up to [52062].

See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51895 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-02 00:01:00 +00:00
audrasjb
38e19413f6 Docs: Miscellaneous Docblock corrections in several /block-supports files.
See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51894 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-01 23:16:04 +00:00
audrasjb
931b03e4f9 Docs: Misc Docblock corrections in duotone.php file.
Follow-up to [50929].

See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51893 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-01 14:07:59 +00:00
John Blackbourn
614b866cb0 Plugins: Correct the documented allowable types for to the $callback parameter of various hook related functions.
These functions don't require the callback to be a valid callable, therefore `array` and `string` are also valid types for this parameter.

Props malthert

Fixes #54440

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


git-svn-id: http://core.svn.wordpress.org/trunk@51892 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-01 13:22:01 +00:00
John Blackbourn
9a982b4ae8 Docs: Various docblock corrections.
See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@51891 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-01 12:17:00 +00:00
audrasjb
15d7d368f3 Docs: Docblock corrections in _disable_block_editor_for_navigation_post_type().
Follow-up to [52145].

See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51890 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-01 11:41:59 +00:00
Sergey Biryukov
980ea5611a Docs: Use a duplicate hook reference for theme_file_path in WP_Theme::get_file_path().
Follow-up to [38578], [52279].

See #51506, #53399.
Built from https://develop.svn.wordpress.org/trunk@52297


git-svn-id: http://core.svn.wordpress.org/trunk@51889 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-01 09:20:04 +00:00
Sergey Biryukov
71f33ed63f Post WordPress 5.9 Beta 1 version bump.
Built from https://develop.svn.wordpress.org/trunk@52296


git-svn-id: http://core.svn.wordpress.org/trunk@51888 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 23:34:01 +00:00
Sergey Biryukov
0cb7d322c7 WordPress 5.9 Beta 1.
Built from https://develop.svn.wordpress.org/trunk@52295


git-svn-id: http://core.svn.wordpress.org/trunk@51887 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 21:36:02 +00:00
Sergey Biryukov
566d5d2170 Options, Meta APIs: Improve error handling in sanitize_option().
To prevent potential false negatives, set `$error` to `null` initially, so we can better tell if it was ever changed during the sanitization and be able to better react if an empty string is added to it.

Additionally, and mainly for the sake of the Settings API at this point, add error messages to some `WP_Error` objects returned from `wpdb` methods that were previously causing the issues here.

Follow-up to [32791].

Props iCaleb, audrasjb, hellofromTonya, SergeyBiryukov.
Fixes #53986.
Built from https://develop.svn.wordpress.org/trunk@52294


git-svn-id: http://core.svn.wordpress.org/trunk@51886 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 21:03:00 +00:00
hellofromTonya
2b2313d56b Editor: Hide visibility and status settings for wp_navigation post type.
Adds CSS to hide both the visibility and status settings for the `wp_navigation` post type.

Props antonvlasenko , costdev. 
Fixes #54407.
Built from https://develop.svn.wordpress.org/trunk@52293


git-svn-id: http://core.svn.wordpress.org/trunk@51885 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 21:01:02 +00:00
hellofromTonya
9ede1fe55b Formatting: Handle non-scalar types passed to sanitize_key().
`sanitize_key()` expects a string type for the given `key`. Passing any other data type to `strtolower()` can result in `E_WARNING: strtolower() expects parameter 1 to be string, array given`.

A check is added that if the key is not a string, the key is set to an empty string. For performance, the additional string processing is skipped if the key is an empty string.

This change maintains backwards-compatibility for valid string keys while fixing the bug of non-string keys.

Props costdev, dd32. 
Fixes #54160.
Built from https://develop.svn.wordpress.org/trunk@52292


git-svn-id: http://core.svn.wordpress.org/trunk@51884 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 20:11:02 +00:00
audrasjb
25b3d172b7 Editor: Avoid a JS console error on the Navigation block view.
Props mkaz, sabernhardt, costdev.
Fixes #54456.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 20:02:01 +00:00
hellofromTonya
68537a8eed Twenty Fourteen: Adjust capability queries when using version before WordPress 5.9-alpha.
As capability queries was introduced in 5.9, this commit allows for previous versions by assigning the "who" and unsetting "capability". 

Follow-up to [51943].

Props johnbillion, swissspidy.
Fixes #16841.
Built from https://develop.svn.wordpress.org/trunk@52290


git-svn-id: http://core.svn.wordpress.org/trunk@51882 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 19:25:01 +00:00
Sergey Biryukov
576116927b Upgrade/Install: Make some adjustments to the move_dir() function:
* Check for direct PHP flle access and only use `rename()` if true.
* Check whether the destination directory was successfully created.
* Clear the working directory so there is internal parity within the function between the results of a successful `rename()` and a fallback to `copy_dir()`.
* Use `move_dir()` in `WP_Upgrader::move_to_temp_backup_dir()` and `::restore_temp_backup()`.

Follow-up to [51815], [51898], [51899], [51902], [52192], [52284].

Props afragen, peterwilsoncc, dd32, SergeyBiryukov.
See #54166, #51857.
Built from https://develop.svn.wordpress.org/trunk@52289


git-svn-id: http://core.svn.wordpress.org/trunk@51881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 19:12:00 +00:00
hellofromTonya
308f814105 Media: Use infiniteScrolling global setting in js/media/controllers/featured-image.js and js/media/controllers/replace-image.js.
Follow-up to [52287] which added an undefined variable. The variable should have been the global `wp.media.view.settings.infiniteScrolling`. This commit brings that global setting into each of the functions and renames the variable using camelCase to comply with JS coding standards.

Follow-up to [52287].

Props SergeyBiryukov.
Fixes #53765.
Built from https://develop.svn.wordpress.org/trunk@52288


git-svn-id: http://core.svn.wordpress.org/trunk@51880 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 19:07:00 +00:00
hellofromTonya
be55859f78 Media: Featured image modal loads only selected image when infinite scroll is disabled.
Follow-up to [52167], which partially fixed a bug introduced in [50829] that caused media modal to only load the selected image.

This commit adds additional checks to ensure infinite scroll is disabled.

Follow-up to [50829], [52167].

Props dariak, joedolson, szaqal21. 
Fixes #53765.
Built from https://develop.svn.wordpress.org/trunk@52287


git-svn-id: http://core.svn.wordpress.org/trunk@51879 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 18:08:01 +00:00
spacedmonkey
13c5637263 Site Editor: Add site export REST API endpoint.
Add a REST API to export site templates and template part as html files. When the REST API is requested, it responds by downloading a single ZIP file and exits early, without completing full request.  To create the exported zip, the ZipArchive class is required. If this class is not present then the export will gracefully fail, returning a `WP_Error` object and 500 status error code. 

Props spacedmonkey, youknowriad, Mamaduka, walbo, peterwilsoncc. 
Fixes #54448 .


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


git-svn-id: http://core.svn.wordpress.org/trunk@51878 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 17:32:02 +00:00
hellofromTonya
5c414db9ad External Libraries: Further fix jQuery deprecations in WordPress core.
Follow-up to [50001], [50270], [50367], [50383], [50410], [50420], [50429], [50547].

Props chaion07, Clorith, costdev, desrosj, malthert, peterwilsoncc, presskopp, promz, sabernhardt, SergeyBiryukov, toro_unit, wpnomad.
Fixes #51519.
Built from https://develop.svn.wordpress.org/trunk@52285


git-svn-id: http://core.svn.wordpress.org/trunk@51877 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 17:18:01 +00:00
Sergey Biryukov
5e35ad4b4a Upgrade/Install: Check that WordPress is installed before scheduling cleanup of the temp-backup directory.
Trying to schedule cron jobs before WordPress is installed results in DB errors, which is suboptimal.

This addresses a  `Table 'wp_options' doesn't exist` error when running the installation with `WP_DEBUG` enabled.

Follow-up to [51815], [51898], [51899], [51902], [52192].

Props dlh, pbiron.
See #51857.
Built from https://develop.svn.wordpress.org/trunk@52284


git-svn-id: http://core.svn.wordpress.org/trunk@51876 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 17:12:01 +00:00
jffng
2caa789ee0 Twenty Twenty-Two: Sync updates from GitHub.
This commit syncs minor changes for the default theme from its active development repository to core. 

This is a follow up to [52081], [52107], [52164], and [52222]. It includes changes to template part markup, theme.json appearance flags, navigation block markup, and text domains. For a full set of changes, visit 742df6cb2b...1a121e0224.

Props poena, kjellr, onemaggie, hellofromtonya.
See #54318.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51875 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 16:19:00 +00:00
audrasjb
b22dfaf657 Tests: Update WP_REST_Global_Styles_Controller_Test "Custom Styles" string after [52280].
Follow-up to [52280].

See #54518.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51874 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 15:55:59 +00:00
hellofromTonya
14f6cf230b REST API: Replace hardcoded wp/v2/ preloaded paths with rest_get_route_for_taxonomy_items() and rest_get_route_for_post_type_items() in wp-admin/site-editor.php.
[51962] and [51964] introduced two new functions: `rest_get_route_for_post_type_items()` and `rest_get_route_for_taxonomy_items()`. These functions replaced hardcoded references in all parts of core that reference taxonomy and post type rest controller endpoints. However, several instances were missed in the `wp-admin/site-editor.php` file.

This commit replaces those remaining hardcoded instances.

Follow-up to [51962], [51964], [52232].

Props spacedmonkey.
Fixes #54536.
Built from https://develop.svn.wordpress.org/trunk@52281


git-svn-id: http://core.svn.wordpress.org/trunk@51873 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 15:54:03 +00:00
audrasjb
4212bcfe36 Editor: Do not translate the title of "Custom Styles" specific posts.
This change removes the internationalization of the "Custom Styles" specific posts as the post title being hardcoded is consistent with `wp_template_part` and `wp_template` post types, and is not publicly visible, except in the database. Moreover, using consistent "Custom Styles" post title may make is easier to retrieve the related posts in the database.

Props antonvlasenko, audrasjb, desrosj, hellofromTonya.
Fixes #54518.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51872 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 15:35:01 +00:00
hellofromTonya
ce3aed3186 Administration: For block themes, link to Site Editor interface instead of Customizer in Dashboard's welcome panel and Themes interface.
For block themes (like Twenty Twenty-Two), Customizer menu item is removed and replaced with the Site Editor menu item. However, other links exist in the Dashboard's welcome panel "Customize Your Site" button and the "Customize" button in each theme listed in the Appearance > Themes interface.

This commit changes each of those remaining links to link to the Site Editor interface instead of the Customizer.

To help identify block vs non-block themes, two method methods are introduced in `WP_Theme`:

* `WP_Theme:: is_block_based()` which identifies if the theme is a block theme or not.
* `WP_Theme::get_file_path()` which is similar to `get_theme_file_path()` but uses the directories within the theme object.

Both of these new methods include test coverage including the addition of a parent and child block theme in test data.

Follow-up to [18749], [35483], [42013], [42169].

Props antonvlasenko, jameskoster, hellofromTonya, matveb, noisysocks, poena, sergeybiryukov.
Fixes #54460.
Built from https://develop.svn.wordpress.org/trunk@52279


git-svn-id: http://core.svn.wordpress.org/trunk@51871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 14:27:03 +00:00
Sergey Biryukov
9c9c576d88 I18N: Remove redundant default text domain parameter in some __() calls.
Follow-up to [51160], [52069].

See #53359.
Built from https://develop.svn.wordpress.org/trunk@52278


git-svn-id: http://core.svn.wordpress.org/trunk@51870 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 08:33:05 +00:00
noisysocks
dc3ffcbde3 Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- Include cascading properties in Navigation deprecation
- Reorganize e2e tests folders and file
- Border panel: Update to display multiple palette origins
- Add CSS fix for 33580
- Add: Uneditable duotone palette on the palette gradient panel
- Site Editor: Allow editing custom template title
- Writing Flow: Double escape unselects all blocks
- Fix icon scaling.
- [Block Library - Query Pagination Next/Previous]: Remove text and link color support
- Add: Border indication to global styles colors.
- Color Picker: Improve border, padding, and box shadow styles.
- theme.json: sort keys alphabetically
- Remove navigationArea context.

See #54487.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51869 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 05:48:28 +00:00
Peter Wilson
43290b2e04 REST API: Fire wp_after_insert_post later in new post object endpoints.
In the new menu items, global items and template controllers manually call the function `wp_after_insert_post()` to manually fire the action of the same name after all potential data is updated.

This accounts for the use case in which a theme or plugin developer has modified the endpoints use of either taxonomy or meta data.

The new parameter `$fire_after_hooks` is added to `wp_update_nav_menu_item()` to control whether the `wp_after_insert_post` action is fired when it in turn calls `wp_insert_post()`.

Props spacedmonkey, peterwilsoncc, zieladam.
Fixes #54536.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 01:10:08 +00:00
noisysocks
e4b553a201 Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- Update Pattern block category and add documentation
- Fix non existent menu handling in nav block
- Make Reusable blocks available in the Site Editor
- Add caching to WP_Theme_JSON_Resolver_Gutenberg::get_user_data_from_custom_post_type()
- theme.json: add appearanceTools flag to opt-in into appearance UI controls
- Update the block theme folders to templates and parts
- Remove reference to gutenberg_, swap with wp_
- Use table layout in templates list screen
- Update featured image placeholder graphic.
- [Inserter]: Adjust order of theme blocks and reorder inserter items
- Implement suitable fallback for Nav block on front end of site when no menu selected
- Toggle Group Control: add tooltip
- Use first non-empty Nav post as primary fallback for Nav block
- Change .nvmrc and documentation for Node.js version (LTS to 14.18.1)
- Update: Migrate global styles user database data on the rest endpoint
- Update global styles public API
- Update: Rename user preset origin to custom
- Try always generating navigation post title
- Show all templates and template parts on the site editor list screens
- Highlight "Site" in the navigation panel
- Fix template part slug generation when creating through the block placeholder
- [Block Library - Post Title]: Fix render error when setting Page to homepage
- Add 'Clear customizations' button to template list page
- Gallery v1: Allow clicks within replace media placeholder state
- Site Editor: Set the <title> on the list page to be same as the CPT name
- Gallery: Fix stuck image size options loader
- Cover: Fix undo trap
- Add success and error snackbars to the templates list page
- Fix: theme colors cannot override defaults
- Fix: Color palette is not being stored
- Add elements support to the typography panel in global styles
- Make links plural in global styles
- Add: Gradient palette editor
- Update some small style regressions in the template list
- Add: Transparency support on global styles colors
- Fix: apply by slug on all origins
- Render empty Nav block if no fallback block can be utilised
- Allow filtering of Nav block fallback
- Fix Nav block fallback DB query to match on full block grammar start tag
- Remove unstable max pages attribute from Nav block
- DateTimePicker: set PM hours correctly
- Update delete template button
- Site Editor: Template list add rename action
- Fix Nav block editing wrong entity on creation of new Menu
- [REST] Restore the missing double slash in the ID received by /templates
- Add icons to navigation sidebar items
- Update function names for the public global styles API functions
- Templates Controller: Add missing 'is_custom' prop
- Rename gutenberg_ to wp_ for some functions that land in WordPress 5.9
- [Block Library - Template Part]:Remove support for conversion to Reusable block
- Global Styles: Call "palettes" and not "color palettes" on panel label
- Add button text when no colors found
- Update: Global Styes: Count all color palette origins on the palette counter
- Rename navigationMenuId to ref
- Offset the parent iframe when computing Popover position 
- Fix: Failing PHPUnit test
- Show theme, plugin or author in Added By column with appropriate icon or avatar
- Add origin and author to template rest api

See #54487.
Props talldanwp, mamaduka, oandregal.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51867 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 00:24:27 +00:00
Peter Wilson
8294b090fb Build/Test Tools: Revert ignore prop change in [52272].
See #54506.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51866 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-29 23:45:03 +00:00
noisysocks
57aee3ba4d Restore block PHP to canonical version in @wordpress/block-library
r52272 erroneously modified `src/wp-includes/blocks/navigation.php`. This file
is copied from `@wordpress/block-library` and so must be updated via npm. This
commit restores the file by running `grunt build --dev`.

Follows [52272].
See #54506.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51865 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-29 23:31:05 +00:00
spacedmonkey
ebf7eb50dc Editor: Remove Navigation Areas
Navigation area were merged as part of full site editing and the new navigation block. This functionality is experimental and not currently used in WordPress core, so should be removed.

Props noisysocks, spacedmonkey, get_dave, zieladam.
Fixes #54506.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51864 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-29 22:06:01 +00:00
audrasjb
31a76e520b Twenty Twenty: Restore Editor post title styles after Gutenberg 11.4.0 updates.
This change restores the Editor post title alignement and font styles in Twenty Twenty after Gutenberg 11.4.0 updates on the editor markup.

Props shireling, mai21, hilayt24, desrosj, sabernhardt.
Fixes #54056.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51863 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-29 22:03:59 +00:00
hellofromTonya
9cc22d060f Media: Replace tests/phpunit/data/images/sugar-mountain.jpg test image.
The test image included in [52269] was invalid at 0 bytes. This commit adds the correct test image.

Follow-up [52269].

See #54385.
Built from https://develop.svn.wordpress.org/trunk@52270


git-svn-id: http://core.svn.wordpress.org/trunk@51862 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-29 20:18:00 +00:00
hellofromTonya
677e6e5b13 Media: Fix TypeError and improve wp_exif_frac2dec() to only return int or float.
For certain images, `wp_exif_frac2dec()` unexpectedly returned a string instead of `int` or `float`. This can occur when an image is missing meta and calls the function with `'0/0'`. For those images, a fatal error was thrown on PHP 8.0+:

{{{
TypeError: round(): Argument #1 ($num) must be of type int|float, string given
}}}

Upon deeper review, inconsistent and unexpected results were returned from different types of input values passed to the function.

Changes are:

* Maintains backwards-compatibility for valid input values.
* Fixes handling of invalid input values by bailing out to return the documented type of `int|float` by returning `0`.
* Improves the fractional conditional check.
* Improves the calculated fraction handling to ensure (a) the numerator and denominator are both numeric and (b) the denominator is not equal to zero.
* Safeguards the behavior via tests for all possible ways code could flow through the function.
* Safeguards the backwards-compatibility of the `wp_read_image_metadata()` by adding some defensive coding around the calls to the `wp_exif_frac2dec()` function.

These changes fix the fatal error and make the function more secure, stable, and predictable while maintaining backwards-compatibility for valid input values.

Follow-up to [6313], [9119], [22319], [28367], [45611], [47287].

Props adamsilverstein, jrf, peterwilsoncc, praem90, stevegs, tobiasbg.
Fixes #54385.
Built from https://develop.svn.wordpress.org/trunk@52269


git-svn-id: http://core.svn.wordpress.org/trunk@51861 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-29 19:36:05 +00:00
spacedmonkey
2f6cf4ba81 REST API: Ensure that the rest_after_insert_ action is executed in the templates controller.
Fire the that dynamic action `rest_after_insert_{$this->post_type}` in templates controller, as this action is fired in other post based REST API controllers. 

Props spacedmonkey, peterwilsoncc, zieladam.
Fixes #54520.
Built from https://develop.svn.wordpress.org/trunk@52268


git-svn-id: http://core.svn.wordpress.org/trunk@51860 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-29 11:43:01 +00:00
audrasjb
0ca6469410 Feeds: Remove reference to wp-atom.php in Atom feeds xml:base attribute.
This change removes the optional `xml:base` attribute for Atom based feeds as `wp-atom.php` file was removed in [18540] (WordPress 3.3).

Follow-up to [18540].

Props tw2113, audrasjb, mukesh27.
Fixes #47955.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51859 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-29 09:52:00 +00:00
Sergey Biryukov
79884a72d4 Tests: Replace assertEquals() with assertSame() in block template tests.
This ensures that not only the return values match the expected results, but also that their type is the same.

Going forward, stricter type checking by using `assertSame()`, `assertSameSets()`, or `assertSameSetsWithIndex()` should generally be preferred, to make the tests more reliable.

Follow-up to [51003], [51079], [52062], [52265].

See #53364, #53363, #54335.
Built from https://develop.svn.wordpress.org/trunk@52266


git-svn-id: http://core.svn.wordpress.org/trunk@51858 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-29 08:47:05 +00:00
Sergey Biryukov
595b629f08 Tests: Rename classes in block template tests per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [51003], as a continuation of the previous changes in ​[47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969], [51491], [51492], [51493], [51623], [51639], [51646], [51650], [51651], [51860], [52264].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@52265


git-svn-id: http://core.svn.wordpress.org/trunk@51857 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-29 03:23:03 +00:00
Sergey Biryukov
ee2423c236 Tests: Rename classes in phpunit/tests/block-supports/ per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [52069], as a continuation of the previous changes in ​[47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969], [51491], [51492], [51493], [51623], [51639], [51646], [51650], [51651], [51860].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@52264


git-svn-id: http://core.svn.wordpress.org/trunk@51856 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-29 03:12:02 +00:00
audrasjb
c9527eea2e Media: Ensure media preview is fully viewable in the "Add Media" modal.
This change ensures the media preview is not cut off in the "Add Media" modal box, when using the "Insert from URL" feature.

Props siliconforks, sabernhardt, mukesh27, ankit-k-gupta.
Fixes #53636.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51855 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-28 23:11:02 +00:00
audrasjb
dc853cb0e9 Script Loader: Enqueue block stylesheet only when the corresponding block is used.
Before this change, block stylesheets were enqueued although the corresponding blocks were not used in the current post, even if the `should_load_separate_core_block_assets` filter was set to `true`.

Props shimotomoki, devutpol, audrasjb.
Fixes #54457.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51854 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-28 21:12:06 +00:00
audrasjb
74d251884f Editor: Ensure block style name does not contain spaces before creating the class.
This change adds a check to ensure there is no spaces in block style variation names before generating the class. Returns `false` and a `_doing_it_wrong()` message if a space is detected.

Props amustaque97, costdev, hellofromtonya, pbiron, SergeyBiryukov, afragen.
Fixes #54296.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51853 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-28 13:53:00 +00:00
Sergey Biryukov
7290503480 Tests: Temporarily disable the check that the current recommended PHP version is actively supported.
As PHP 7.4 moved from active support to security support until 28 Nov 2022, and no discussions or decisions have been made yet on bumping the recommended version to PHP 8.0, this commit disables the failing assertion for now.

This should be revisited once WordPress achieves PHP 8.0 compatibility and the recommended PHP version in `readme.html` can be bumped, or another decision is made about this.

Follow-up to [26166], [33937], [33944], [33946], [35172], [39582], [39583], [40241], [46682], [46996], [46998].

Props costdev, audrasjb.
Fixes #54528.
Built from https://develop.svn.wordpress.org/trunk@52260


git-svn-id: http://core.svn.wordpress.org/trunk@51852 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-28 10:35:59 +00:00
Sergey Biryukov
5107bba1af Tests: Use a simpler approach to test the output in some tests.
Instead of ignoring the output and catching it later with `getActualOutput()`, we can use `expectOutputRegex()` directly, which evaluates the output after the rest of the test code has run, if no unexpected errors were encountered.

Follow-up to [52173], [52253].

Props jrf.
See #53635, #53363.
Built from https://develop.svn.wordpress.org/trunk@52259


git-svn-id: http://core.svn.wordpress.org/trunk@51851 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-27 16:18:00 +00:00
audrasjb
1f9eee5410 Taxonomy: Check $term object before using it in get_term_feed_link().
This change performs the type safety check on `$term` before it is used to retrieve the taxonomy in `get_term_feed_link()`. It also updates the related DocBlock after [52255].

Follow up to [52255].

Props dlh.
Fixes #50225.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51850 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-27 15:23:59 +00:00
Sergey Biryukov
7cbc31f7c0 Docs: Remove inaccurate part of the screen_settings filter description.
The filter is called for all admin screens, not just the Widgets screen.

Follow-up to [27256].

Props Starbuck.
Fixes #54524.
Built from https://develop.svn.wordpress.org/trunk@52257


git-svn-id: http://core.svn.wordpress.org/trunk@51849 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-27 02:07:00 +00:00
audrasjb
da49813106 Media: Allow setting custom image alt text in custom header image.
This change applies the alternative text assigned to the custom header image, if available. Otherwise, it leaves it empty. It fixes an issue where the alternative text was always the site title, which is not relevant in most use cases.

Props webmandesign, mukesh27, afercia, anevins, mikeschroder, nrqsnchz, audrasjb, sabernhardt, joedolson, Boniu91.
Fixes #46124.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51848 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-26 22:56:02 +00:00
audrasjb
edd2ca2b6b Taxonomy: Use WP_Term object to retrieve the taxonomy in get_term_feed_link().
This change fixes a backward compatibility issue introduced in [52180] where `get_term_feed_link()` did not honor the `$taxonomy` parameter anymore. Rather than using the default `category` taxonomy when passing a term ID in `get_term_feed_link()`, use the `WP_Term` object to get the taxonomy.

Follow-up to [52180].

Props hugod.
Fixes #50225.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51847 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-26 11:43:03 +00:00
Sergey Biryukov
70f43f261b External Libraries: Update getID3 to version 1.9.21.
The latest version includes preliminary PHP 8.1 support, as well as a variety of bug fixes.

Release notes: https://github.com/JamesHeinrich/getID3/releases/tag/v1.9.21

A full list of changes in this update can be found on GitHub:
https://github.com/JamesHeinrich/getID3/compare/v1.9.20...v1.9.21

This commit also includes:
* Setting the `$options_audiovideo_quicktime_ReturnAtomData` property (now `false` by default) to `true` in `wp_read_video_metadata()` and `wp_read_audio_metadata()` in order to get the `created_timestamp` value.
* PHPCS adjustments previously made for a passing PHP Compatibility scan.

Follow-up to [47601], [47737], [47902], [48278], [49621], [50714].

Props jrf, SergeyBiryukov.
Fixes #54162.
Built from https://develop.svn.wordpress.org/trunk@52254


git-svn-id: http://core.svn.wordpress.org/trunk@51846 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-26 03:06:03 +00:00
Sergey Biryukov
904c4a8b5c Tests: Remove unexpected output in wp_dashboard_recent_drafts() tests on PHP 8.1.
This follows the approach used in other tests to let PHPUnit manage the output catching and effectively ignore the output until retrieving it later via `getActualOutput()`.

Follow-up to [45505], [51968], [52173].

See #53635, #53363.
Built from https://develop.svn.wordpress.org/trunk@52253


git-svn-id: http://core.svn.wordpress.org/trunk@51845 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-26 01:29:04 +00:00
Sergey Biryukov
1cca88b19b External Libraries: Upgrade PHPMailer to version 6.5.3.
The latest release includes official PHP 8.1 support, as well as some small bug fixes, including one for PHP 5.6 cross-version support.

Release notes:
* https://github.com/PHPMailer/PHPMailer/releases/tag/v6.5.2
* https://github.com/PHPMailer/PHPMailer/releases/tag/v6.5.3

For a full list of changes in this update, see the PHPMailer GitHub:
https://github.com/PHPMailer/PHPMailer/compare/v6.5.1...v6.5.3

Follow-up to [50628], [50799], [51169], [51634], [51635].

Props jrf, Synchro.
Fixes #54514.
Built from https://develop.svn.wordpress.org/trunk@52252


git-svn-id: http://core.svn.wordpress.org/trunk@51844 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-26 00:43:01 +00:00
Sergey Biryukov
fe2a2ef0e4 Docs: Improve consistency of some DocBlocks in wp-admin/includes/post.php.
Follow-up to [52249].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@52251


git-svn-id: http://core.svn.wordpress.org/trunk@51843 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-26 00:28:03 +00:00
audrasjb
0c54c14a37 Twenty Twenty One: Remove Image block placeholder alignment override in editor styles.
This changes excludes the Image block placeholder from the default image centering in Twenty Twenty-One editor styles.

Props multidots1896, sabernhardt, Boniu91, justinahinon.
Fixes #54254.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51842 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-25 22:31:04 +00:00
audrasjb
b0743f17e1 Docs: Miscellaneous DocBlock corrections in wp-admin/includes/post.php.
See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51841 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-25 20:39:00 +00:00
John Blackbourn
7494eb1e5c Build/Test Tools: Correct the order and naming of expected and actual values in various tests.
This corrects the order of the parameters when used in assertions so if/when they fail the failure message is correct.

See #53363

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


git-svn-id: http://core.svn.wordpress.org/trunk@51840 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-25 19:41:04 +00:00
youknowriad
5d73860e5c Themes: Update the base folders for templates and template parts in block themes.
Block Themes should now use the following folders:

 - templates instead of block-templates
 - parts instead of block-template-parts

Existing themes and folders will continue to work without impact.

Props bernhard-reiter.
Fixes #54493.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-25 10:59:04 +00:00
youknowriad
322b60f600 Themes: Add block template resolution algorithm unit tests.
Backports the unit tests for block templates
and hybrid themes template resolution from the Gutenberg plugin.

Props bernhard-reiter, jorgefilipecosta.
Fixes #54478. 

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


git-svn-id: http://core.svn.wordpress.org/trunk@51838 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-25 09:22:00 +00:00
audrasjb
f69b6a04fb Media: Replace some array keys with their numeric equivalent.
This change replaces `['0']` with `[0]` which brings better consistency, readability and performance.

Props chintan1896, adamsilverstein, costdev.
Fixes #53540.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51837 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-25 08:35:09 +00:00
Sergey Biryukov
95f823d933 External Libraries: Update the Requests library to version 2.0.0.
This is a major release and contains breaking changes.

Most important changes to be aware of for this release:
* All code is now namespaced. Though there is a full backward compatibility layer available and the old class names are still supported, using them will generate a deprecation notice (which can be silenced by plugins if they'd need to support multiple WP versions). See the [https://requests.ryanmccue.info/docs/upgrading.html upgrade guide] for more details.
* A lot of classes have been marked `final`. This should generally not affect userland code as care has been taken to not apply the `final` keyword to classes which are known to be extended in userland code.
* Extensive input validation has been added to Requests. When Requests is used as documented though, this will be unnoticable.
* A new `WpOrg\Requests\Requests::has_capabilities()` method has been introduced which can be used to address #37708.
* A new `WpOrg\Requests\Response::decode_body()` method has been introduced which may be usable to simplify some of the WP native wrapper code.
* Remaining PHP 8.0 compatibility fixed (support for named parameters).
* PHP 8.1 compatibility.

Release notes: https://github.com/WordPress/Requests/releases/tag/v2.0.0

For a full list of changes in this update, see the Requests GitHub:
https://github.com/WordPress/Requests/compare/v1.8.1...v2.0.0

Follow-up to [50842], [51078].

Props jrf, schlessera, datagutten, wojsmol, dd32, dustinrue, soulseekah, costdev, szepeviktor.
Fixes #54504.
Built from https://develop.svn.wordpress.org/trunk@52244


git-svn-id: http://core.svn.wordpress.org/trunk@51836 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-25 01:12:02 +00:00
noisysocks
67e0125bc2 Themes: Move the skip link to outside the canvas in block themes
Fix Twenty Twenty-one having an erroneous margin above the Header template part
by moving the skip link outside of the wp-site-blocks canvas.

This is a backport of https://github.com/WordPress/gutenberg/pull/34986.

Props youknowriad.
Fixes #54491.




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


git-svn-id: http://core.svn.wordpress.org/trunk@51835 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-25 01:07:01 +00:00
Sergey Biryukov
dfdbbb4e62 Docs: Miscellaneous DocBlock corrections.
See #53399.
Built from https://develop.svn.wordpress.org/trunk@52242


git-svn-id: http://core.svn.wordpress.org/trunk@51834 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-24 23:59:59 +00:00
desrosj
91c7a9ba2a Build/Test Tools: Configure Dependabot scanning for GitHub Actions.
This eliminates the need to manually check all GitHub Actions used within workflow files for updates.

Fixes #54503.
Built from https://develop.svn.wordpress.org/trunk@52241


git-svn-id: http://core.svn.wordpress.org/trunk@51833 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-24 14:51:00 +00:00
desrosj
63a5bda86a Build/Test Tools: Specify NodeJS version 14.x in the .nvmrc file.
As of 2021-10-26, the LTS version of NodeJS is now `16.x`.

This pins the `14.x` version in the `.nvmrc` file to ensure contributors are able to contribute without issue until compatibility with version `16.x` can be confirmed in both `trunk` and the Gutenberg repository on GitHub.

Fixes #54502.
Built from https://develop.svn.wordpress.org/trunk@52240


git-svn-id: http://core.svn.wordpress.org/trunk@51832 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-24 14:07:01 +00:00
audrasjb
c66d278da5 Docs: Document the globals used in some Privacy API methods.
See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51831 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-24 11:41:03 +00:00
Peter Wilson
d8bbb335cb Twenty Twenty-One: Combine duplicate CSS rules.
Use the postcss-merge-rules package when building TT1 stylesheets to reduce duplicate code in production CSS.

Props SergeyBiryukov, ryelle, Shaharyar10, shital-patel, mukesh27, poena.
Fixes #53605.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51830 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-24 03:35:03 +00:00
audrasjb
a930237618 Twenty Twenty-One: Style adjustments for list-based widgets in the widget editor.
This change brings style consistency between front-end and widget editor for list-based widgets.

Props circlecube, Rahmohn.
Fixes #53629.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51829 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-23 23:25:02 +00:00
John Blackbourn
92f0b0cb48 Docs: Various docblock corrections and improvements.
See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@51828 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-23 21:37:01 +00:00
hellofromTonya
d472b34c89 Build/Test Tools: Fix warnings from stdClass::__invoke() callback mocks in REST API tests.
When running core tests on PHPUnit 8.x and 9.x, four non-blocking warnings were displayed for the REST API tests:

{{{
There were 4 warnings:

1) Tests_REST_Request::test_route_level_validate_callback
createPartialMock called with method(s) __invoke that do not exist in stdClass. This will not be allowed in future versions of PHPUnit.

2) Tests_REST_Request::test_route_level_validate_callback_no_parameter_callbacks
createPartialMock called with method(s) __invoke that do not exist in stdClass. This will not be allowed in future versions of PHPUnit.

3) Tests_REST_Request::test_route_level_validate_callback_is_not_executed_if_parameter_validation_fails
createPartialMock called with method(s) __invoke that do not exist in stdClass. This will not be allowed in future versions of PHPUnit.

4) Tests_REST_Server::test_callbacks_are_not_executed_if_request_validation_fails
createPartialMock called with method(s) __invoke that do not exist in stdClass. This will not be allowed in future versions of PHPUnit.
}}}

These warnings are due to the PHP native `stdClass` not having a `__invoke()` method declared.

This commit adds a `Mock_Invokable` reusable class and replaces the `stdClass` with this new class.

Follow-up to [48945], [48947].

Props sourovroy, jrf.
Fixes #53844.
Built from https://develop.svn.wordpress.org/trunk@52235


git-svn-id: http://core.svn.wordpress.org/trunk@51827 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-23 18:57:00 +00:00
Sergey Biryukov
86cd872c29 Docs: Add a @since note and description to wp_kses_attr() for new attribute-related KSES options:
* Support for an array of allowed values for attributes.
* Support for required attributes.

Follow-up to [51963].

See #54261.
Built from https://develop.svn.wordpress.org/trunk@52234


git-svn-id: http://core.svn.wordpress.org/trunk@51826 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-23 18:39:00 +00:00
John Blackbourn
f02e2e6265 Build/Test Tools: Lower the timeout for GitHub Actions jobs so runaway or stalled processes don't risk running for the default timeout duration of six hours.
See #53363

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


git-svn-id: http://core.svn.wordpress.org/trunk@51825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-23 17:41:03 +00:00
noisysocks
121c824ccd Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- FSE: Add welcome guide
- Update theme styles for the code block
- Add feature flag to toggle the new site editor sidebar
- Add templates list page for site editor
- Cover Block: Fix default background dim
- E2E: Add more Cover block tests
- Cover Block: Fix regressions
- Post Comments Form: ensure typography styles are applied to child elements
- Navigation: Fix space-between
- Fix background colours in nested submenus.
- Fix duplicate custom classnames in navigation submenu block
- Fix colour rendering in Navigation overlay
- Fix: Add ability to opt out of Core color palette V2
- Change @package to WordPress in block-library
- Make the core color palette opt-in for themes with not theme.json
- Remove textdomain from calendar block
- Page List block: fix space before href attribute
- Try: Let Featured Image block inherit dimensions, look like a placeholder
- [Global Styles]: Add block icon next to blocks list
- Page List: Use core entities instead of direct apiFetch
- Site Editor: Stabilize export endpoint
- Fix mobile horizontal scrollbar.
- Multi-entity save: Only set site entity to pending if really saving
- Add page list to navigation direct insert conditions
- Implement "Add New" for templates list in Site Editor
- Post Featured Image: Remove withNotices HOC
- Fix page list missing button styles when set to open on click.
- Make appender fixed position to avoid jumps in the UI
- Color UI component: reorder palettes and update names (core by defaults, user by custom)
- Remove the Styles link in Site Editor
- GlobalStyles sidebar: do not show default palette if theme opts-out
- Only render the site editor canvas when the global styles are ready.
- Global Styles: rename core origin key to default for presets
- Clarify i18n context for PostTemplateActions's "New" label
- Revert erroneous native editor package version bumps
- Try: Hide the columns inserter in pattern previews.
- Fix site editor region navigation
- Update navigation sidebar responsiveness
- Add _wp_array_set and _wp_to_kebab_case to 5.8 compat
- Make user able to change all color palette origins
- Site Editor: Update hrefs to not specifically refer to themes.php?page=gutenberg-edit-site
- Site Editor: Validate the postType query argument
- Navigation: Scale submenu icon.
- Move the theme editor under tools for FSE themes
- Deprecate navigation areas

See #54487.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51824 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-23 05:40:38 +00:00
Sergey Biryukov
d2c41142ed Editor: Check the correct post type support property for initial_edits.
The property to check should be `editor` instead of `content`, as posts don't have a `content` support property.

This addresses an e2e test failure in Gutenberg.

Follow-up to [52230].

Props talldanwp.
See #53813.
Built from https://develop.svn.wordpress.org/trunk@52231


git-svn-id: http://core.svn.wordpress.org/trunk@51823 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-22 08:42:03 +00:00
audrasjb
9ee35e14c2 Editor: Do not provide initial_edits for properties that are not supported by the current post type.
Previously, the block editor initialization always provided "title", "content" and "excerpt" initial edits in the `initializeEditor` call even though these properties might not be supported by the current post type being edited. This leads to a bug in the post editor where as soon as one would open a "new post", the editor considers the content "dirty", meaning changes are applied and it is not possible to leave the editor without encountering an "unsaved changes" notice.

This change updates the `$initial_edits` variable declaration to only provide the properties that are supported by the current post type.

Props youknowriad, h71.
Fixes #53813.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51822 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-21 19:28:03 +00:00
Sergey Biryukov
1d1581b660 KSES: Use correct global in wp_kses_xml_named_entities().
This fixes a discrepancy where the the global name used in the function did not match the one declared at the beginning of `kses.php`, and ensures that the function gets the correct array of allowed XML entity names.

Includes unit tests.

Follow-up to [48072].

Props ovidiul, costdev, peterwilsoncc, SergeyBiryukov.
Fixes #54060.
Built from https://develop.svn.wordpress.org/trunk@52229


git-svn-id: http://core.svn.wordpress.org/trunk@51821 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-21 17:17:02 +00:00
Sergey Biryukov
c9ecd13aca Coding Standards: Wrap some long lines in js/_enqueues/admin/post.js per the JS coding standards for better readability.
See #53359.
Built from https://develop.svn.wordpress.org/trunk@52228


git-svn-id: http://core.svn.wordpress.org/trunk@51820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-20 02:49:58 +00:00
Sergey Biryukov
742cd201e6 Docs: Update documentation for the $plugin_data parameter of various hooks:
* Document the structure of the `$plugin_data` array passed to the `plugin_row_meta` filter.
* Document some missing values returned by `get_plugin_data()`:
 * `PluginURI`
 * `AuthorName`
* Link to `get_plugin_data()` and the `plugin_row_meta` filter as the canonical sources in other various filters and actions which receive the `$plugin_data` parameter:
 * `network_admin_plugin_action_links`
 * `network_admin_plugin_action_links_{$plugin_file}`
 * `plugin_action_links`
 * `plugin_action_links_{$plugin_file}`
 * `plugin_auto_update_setting_html`
 * `manage_plugins_custom_column`
 * `after_plugin_row`
 * `after_plugin_row_{$plugin_file}`
 * `in_plugin_update_message-{$file}`
* Update documentation for the `$response` parameter of the `in_plugin_update_message-{$file}` filter:
 * Correct type for the `id` value. It contains a string like `w.org/plugins/[plugin-name]`, not a numeric ID.
 * Update `$icons`, `$banners`, and `$banners_rtl` values to use typed array notation.

Follow-up to [8367], [8402], [12976], [16758], [26540], [30544], [34818], [51733], [52212], [52224].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@52227


git-svn-id: http://core.svn.wordpress.org/trunk@51819 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-20 02:23:02 +00:00
John Blackbourn
fa62df0774 Query: Correct and standardise the meta query documentation.
Also improves the formatting of some surrounding documentation.

Props audrasjb, johnbillion

Fixes #53467

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


git-svn-id: http://core.svn.wordpress.org/trunk@51818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-20 00:07:59 +00:00
audrasjb
1bd5af61d2 Editor: Add missing label to new-post-slug input on Classic Editor.
Previously, the input for changing the permalink of a post does not have a label in the Classic Editor. This change adds a visually hidden label. It also makes sure browsers do not run spellcheck on the input field.

Props sabernhardt.
Fixes #53725.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51817 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-19 22:55:59 +00:00
Sergey Biryukov
966c7376b4 Docs: Restore [51733], accidentally reverted in [52212].
Document some more `$response` values in the `in_plugin_update_message-{$file}` filter:
* `banners_rtl`
* `requires_php`

Follow-up to [51733], [52212].

Fixes #40006.
Built from https://develop.svn.wordpress.org/trunk@52224


git-svn-id: http://core.svn.wordpress.org/trunk@51816 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-19 22:16:58 +00:00
hellofromTonya
30c9e4338d Comments: Fix PHP Notice "trying to get property of non-object" in comments_open() and pings_open().
The post for the comments or pings is retrieved by `get_post()`. If the post exists, `get_post()` returns an instance of `WP_Post`; else, it returns `null`.

In both `comments_open()` and `pings_open()`, the returned value from `get_post()` is used without checking if the object returned, if the post exists. When the post does not exist, the following notices occur:

{{{
PHP Notice:  Trying to get property 'comment_status' of non-object in .../src/wp-includes/comment-template.php on line 1244
}}}

and

{{{
PHP Notice:  Trying to get property 'pings_open' of non-object in ../src/wp-includes/comment-template.php on line 1274
}}}

This commit fixes these notices by checking if the post has a non-falsey value before using it as an object to set the `$open` state. As the return from `get_post()` will only be an object or `null`, the truthy check is appropriate and slightly more performant.

Tests added to validate the fix.

Follow-up to [1964], [40666].

Props dd32, audrasjb, costdev, hellofromTonya, sergeybiryukov.
Fixes #54159.
Built from https://develop.svn.wordpress.org/trunk@52223


git-svn-id: http://core.svn.wordpress.org/trunk@51815 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-19 20:24:00 +00:00
jffng
6ebd3a8fc9 Twenty Twenty-Two: Sync updates from GitHub.
This commit syncs several changes for the default theme from its active development repository to core. 

This is a follow up to [52081], [52107], and [52164]. It includes improvements to the home page template, adding a filter for block patterns, pre-loading the web font, improvements and bug fixes to block patterns, and more. For a full list of changes, visit e4f69d0b7e...25d74deaa5.

Props jeffpaul, richtabor, netweb, luminuu, melchoyce, beafealho, clucasrowlands, desrosj, flixos90, joen, otto42, saju4wordpress, westonruter, kjellr, poena.
See #54318.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51814 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-19 20:13:59 +00:00
desrosj
07bf9f55e2 Bundled Themes: Update the “Tested up to” header to 5.9.
This updates the “Tested up to” header in the `readme.txt` file for all bundled theme.

This also adds the “Tested up to” header to the `style.css` file for older default themes (Twenty Twenty and earlier). Previously, this header was only recommended, so it was not included. It is now required, per the theme handbook: https://make.wordpress.org/themes/handbook/review/required/#9-files.

Props kafleg, mukesh27, ravipatel.
Fixes #53797.
Built from https://develop.svn.wordpress.org/trunk@52221


git-svn-id: http://core.svn.wordpress.org/trunk@51813 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-19 19:34:00 +00:00
desrosj
47dc41cc05 Build/Test Tools: Add the ruleset file to the cache key for PHPCS and PHP compatibility scans.
This ensures that the cache is busted properly when the ruleset is adjusted but the `composer.json` file is not.

See #54425.
Built from https://develop.svn.wordpress.org/trunk@52220


git-svn-id: http://core.svn.wordpress.org/trunk@51812 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-19 19:23:00 +00:00
desrosj
ab2dcd8303 Docs: Improve the documentation for registering block patterns and block pattern categories.
This expands the `@param` tag for the property argument available for the `register()` method in `WP_Block_Patterns_Registry` and `WP_Block_Pattern_Cattegories_Registry`.

See #53399.
Built from https://develop.svn.wordpress.org/trunk@52219


git-svn-id: http://core.svn.wordpress.org/trunk@51811 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-19 19:05:59 +00:00
hellofromTonya
807cba060e WPDB: Call wp_load_translations_early() in wpdb::query() and wpdb::process_fields().
For consistency and simplification, replaces the `function_exists( '__' )` checks with `wp_load_translations_early()` to make sure i18n functions are available. This change removes the extra code introduced in [52176] for using non-translated error messages when `__()` is not available.

Improves the plural versions of the error messages.

For performance, when there are more than one problem field, uses `reset()` to populate the field in the error message.

Follow-up to [52176], [52195].

Props sergeybiryukov, hellofromTonya.
Fixes #32315.
Built from https://develop.svn.wordpress.org/trunk@52218


git-svn-id: http://core.svn.wordpress.org/trunk@51810 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-19 19:00:00 +00:00
audrasjb
dc1136b94e Twenty Twenty-One: Prevent notice thrown in twenty_twenty_one_get_attachment_image_attributes().
Calling `twenty_twenty_one_get_attachment_image_attributes()` was causing an `Undefined index: width|height` notice to be thrown when the result from `wp_get_attachment_metadata()` does not set any value to `$meta`. This change adds an `isset()` check to prevent it.

Props wetah, hasanuzzamanshamim.
Fixes #54464.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51809 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-19 17:56:00 +00:00
desrosj
fac3744387 Script Loader: Document path as an accepted value for $key in wp_style_add_data().
Follow up to [50836].

Props tmatsuur.
Fixes #53792.
Built from https://develop.svn.wordpress.org/trunk@52216


git-svn-id: http://core.svn.wordpress.org/trunk@51808 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-19 15:14:00 +00:00
desrosj
9d86fba4db Docs: Remove instances of the “eg.” abbreviation in favor of “example” or “for example”.
See #53330.
Built from https://develop.svn.wordpress.org/trunk@52215


git-svn-id: http://core.svn.wordpress.org/trunk@51807 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-19 14:44:01 +00:00
desrosj
b0b9e23c70 Upgrade/Install: Improve the accuracy of the auto_update_{$type} filter docblock.
This updates the filter documentation for `auto_update_{$type}` to account for the changes to default auto-update behaviors made in WordPress 5.6.

Starting in WordPress 5.6, all new installs auto-update major versions by default.

Props felipeloureirosantos, audrasjb, marybaum, davidbaumwald.
Fixes #53330.
Built from https://develop.svn.wordpress.org/trunk@52214


git-svn-id: http://core.svn.wordpress.org/trunk@51806 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-19 14:19:59 +00:00
audrasjb
096e903010 Twenty Twenty-One: Check if anchor exists before triggering in-page navigation.
This prevents JavaScript errors when using hash in URLs without matching them to any existing anchor in the page.

Props rixeo, sabernhardt, pbearne.
Fixes #53619.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51805 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-19 13:03:01 +00:00
audrasjb
9f91a2a245 Docs: Add missing parameters in in_plugin_update_message-{$file} filter.
Follow-up to [51733].

Props costdev, audrasjb, SergeyBiryukov.
Fixes #40006.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51804 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-18 23:19:08 +00:00
desrosj
03a901192a Twenty Twenty-One: Correct description of Dark Mode in the Customizer.
The Dark Mode toggle can appear in both bottom corners. This removes “right” from the description to be accurate for both RTL and LTR languages.

Props musabshakeel, dilipbheda, sabernhardt.
Fixes #53892.
Built from https://develop.svn.wordpress.org/trunk@52211


git-svn-id: http://core.svn.wordpress.org/trunk@51803 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-18 20:43:00 +00:00
desrosj
74d4822bf5 Twenty Sixteen: Correctly align columns within table blocks as configured in the editor.
Previously, all columns were forced to be aligned left, and aligned right for RTL languages.

Props robertghetau, umesh84, sabernhardt.
Fixes 54317.
Built from https://develop.svn.wordpress.org/trunk@52210


git-svn-id: http://core.svn.wordpress.org/trunk@51802 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-18 20:22:01 +00:00
davidbaumwald
b0c805d644 Toolbar: Refine "Edit site" link.php.
The 'Edit site' link was added to core in [52158], but did not include an icon and was hidden for smaller screen sizes.  This change adds the "Appearance" icon to the link and hides the link text when necessary on smaller screen sizes.

Props sabernhardt, desrosj, shaunandrews.
Fixes #54441.
Built from https://develop.svn.wordpress.org/trunk@52209


git-svn-id: http://core.svn.wordpress.org/trunk@51801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-18 16:48:01 +00:00
audrasjb
1a02e65df9 Docs: Add missing null allowed type for the $id parameter of wp_set_current_user().
Props andy-schmidt.
See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51800 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-18 16:04:00 +00:00
audrasjb
4b322d9de3 Posts, Post Types: Multisite: Decrement post_count option value when a post is deleted.
Previously, the `post_count` option value was not decremented when a post was deleted.

This change moves the `_update_posts_count_on_delete` action from `delete_post` hook to `after_delete_post` to ensure the deletion is taken into account.

Props henry.wright, pbearne, audrasjb.
Fixes #53443.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51799 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-18 15:11:59 +00:00
Sergey Biryukov
173a9cb89a Database: Check if the $args[0] value exists in wpdb::prepare() before accessing it.
This avoids an `Undefined array key 0` PHP warning if no values are passed to the method besides the query string.

Follow-up to [41470].

Props mjaschen.
Fixes #54453.
Built from https://develop.svn.wordpress.org/trunk@52206


git-svn-id: http://core.svn.wordpress.org/trunk@51798 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-18 14:37:01 +00:00
John Blackbourn
40626108d0 Docs: Corrections relating to types used in inline documentation for comment ID and site ID proprties.
Includes a correction for a typo introduced in [52204].

See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@51797 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-18 13:57:01 +00:00
John Blackbourn
c9746ab584 Docs: Various corrections and improvements relating to types used in inline documentation.
See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@51796 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-18 13:50:05 +00:00
audrasjb
b3b8d6959c Upgrade/Install: Add timezone info to last checked update time.
The time displayed on the Updates screen matches the server time which may not be the timezone the person viewing the page is in. This change includes the timezone information with the time.

Props mkaz.
Fixes #53554.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51795 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-18 09:25:03 +00:00
audrasjb
03b59ce449 Posts, Post Types: Increment post_count option value only on multisite installations.
Avoid the `post_count` option to be created on single-site installations.

Follow-up to [52201].

Props dlh, henry.wright.
Fixes #54462.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51794 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-18 00:20:59 +00:00
audrasjb
cbac37d16d Posts, Post Types: Increment post_count option value during blog creation.
Previously, the `post_count` option value was not incremented when the default "Hello world!" post is inserted during blog creation on a multisite installation.

Props henry.wright.
Fixes #54462.
See #53443.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51793 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-17 23:08:03 +00:00
joedolson
387f4467a4 Comments: Change new comment required text class.
Change the new class on comment required text from `comment-required-message` to `required-field-message` for better future-compatibility, enabling better reuse.

Props sabernhardt.
Fixes #16206.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-17 18:38:02 +00:00
hellofromTonya
d4b3deddda Upgrade/Install: Remove 5.8 function and fix deactivate Gutenberg plugin version compare < 11.9.
Follow-up to [52165] where the `version_compare()` fails for 11.8.x versions. This commit changes the version comparison to < 11.9 for deactivating the Gutenberg plugin. 

The `_upgrade_580_force_deactivate_incompatible_plugins()` function is no longer needed in 5.9. It's redundant and unnecessary as `_upgrade_590_force_deactivate_incompatible_plugins()` deactivates those versions as well.

Removing `_upgrade_580_force_deactivate_incompatible_plugins()` and moving the deactivation logic back into the `_deactivate_gutenberg_when_incompatible_with_wp()`, thus removing the new private function `_deactivate_gutenberg_when_incompatible_with_wp()` introduced in [52165].

Follow-up [51180], [51266], [52165].

Props hellofromTonya, tobiasbg, clorith, sergeybiryukov, costdev.
Fixes #54405. 
Built from https://develop.svn.wordpress.org/trunk@52199


git-svn-id: http://core.svn.wordpress.org/trunk@51791 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-17 17:45:00 +00:00
joedolson
bba44bf5e5 Toolbar: Prevent adminbar from hiding in-page anchors.
Use scroll-padding-top to offset scroll position on in-page anchors when adminbar is active. Also adjusts existing scroll padding for core themes that implement it.

Props afercia, kingkero, audrasjb, dufresnesteven, thimalw, sabernhardt, costdev.
Fixes #46371.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-17 17:20:00 +00:00
audrasjb
1589bba4f5 Upgrade/Install: Differentiate en_US version strings from localized ones.
Adds a condition to `$version_string` to determine whether the Core update is the original en_US package, or a localized one.

This change fixes an issue where these packages were not differentiated and duplicate messages were displayed.

Props Presskopp, benjamingosset.
Fixes #53710.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51789 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-17 16:24:00 +00:00
joedolson
74395140ad Media: Move dismiss upload errors button after errors.
Change the button that dismissess upload errors so it appears after the relevant errors. Change button from icon-only to text-based. Removes ambiguity about what you are cancelling when using the control.

Props ComputerGuru, melchoyce, vdwijngaert, alexislloyd, joedolson, shaunandrews, sabernhardt.
Fixes #42979.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51788 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-17 15:56:03 +00:00
Sergey Biryukov
5e48f0c591 WPDB: Call wp_load_translations_early() in wpdb::_real_escape().
This follows the pattern used in other `wpdb` methods to make sure the i18n functions are available.

Follow-up to [29840].

Props nacin, johnbillion.
See #32315.
Built from https://develop.svn.wordpress.org/trunk@52195


git-svn-id: http://core.svn.wordpress.org/trunk@51787 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-17 04:05:02 +00:00
Peter Wilson
ab78f7561a Posts, Post Types: Use global post as the default for wp_get_post_parent_id().
Convert the `$post` parameter of `wp_get_post_parent_id()` to optional, defaulting to the current global post object when called within the loop.

Props danielpost, davidbaumwald, SergeyBiryukov, birgire, audrasjb, hellofromTonya, TimothyBlynJacobs.
Fixes #48358.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51786 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-17 03:25:06 +00:00
audrasjb
0a8b1555b8 Login and Registration: auto-focus the reset password field.
Although auto-focusing form fields can be arguable in some cases, it makes sense when there is a very specific task to accomplish and when there is no relevant content before the auto-focused field.

This change brings consistency between various forms generated by `wp-login.php`.

Props afercia, donmhico, sabernhardt.
Fixes #40302.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51785 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-17 00:14:01 +00:00
Sergey Biryukov
8a5e1aa0b3 Upgrade/Install: Correct the weekly cron event for clearing the temp-backup directory:
* Make sure the `wp_delete_temp_updater_backups` event has an action associated with it when it runs.
* Check if the cron event already exists before scheduling it, to avoid scheduling duplicate events. 
* Move the code for clearing the `temp-backup` directory to a standalone function.

Follow-up to [51815], [51898], [51899].

Props pbiron, johnbillion.
See #51857.
Built from https://develop.svn.wordpress.org/trunk@52192


git-svn-id: http://core.svn.wordpress.org/trunk@51784 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 22:19:59 +00:00
audrasjb
a9da3e2474 Twenty Twenty-One: Remove RSS feed widget icon link.
Use the `rss_widget_feed_link` filter to disable the output of the icon on RSS feed widgets in Twenty Twenty-One. Improves accessibility by preventing invisible links.

Props sabernhardt, poena.
Fixes #52880.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51783 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 21:48:05 +00:00
hellofromTonya
4586cfe5a0 Media: Add support for v1 and v2 gallery block in get_post_galleries().
The `get_post_galleries()` function only handled galleries from the `[gallery]` shortcode. It did not process gallery blocks.

Introducing v1 and v2 gallery block support in `get_post_galleries()` including support for innerblock nesting.

There are no changes to how the function is called. It detects if the post content has one or more gallery blocks. If detected, it parses the blocks and then processes to add each gallery block's HTML to the array of galleries before being passed through the filter and returned.

Includes integration tests.

Follow-up to [24682], [43309], [48262], [52042].

Props glendaviesnz, costdev, antpb, audrasjb, birgire, celloexpressions, desrosj, hellofromTonya, jeffpaul, lynk, pento, ramonopoly, russhylov, takahashi_fumiki, tellyworth.
Fixes #43826.
Built from https://develop.svn.wordpress.org/trunk@52190


git-svn-id: http://core.svn.wordpress.org/trunk@51782 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 21:25:03 +00:00
Adam Silverstein
09b9af2c76 Media: improve error message for failed image uploads.
Clarify error language and change the maximum suggested size to match the large image threshold.

Props zodiac1978, SergeyBiryukov, antpb, webcommsat, hellofromTonya. 
Fixes 53985.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51781 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 20:01:00 +00:00
hellofromTonya
8d5af49e49 Formatting: Add additional support for single and nestable tags in force_balance_tags().
Adds `track` and `wbr` support for single tags.

Adds `article`, `aside`, `details`, `figure`, and `section` for nestable tags.

Updates tests.

Follow-up to [5805], [21828], [45929].

Props glendaviesnz, costdev, talldanwp, ramonopoly, sergeybiryukov.
Fixes #50225.
Built from https://develop.svn.wordpress.org/trunk@52188


git-svn-id: http://core.svn.wordpress.org/trunk@51780 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 19:42:01 +00:00
hellofromTonya
ec522e3f98 HTTP API: Remove empty ? when only anchor remains in add_query_arg().
If after processing through `add_query_arg()` a `?#` remains, this commit removes the unnecessary and unused `?` character as there are no query args in the URL.

Includes tests.

Follow-up to [1823], [5193], [5999], [6005].

Props benjaminanakenam, sabernhardt, costdev, hellofromTonya.
Fixes #44499.
Built from https://develop.svn.wordpress.org/trunk@52187


git-svn-id: http://core.svn.wordpress.org/trunk@51779 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 18:50:00 +00:00
spacedmonkey
33499dc6d8 REST API: Make the templates controller follow core REST patterns.
The templates controller now respects the `_fields` parameter and filters the response accordingly. The schema has been updated to include all the fields returned. The `content.block_version` field has been added. The controller now returns WP_Error objects for improved error handling.

Add new unit tests.

Props TimothyBlynJacobs, hellofromtonya, zieladam.
Fixes #54422.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51778 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 18:06:00 +00:00
ryelle
4a18ff86c9 Themes: Force a scrollbar on the Themes page to prevent visual shake on hover.
On some browser & window size combinations (near where a scrollbar would appear), hovering over the theme card causes a layout shift. This makes the screen visually "jump" as the scrollbar appears and disappears. By forcing the scrollbar to be visible on this page, hovering doesn't cause the layout shift anymore.

Props wparslan, sabernhardt, costdev, audrasjb.
Fixes #53478.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51777 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 17:18:00 +00:00
spacedmonkey
b9ee5a4b29 REST API: Remove experimental block menu item types.
The menu items REST API controller was added in [52079]. This included functionality to add a "block" menu item type. This functionality is experimental and not currently used in WordPress core, so should be removed. 

Props noisysocks.
See #40878.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51776 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 17:09:00 +00:00
desrosj
1966c81a18 Build/Test Tools: Update all 3rd party GitHub actions to the latest versions.
See #53363.
Built from https://develop.svn.wordpress.org/trunk@52183


git-svn-id: http://core.svn.wordpress.org/trunk@51775 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 16:10:04 +00:00
desrosj
a2323a0c63 Twenty Nineteen: Apply coding standards fix from running composer format.
Follow up to [52149].

See #54392.
Built from https://develop.svn.wordpress.org/trunk@52182


git-svn-id: http://core.svn.wordpress.org/trunk@51774 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 15:03:00 +00:00
desrosj
533afcd3b9 Themes: Check both parent and child themes for a theme.json file.
This updates `WP_Theme_JSON_Resolver::theme_has_support()` to properly check for a `theme.json` file in both parent and child themes when determining whether a theme supports block templates.

Follow up to [52077].

Props Mamaduka.
Fixes #54401.
Built from https://develop.svn.wordpress.org/trunk@52181


git-svn-id: http://core.svn.wordpress.org/trunk@51773 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 14:58:59 +00:00
hellofromTonya
c5518c2f11 Taxonomy: Allow get_*_*_link() and edit_term_link() functions to accept a term ID, WP_Term, or term object.
`get_term()` accepts a term ID, instance of `WP_Term`, or an object (i.e. `stdClass` as a result of a db query). Functions that use `get_term()` also now allow for the same data types.

Why? For consistency, removing extra processing code in consuming functions, and performance.

Functions changed in this commit are:
* `get_category_feed_link()`
* `get_term_feed_link()`
* `get_tag_feed_link()`
* `get_edit_tag_link()`
* `get_edit_term_link()`
* `edit_term_link()`

For each of consumer of these functions, changes to pass the object instead of the term ID.

Includes unit/integration tests for test coverage of these changes.

Follow-up to [6365], [9136], [9340], [14711], [15792], [15800], [18827], [32606], [36646], [37252].

Props davidbinda, johnbillion, peterwilsoncc, hellofromTonya, sergeybiryukov, mista-flo, hareesh-pillai, audrasjb, jeffpaul, chaion07.
Fixes #50225.
Built from https://develop.svn.wordpress.org/trunk@52180


git-svn-id: http://core.svn.wordpress.org/trunk@51772 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 14:57:02 +00:00
desrosj
873c2deba4 Build/Test Tools: Cache the results of PHP_CodeSniffer across workflow runs.
When the `PHP_CodeSniffer` runs, it produces a cache file. When a cache file is present, only changed files are rescanned, making subsequent scans significantly faster.

This adds the needed steps to the corresponding GitHub Actions workflows to cache these files across runs. The cache keys include the date of the previous Monday to ensure that the cache is flushed at least weekly.

Since GitHub Action caches cannot be updated once created, the scans will take slightly longer as the week progresses and more PHP files are updated. The date within the cache key can be updated to purge twice weekly if the scan time starts to approach the current scan times.

This change also introduces a `.cache` directory for all caching files related to build/test tools.

Props johnbillion, jrf.
Fixes #49783.
Built from https://develop.svn.wordpress.org/trunk@52179


git-svn-id: http://core.svn.wordpress.org/trunk@51771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 14:19:05 +00:00
hellofromTonya
9cf709d6b6 Administration: Restores "Customize" menu item for non-block themes and moves for block themes.
For themes without non-block themes (i.e. without a `/block-templates/index.html` file), restores the "Customize" menu item under "Appearance" menu to its original location of `6`.

For block themes, moves it to position `8`, as "Styles" is in position `7` as of [52158].

Follow-up to [29026], [52069], [52158].

Props poena, davidbaumwald, sabernhardt, hellofromTonya.
Fixes #54418.
Built from https://develop.svn.wordpress.org/trunk@52178


git-svn-id: http://core.svn.wordpress.org/trunk@51770 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 04:45:00 +00:00
hellofromTonya
3f7dbfd6a9 Widgets: Wraps long widget titles in classic Widgets screen.
Follow-up to [18577], [26426].

Props afercia, bravokeyl, drewapicture, gkloveweb, hitendra-chopda, hellofromTonya, ianhayes94, ovann86, pankajmohale, poena, sabrib, swissspidy, xkon.
Fixes #37451.
Built from https://develop.svn.wordpress.org/trunk@52177


git-svn-id: http://core.svn.wordpress.org/trunk@51769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 03:17:58 +00:00
hellofromTonya
7a4c5007b6 WPDB: Capture error in wpdb::$last_error when insert fails instead of silently failing for invalid data or value too long.
Instead of silently failing when attempting to insert a value into a field, this commit saves the error in the `wpdb::$last_error` property.

Sets `last_error` with an error message if:
* `wpdb::query()` fails for invalid data
* `wpdb::process_fields()` fails to process the value(s) for the field(s) where the value could be too long or contain invalid data

Sets `last_query` if `wpdb::query()` fails for invalid data.

If `__()` is not available, uses non-translated error message to ensure the error is captured.

There is no change to wpdb aborting when an error occurs.

Adds tests.

Props dlt101, mnelson4, dd32, pento, hellofromTonya, davidbaumwald, sergeybiryukov, johnbillion, swissspidy, datainterlock, anandau14, anthonyeden, asif2bd, audrasjb, chaion07, dpegasusm, fpcsjames, galbaras, jdgrimes, justindocanto, kwisatz, liammitchell, lucasw89, lukecarbis, nettsite, nlpro, procodewp, psufan, richardfoley, skunkbad, travisnorthcutt, woodyhayday, zoiec.
Fixes #37267.
Built from https://develop.svn.wordpress.org/trunk@52176


git-svn-id: http://core.svn.wordpress.org/trunk@51768 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 02:59:00 +00:00
hellofromTonya
df540dbd95 Comments: Don't output "cancel comment reply link" if comments aren't threaded.
Though hidden via `style="display:none;"`, if the comments aren't threaded, this commit doesn't output the cancel comment reply link (skips over that logic). Change in `comment_form()`.

Adds tests.

Follow-up to [12810], [38959].

Props henrywright, jigneshnakrani, rachelbaker, desrosj, audrasjb, hellofromTonya.
Fixes #37267.
Built from https://develop.svn.wordpress.org/trunk@52175


git-svn-id: http://core.svn.wordpress.org/trunk@51767 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 02:14:59 +00:00
hellofromTonya
a393ec95a5 Login and Registration: Wrap long usernames in login error message.
Adds `word-wrap: break-word` to wrap long usernames in the login's error message. Using `word-wrap` instead of `word-break` for better cross-browser support and to avoid the deprecation (see Ref below).

For consistency, also changes `#backtoblog`.

Ref:
* `word-break: break-word` deprecation https://developer.mozilla.org/en-US/docs/Web/CSS/word-break#syntax

Follow-up to [51108].

Props soniakash, audrasjb, sabernhardt, hellofromTonya, desrosj, ocean90.
Fixes #37617.
Built from https://develop.svn.wordpress.org/trunk@52174


git-svn-id: http://core.svn.wordpress.org/trunk@51766 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 01:56:58 +00:00
hellofromTonya
df4834caea Widgets: Use isset() in WP_Widget:: display_callback() to support ArrayIterator and ArrayObject.
[33696] introduced support returning `ArrayIterator` and `ArrayObject` objects from `WP_Widget::get_settings()`. 

Per the PHP manual, `array_key_exists()` stopped supporting this in PHP 8.0.0 and deprecated in PHP 7.4.0.

>For backward compatibility reasons, array_key_exists() will also return true if key is a property defined within an object given as array. This behaviour is deprecated as of PHP 7.4.0, and removed as of PHP 8.0.0.

This commit uses `isset()` instead of `array_key_exists()` which is supported on all current versions of PHP.

Includes unit tests.

Ref:
* https://www.php.net/manual/en/function.array-key-exists.php#refsect1-function.array-key-exists-notes

Follow-up to [32602], [33696].

Props dlh, hellofromTonya, jrf, sergeybiryukov.
Fixes #52728.
Built from https://develop.svn.wordpress.org/trunk@52173


git-svn-id: http://core.svn.wordpress.org/trunk@51765 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 01:43:00 +00:00
joedolson
9cb60e437f Coding Standards: Revert accidental image changes in [52171].
Reverts images changed in [52171].

Follow up to [52171].

See #54168.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51764 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 00:04:01 +00:00
joedolson
3b1d5aec7c Media: Revert media uploader input change in [52059].
Based on follow-up research, this change was never necessary in order to use e2e tests in the media library uploader. Additionally, it created several complicated side effects. Without significant benefit, it's not valuable to pursue the change further.

Follow up to [52059].

See #54168, #54411.
Fixes #54168.
Built from https://develop.svn.wordpress.org/trunk@52171


git-svn-id: http://core.svn.wordpress.org/trunk@51763 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 23:22:02 +00:00
joedolson
dbc8d76a9f Taxonomy: Display update notices when adding terms.
Display notice and announce to screen readers when a new term is added. 

Props manishamakhija, birgire, dilipbheda, afercia, hellofromTonya.
Fixes #42937.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 22:24:01 +00:00
joedolson
06e7a012b1 Commit Standards: Revert [52168] to correct commit message.
Used incorrect commit message..

Follow up to [52168].

See #42937.
Built from https://develop.svn.wordpress.org/trunk@52169


git-svn-id: http://core.svn.wordpress.org/trunk@51761 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 22:18:00 +00:00
joedolson
b07f107447 Media: Featured image modal loads only selected image.
Fix bug introduced in [50829] that caused media modal to only load the selected image. Executes `.more()` when loading the modal to ensure that the media collection is available.

Props manishamakhija, birgire, dilipbheda, afercia, hellofromTonya.
Fixes #42937.
Built from https://develop.svn.wordpress.org/trunk@52168


git-svn-id: http://core.svn.wordpress.org/trunk@51760 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 21:55:00 +00:00
joedolson
20fdff756b Media: Featured image modal loads only selected image.
Fix bug introduced in [50829] that caused media modal to only load the selected image. Executes `.more()` when loading the modal to ensure that the media collection is available.

Props benitolopez, hellofromTonya, peterwilsoncc, danielbachhuber, PieWP, sabernhardt, szaqal21.
Fixes #53765.
Built from https://develop.svn.wordpress.org/trunk@52167


git-svn-id: http://core.svn.wordpress.org/trunk@51759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 21:37:03 +00:00
joedolson
6912dc20b9 Menus: Add audible notice on menu item add or remove.
Call `wp.a11y.speak()` to add audible notification when a menu item is added or removed from a menu.

Props joedolson, costdev, hellofromTonya.
Fixes #53840.
Built from https://develop.svn.wordpress.org/trunk@52166


git-svn-id: http://core.svn.wordpress.org/trunk@51758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 20:00:59 +00:00
hellofromTonya
1f608d5d5c Upgrade/Install: Deactivate the Gutenberg plugin if its version is 11.8 or lower.
Avoid a fatal error due to `WP_Theme_JSON_Schema` and potentially other classes and/or functions redeclarations when updating to WordPress 5.9 with an incompatible version of the Gutenberg plugin.

This commit uses the same strategy from 5.8. Moves the plugin deactivation code (introduced in [51266]) to a private function for reuse in 5.8, 5.9, and future major releases.

Follow-up to [51180], [51266].

Props hellofromTonya, johnbillion, jorbin.
See #54405.
Built from https://develop.svn.wordpress.org/trunk@52165


git-svn-id: http://core.svn.wordpress.org/trunk@51757 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 19:59:03 +00:00
jffng
9043992e3b Twenty Twenty-Two: Import the latest changes from GitHub.
Updates `theme.json` to use v2 shape, adds styles to search and file block as well as generic text decoration. Fixes a bug in the layout of a query block pattern.

This is a follow-up to [52081]. These changes are ongoing and development continues on GitHub. To view all of the changes included in this commit, see GitHub: 99db6063be...a11fb4932a

Props desrosj, kjellr, poena.
See #54318.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51756 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 19:15:04 +00:00