Commit Graph

21016 Commits

Author SHA1 Message Date
Sergey Biryukov
f6b1fd3205 Help/About: Restore the correct URL for Editing Files article on Edit Themes screen.
Replace the URL for Editing Themes article instead to avoid an extra redirect.

Follow-up to [55432].

See #57726.
Built from https://develop.svn.wordpress.org/trunk@55434


git-svn-id: http://core.svn.wordpress.org/trunk@54967 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-28 13:52:20 +00:00
Sergey Biryukov
0449c238bd Users: Adjust the initialization of the $duplicated_keys array in wp_salt().
This avoids an endless loop if `get_current_user_id()` is used in a callback attached to the `gettext` filter.

With the translated phrase moved into a separate assignment, the function succeeds in setting the static `$duplicated_keys` array once and no longer goes into this code section on subsequent calls.

Follow-up to [54249].

Props adityaarora010196, SergeyBiryukov.
Fixes #57121.
Built from https://develop.svn.wordpress.org/trunk@55433


git-svn-id: http://core.svn.wordpress.org/trunk@54966 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-28 13:22:22 +00:00
audrasjb
933bb3999b Help/About: Avoid extra redirections on HelpHub Links.
This changeset replaces various HelpHub links that have changed to avoid extra 301 redirections.

Follow-up to [55412], [55413], [55414], [55415], [55416], [55431].

Props sabernhardt, audrasjb.
Fixes #57726.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54965 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-28 12:52:18 +00:00
audrasjb
7939ee8926 Help/About: Use a consistent capitalization for "Support forums" links across WP Admin.
This partially reverts [55415] and fix a few inconsistencies found in "support forums" links.

Follow-up to [55412], [55413], [55415].

Props sabernhardt, audrasjb.
See #57726.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54964 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-28 12:48:23 +00:00
Peter Wilson
baf4e6021f Formatting: Add aspect-ratio tests for safecss_filter_attr().
Follow up to [55309].

Props rahmohn, desrosj, mukesh27.
Fixes #57664.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54963 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-28 02:52:20 +00:00
audrasjb
fa42e86adf Build/Test Tools: Add test coverage for the get_posts_navigation() function.
This changeset adds a test case to verify that `get_the_posts_navigation()` only includes the "Older posts" and "Newer" posts links when appropriate.

Props jongycastillo, michelmany, joyously, geisthanen, SergeyBiryukov, mukesh27, audrasjb, costdev, sun, chrisbaltazar.
Fixes #55751.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54962 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-27 23:16:20 +00:00
audrasjb
5170ad3bac Docs: Fix erroneous @since mention in wp_internal_hosts hook.
Follow-up to [55289].

Props wildworks, SergeyBiryukov, simongomes02.
Fixes #57796.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54961 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-27 22:55:22 +00:00
Felix Arntz
26ab805ad4 Twenty Twenty: Avoid PHP warnings in 8.1 due to incorrect usage of wp_add_inline_style().
This changeset adjusts the logic to use a more defensive approach, to avoid passing potentially invalid values to `wp_add_inline_style()`.

Props flixos90, mukesh27, costdev, swissspidy, poena, sabernhardt.
Fixes #57777.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54960 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-27 17:32:18 +00:00
Sergey Biryukov
58d7cd099e Themes: Account for a numeric theme directory in WP_Theme::__construct().
This ensures that if a theme with a numeric directory name is active, it is correctly identified as such, and that theme support features work as expected.

Follow-up to [20029], [49925].

Props lopo, alvastar, winterpsv, hugodevos, ankit-k-gupta, jakariaistauk, mukesh27, spacedmonkey, SergeyBiryukov.
Fixes #54645.
Built from https://develop.svn.wordpress.org/trunk@55426


git-svn-id: http://core.svn.wordpress.org/trunk@54959 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-27 15:34:23 +00:00
Sergey Biryukov
04967a68b6 Upgrade/Install: Introduce WP_Automatic_Updater::is_allowed_dir() method.
As part of determining whether to perform automatic updates, WordPress checks if it is running within a version-controlled environment, recursively looking up the filesystem to the top of the drive, looking for a Subversion, Git, Mercurial, or Bazaar directory, erring on the side of detecting a VCS checkout somewhere.

This commit avoids a PHP warning if the `open_basedir` directive is in use and any of the directories checked in the process are not allowed:
{{{
is_dir(): open_basedir restriction in effect. File(/.git) is not within the allowed path(s)
}}}

Follow-up to [25421], [25700], [25764], [25835], [25859].

Props costdev, markjaquith, meyegui, dd32, arnolp, robin-labadie, hellofromTonya, afragen, pbiron, SergeyBiryukov.
Fixes #42619.
Built from https://develop.svn.wordpress.org/trunk@55425


git-svn-id: http://core.svn.wordpress.org/trunk@54958 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-26 15:19:21 +00:00
Sergey Biryukov
325a14a3ef Docs: Correct duplicate hook reference for notify_moderator.
The original filter location is `wp_notify_moderator()` in `wp-includes/pluggable.php`.

This commit updates the instance in `wp_new_comment_notify_moderator()` to point to the correct file.

Follow-up to [35339], [35725].

Props zevilz.
Fixes #57808.
Built from https://develop.svn.wordpress.org/trunk@55424


git-svn-id: http://core.svn.wordpress.org/trunk@54957 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-25 21:56:21 +00:00
Sergey Biryukov
66937c7dce General: Add more error checking to WP_List_Util::pluck().
Values for the input array in `WP_List_Util::pluck()` or `wp_list_pluck()` must be either objects or arrays.

This commit adds a check to ensure that the value retrieved in the loop is an array before treating it as such, and throws a `_doing_it_wrong()` notice if it is neither an object nor an array.

Follow-up to [14108], [15686], [18602], [28900], [38928].

Props afragen, costdev, audrasjb.
Fixes #56650.
Built from https://develop.svn.wordpress.org/trunk@55423


git-svn-id: http://core.svn.wordpress.org/trunk@54956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-25 10:59:22 +00:00
Sergey Biryukov
5f0e3de1f8 Twenty Seventeen: Mark one more screen reader string with a translator comment.
Includes minor comment layout fixes for consistency with other themes.

Follow-up to [55276].

See #29748.
Built from https://develop.svn.wordpress.org/trunk@55422


git-svn-id: http://core.svn.wordpress.org/trunk@54955 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-24 15:26:18 +00:00
Sergey Biryukov
89f39839ab Database: Remove the check for sitecategories table on Database Repair screen.
The table is no longer created by core as of WordPress 3.0, and support for global terms was removed in WordPress 6.1, so `$wpdb->sitecategories` is unset by default.

This commit resolves a "passing null to non-nullable" deprecation notice on PHP 8.1:
{{{
Deprecated: addcslashes(): Passing null to parameter #1 ($string) of type string is deprecated in wp-includes/class-wpdb.php on line 1804
}}}

The `tables_to_repair` filter is available for plugins to readd the table or include any additional tables to repair.

Follow-up to [14854], [14880], [54240].

Props ipajen, chiragrathod103, SergeyBiryukov.
Fixes #57762.
Built from https://develop.svn.wordpress.org/trunk@55421


git-svn-id: http://core.svn.wordpress.org/trunk@54954 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-24 15:10:22 +00:00
Sergey Biryukov
803426a023 Coding Standards: Use strict comparison in bundled themes' PHP files.
This addresses all the remaining WPCS warnings in bundled themes.

Includes using the correct type when checking the number of comments, as `get_comments_number()` returns a numeric string, not an integer.

Follow-up to [41285], [44562], [47941].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54953 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-24 06:23:23 +00:00
Sergey Biryukov
896f5ef18f Posts, Post Types: Pass the post object to _update_posts_count_on_delete().
The function checks the status of the post being deleted, and then only calls `update_posts_count()` if the deleted post was previously published, as the update query would be unnecessary otherwise.

However, by the time the function runs, the post is already deleted from the database, and the post status check fails.

This commit uses the previously retrieved post object for the status check, so that the function proceeds as expected.

Includes updating the unit test to call `wp_delete_post()` with the `$force_delete` argument, so that the post is actually deleted, not trashed, and the `after_delete_post` action is run.

Follow-up to [28835], [52207], [54760], [54762].

Fixes #57023.
Built from https://develop.svn.wordpress.org/trunk@55419


git-svn-id: http://core.svn.wordpress.org/trunk@54952 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-24 01:23:20 +00:00
joedolson
f51b63c1fe Networks and Sites: Use consistent markup for admin notices.
Fix admin notices in network screens so they use consistent markup and style.

Props afercia, marksabbath, stevenkword, jeremyfelt, aryamaaru, robinwpdeveloper, obayedmamur, joedolson.
Fixes #39213.
Built from https://develop.svn.wordpress.org/trunk@55418


git-svn-id: http://core.svn.wordpress.org/trunk@54951 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-23 22:13:23 +00:00
Felix Arntz
259af07d2b Editor: Fix invalid parameters being passed to wp_register_style().
Boolean `true` is not a valid value for the `$ver` or `$media` parameters of `wp_register_style()`.

Props sabernhardt, flixos90, hellofromtonya.
Fixes #57771. See #56990, #57688.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54950 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-23 21:34:19 +00:00
Sergey Biryukov
1356f65372 Toolbar: Update the URL for Documentation link in the admin bar.
This avoids an extra redirect from `https://wordpress.org/support/` to `https://wordpress.org/documentation/`.

Follow-up to [55412], [55413], [55414], [55415].

See #57726.
Built from https://develop.svn.wordpress.org/trunk@55416


git-svn-id: http://core.svn.wordpress.org/trunk@54949 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-23 12:34:18 +00:00
audrasjb
54dd6eda90 Help/About: Use a consistent capitalization for "Support forums" links across WP Admin.
Follow-up to [55412], [55413].

See #57726.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54948 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-23 11:13:22 +00:00
audrasjb
34229a4286 Help/About: Avoid extra redirections on HelpHub Links.
This changeset replaces various HelpHub links that have changed to avoid extra 301 redirections.

Props sabernhardt, audrasjb.
See #57726.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54947 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-23 11:06:19 +00:00
audrasjb
0000d83e08 Help/About: Use the new /documentation/ URLs for HelpHub links in Bundled Themes.
As `https://wordpress.org/support/` was redirected to `https://wordpress.org/documentation/`, this changeset replaces various `/support/article/*` links with `/documentation/article/*` to avoid an extra redirect.

This also updates links to Support Forums by replacing `https://wordpress.org/support/` URLs with `https://wordpress.org/support/forums/`.

Props SergeyBiryukov, audrasjb, dhrupo, hasanmisbah, sakibmd, sabernhardt.
See #57726.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54946 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-23 10:49:19 +00:00
audrasjb
418a21fdbc Help/About: Use the new /documentation/ URLs for HelpHub links in WordPress Admin.
As `https://wordpress.org/support/` was redirected to `https://wordpress.org/documentation/`, this changeset replaces various `/support/article/*` links with `/documentation/article/*` to avoid an extra redirect.

This also updates links to Support Forums by replacing `https://wordpress.org/support/` URLs with `https://wordpress.org/support/forums/`.

Props SergeyBiryukov, audrasjb, dhrupo, hasanmisbah, sakibmd, sabernhardt.
See #57726.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54945 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-23 10:38:21 +00:00
audrasjb
8771b175cd Mail: Fix character encoding issues in Plugin/Theme background update emails.
This changeset fixes encoding issues in background update emails by applying `html_entity_decode()` on Plugin/Theme names in `send_plugin_theme_email()`.

Props paulschreiber, audrasjb, benjgrolleau, sanketchodavadiya, robinwpdeveloper, paulamit.
Fixes #56964.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54944 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-23 10:07:26 +00:00
audrasjb
e61ec90f68 Administration: Move wp-theme-plugin-editor script before </body>.
This changeset moves the `wp-theme-plugin-editor` admin script before `</body>` instead of in the `<head>`. This fixes an issue where the collapse admin menu feature was not working in the Theme|Plugin File Editor screens.

Props itsnikhilpatel, dilipbheda, stalukder03, audrasjb, adeltahri, Ankit-K-Gupta, mahbubshovan.
Fixes #57073.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54943 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-22 23:39:17 +00:00
joedolson
0f98f3142c Widgets: Match variable types in rss feed link filter.
The `rss_widget_feed_link` filter added in [52031] documents the parameter as a string, but recommends removing by returning false. Change the recommendation and documentation to make this consistent and update Twenty Twenty One to use the new recommended return value. Maintains documentation as possibly returning `false` for backwards compatibility.

Props sabernhardt, Mista-Flo.
Fixes #57594.
Built from https://develop.svn.wordpress.org/trunk@55409


git-svn-id: http://core.svn.wordpress.org/trunk@54942 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-22 22:02:23 +00:00
John Blackbourn
9ddb112d51 Networks and Sites: Remove confusing upper case for option names on Edit Site: Settings screen.
This type of transformation isn't always appropriate, especially for non-English language sites. Displaying the original option name makes it more clear what option is being changed.

Props SergeyBiryukov, sabernhardt, afrin29, afshanadiya

Fixes #50572

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


git-svn-id: http://core.svn.wordpress.org/trunk@54941 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-22 20:57:18 +00:00
hellofromTonya
1579f32cc6 HTML API: Fix finding bookmarks set on closing tag WP_HTML_Tag_Processor.
Setting a bookmark on a tag should set its "start" position before the opening "<", e.g.:
{{{
<div> Testing a <b>Bookmark</b>
----------------^
}}}

The previous calculation assumed this is always one byte to the left from `$tag_name_starts_at`.

However, in a closing tag that index points to a solidus symbol "/":
{{{
<div> Testing a <b>Bookmark</b>
----------------------------^
}}}

The bookmark should therefore start two bytes before the tag name:
{{{
<div> Testing a <b>Bookmark</b>
---------------------------^
}}}

This changeset achieves this by:
* Using the correct starting index for closing tag bookmarks.
* Adding `array( 'tag_closers' => 'visit' )` in `WP_HTML_Tag_Processor::seek()`.

Follow-up to [55203].

Props zieladam, dmsnell, flixos90.
Fixes #57787.
See #57575.
Built from https://develop.svn.wordpress.org/trunk@55407


git-svn-id: http://core.svn.wordpress.org/trunk@54940 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-22 20:55:23 +00:00
John Blackbourn
ffc55e249f Revisions: Remove an unnecessary call to _doing_it_wrong() and corresponding new text string from the implementation of the new wp_save_post_revision_revisions_before_deletion filter.
While the guard condition was technically correct, it's not practical or necessary to provide this protection for every use of every filter, and it adds unnecessary burden to translators to provide translations for strings that will likely not be seen.

Follow up to [55254].

Fixes #57320

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


git-svn-id: http://core.svn.wordpress.org/trunk@54939 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-22 20:49:20 +00:00
hellofromTonya
93dfe28aaf Themes: Add 3 and update 2 shadow presets in theme.json.
Adds Deep, Outlined, and Crisp default shadow presets to Core's `theme.json` file.

Updates the Natural and Sharp `'shadow'` styles.

These shadow presets are used to populate the Shadow tools in the Site Editor's Global Styles UI.

References:
* [https://github.com/WordPress/gutenberg/pull/46502 Gutenberg PR 46502]

Follow-up to [55176].

Props franz00, madhudollu, ajlende, beafialho, costdev, dhrupo, fabiankaegy, hellofromTonya, jameskoster, joen, kellychoffman, mamaduka, mtias, oandregal, priethor, richtabor, scruffian. 
Fixes #57708.
See #57559.
Built from https://develop.svn.wordpress.org/trunk@55405


git-svn-id: http://core.svn.wordpress.org/trunk@54938 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-22 16:00:21 +00:00
Sergey Biryukov
3533ec3159 Media: Add WP_Image_Editor_Imagick::set_imagick_time_limit() method.
This aims to avoid timeout in Imagick operations.

Previously, Imagick operations could silently error by timeout and produce unexpected results. The new `::set_imagick_time_limit()` method, now used in `::resize()` and `::crop()`, will better handle garbage collection in these cases as well as better align Imagick's timeout with PHP timeout, assuming it is set.

Props drzraf, audrasjb, costdev, antpb, SergeyBiryukov.
Fixes #52569.
Built from https://develop.svn.wordpress.org/trunk@55404


git-svn-id: http://core.svn.wordpress.org/trunk@54937 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-22 14:25:25 +00:00
gziolo
582feb3ffb HTML API: Set $this->html to protected to support subclassing
When the HTML API was introduced a number of fields were switched from private visibility to protected so that Gutenberg and other systems could more easily enhance the behaviors through subclassing. The $this->html property was overlooked but important for systems using the Tag Processor to stich HTML, specifically performing operations on innerHTML and innerText.

Follow-up [55203].
Props dmsnell.
See #57575.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54935 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-22 06:24:22 +00:00
Dominik Schilling
6d0eaf9674 Taxonomy: Rename temporary variable in wp_queue_posts_for_term_meta_lazyload().
This ensures the `$term_ids` variable only contains term IDs and is not filled with full term objects due to deprecated term caching.

Introduced in [55252].

Props skithund, Chouby, joemcgill, flixos90, ocean90.
Fixes #57150.
Built from https://develop.svn.wordpress.org/trunk@55401


git-svn-id: http://core.svn.wordpress.org/trunk@54934 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-21 21:04:17 +00:00
audrasjb
dd87b5a4bd Post WordPress 6.2 Beta 3 version bump.
Built from https://develop.svn.wordpress.org/trunk@55400


git-svn-id: http://core.svn.wordpress.org/trunk@54933 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-21 18:06:25 +00:00
audrasjb
2e1bc6e81e WordPress 6.2 Beta 3.
Built from https://develop.svn.wordpress.org/trunk@55399


git-svn-id: http://core.svn.wordpress.org/trunk@54932 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-21 17:24:21 +00:00
Sergey Biryukov
77dfc892fe Docs: Document default values for optional parameters in various DocBlocks.
Props paulkevan, costdev, audrasjb, SergeyBiryukov.
See #56792.
Built from https://develop.svn.wordpress.org/trunk@55398


git-svn-id: http://core.svn.wordpress.org/trunk@54931 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-21 16:39:19 +00:00
TimothyBlynJacobs
9b806a3114 Recovery Mode: Use PasswordHash API directly when validating keys.
Previously, the wp_check_password function was used for validating keys, while the PasswordHash class was used for creating keys. This would prevent Recovery Mode from working on sites that provide a custom implementation for the wp_check_password pluggable function.

Props calvinalkan.
Fixes #56787.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54930 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-21 15:59:18 +00:00
audrasjb
57d8df8ab1 Users: Fix confirmation link for multisite users with no role.
This fixes a regression introduced in [41163], where the link in change confirmation emails for users with no roles in a multisite install was incorrect, causing them to be unable to change their email address. This changeset replaces `admin_url()` with `self_admin_url()` to restore the previous fix.

Follow-up to [38876], [40632], [41165], [41163].

Props roytanck, SergeyBiryukov, johnbillion, afrin29.
Fixes #57164.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54929 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-21 15:55:19 +00:00
hellofromTonya
f579bc0356 Comments: Restore global $comment assignment in comment_form_title().
Restores the global `$comment` assignment in `comment_form_title()`, which was mistakely removed in [55369].

As noted in the function's DocBlock:
{{{
@internal The $comment global must be present to allow template tags access to the current comment. See https://core.trac.wordpress.org/changeset/36512.
}}}

Follow-up to [55369].

Props hellofromTonya, costdev.
Fixes #53962.
Built from https://develop.svn.wordpress.org/trunk@55395


git-svn-id: http://core.svn.wordpress.org/trunk@54928 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-21 15:28:17 +00:00
audrasjb
a8c80af126 Networks and Sites: Fix the attributes for the email input field on the new network user screen.
This reverts the email input field back to its previous state (before [55026]), except for the expected addition of the `required` attribute.

Follow-up to [55026].

Props johnbillion.
Fixes #38460.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54927 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-21 14:52:18 +00:00
Sergey Biryukov
8211ef5c3a Tests: Remove duplicate DocBlock opening characters in tests/theme/wpTheme.php.
Follow-up to [814/tests], [904/tests], [50967].

Props mukesh27, costdev.
See #56792.
Built from https://develop.svn.wordpress.org/trunk@55393


git-svn-id: http://core.svn.wordpress.org/trunk@54926 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-21 13:55:19 +00:00
gziolo
2b08f8960b Update the WP packages with fixes prior to WP 6.2 beta 3
Includes the following changes:

- Upgrade Playwright to 1.30.0
- [Block Editor - Inserter]: preload media categories empty check - client side
- Navigation: Fixes undo and redo for nesting operations in the navigation block's inspector
- Fix: OffCanvasEditor does not inserts submenu on collapsed items.
- OffCanvasEditor: Only allow some blocks to be converted to submenus
- Navigation: Updates "Add Submenu item" text to "Add Submenu link"
- Update: Make OffCanvasEditor use LeafMoreMenu by default.
- Template Part: Performance: Replace usage of wp_get_theme()->get_stylesheet() with get_stylesheet()
- Widget Editor: Fix a problem with 'Move to Widget Area' button not working
- Reusable Blocks: Use React 18 rendering for import dropdown
- useAsyncList: flush state updates when processing queue
- Refactor the site editor URLs for better backward compatibility
- Template editor: only disable the save button if no changes rather than hiding it
- [Quote]: Fix deprectated large style specificity rule
- Style Book: Allow button text labels for style book icon
- List View: Scroll selected block into view when single block selection changes
- Post editor: revert iframed editor for WP core only
- Fix the Publish region position and focus style.
- Remove "& Shadow" from the Border ScreenHeader title
- Site editor: specify focus state color for template navigation button

References: [1e2b2f680c Gutenberg's commit for publishing the packages]

Props ntsekouras, ellatrix.
See #57471.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54925 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-21 13:09:42 +00:00
Peter Wilson
770f413fe7 HTTP API: Add fragment support to WP_Http::make_absolute_url().
Modifies `WP_Http::make_absolute_url()` to prevent it from dropping URL fragments, this in turn fixes the same issue for `links_add_base_url()`.

Props costdev, sergeybiryukov, dshanske, schlessera, jrf, desrosj, dd32.
Fixes #56231.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54903 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-21 01:49:20 +00:00
Peter Wilson
a77704f1a3 Comments: Prevent replying to unapproved comments.
Introduces client and server side validation to ensure the `replytocom` query string parameter can not be exploited to reply to an unapproved comment or display the name of an unapproved commenter.

This only affects commenting via the front end of the site. Comment replies via the dashboard continue their current behaviour of logging the reply and approving the parent comment.

Introduces the `$post` parameter, defaulting to the current global post, to `get_cancel_comment_reply_link()` and `comment_form_title()`.

Introduces `_get_comment_reply_id()` for determining the comment reply ID based on the `replytocom` query string parameter.

Renames the parameter `$post_id` to `$post` in `get_comment_id_fields()` and `comment_id_fields()` to accept either a post ID or `WP_Post` object.

Adds a new `WP_Error` return state to `wp_handle_comment_submission()` to prevent replies to unapproved comments. The error code is `comment_reply_to_unapproved_comment` with the message `Sorry, replies to unapproved comments are not allowed.`.

Props costdev, jrf, hellofromtonya, fasuto, boniu91, milana_cap.
Fixes #53962.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54902 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-21 01:45:24 +00:00
hellofromTonya
5bf74c0433 Editor: Fix 'wp-block-library-theme' style enqueue conditions.
Fixes the conditions for when to enqueue the opinionated block styles (i.e. `'wp-block-library-theme'` stylesheet):

* the theme adds `'wp-block-styles'` theme support;
* and no editor styles are declared.

This resolves an issue with themes that do not add the `'wp-block-styles'` theme support while not impacting themes that do.

Follow-up to [53419], [52069], [50761], [44157].

Props mikachan, costdev, glendaviesnz, hellofromTonya, jffng, mamaduka, ndiego, poena, sannevndrmeulen, scruffian.
Fixes #57561.
Built from https://develop.svn.wordpress.org/trunk@55368


git-svn-id: http://core.svn.wordpress.org/trunk@54901 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-20 21:13:27 +00:00
Sergey Biryukov
89a3b0e9f2 Bootstrap/Load: Check that either mysqli_connect() or mysql_connect() is available.
This resolves a fatal error and displays an actionable message if the `mysqli` PHP extension is missing.

Previously, `wp_check_php_mysql_versions()` performed an early check whether `mysql`, `mysqli`, or `mysqlnd` extensions are loaded, but that did not work if the `mysqlnd` extension is the only one present.

Checking specifically for `mysqli_connect()` or `mysql_connect()` functions should be a more reliable approach and more closely mirrors the existing checks in the `wpdb` class.

Follow-up to [1955], [4489], [7234], [12732], [19760], [27257], [36434].

Props bgin, desrosj, dimadin, ipajen, hellofromTonya, sc0ttkclark, azaozz, SergeyBiryukov.
Fixes #51988.
Built from https://develop.svn.wordpress.org/trunk@55367


git-svn-id: http://core.svn.wordpress.org/trunk@54900 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-20 16:05:19 +00:00
gziolo
4046f55c78 Backport editor changes from Gutenberg for WordPress 6.2 Beta 3
Updates the `@wordpress` packages to include the following change:

- Pin `valtio` version

References: [ccabeeffe1 Gutenberg's commit for publishing the packages]

Props ntsekouras.
See #57471.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54899 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-20 13:29:05 +00:00
Sergey Biryukov
1553e3fa00 Coding Standards: Rename $post_ID variable to $post_id in various files.
The `$post_ID` variable is [546f59c678/WordPress/Sniffs/NamingConventions/ValidVariableNameSniff.php (L54) technically allowed in WPCS], as there is a global of the same name that needs to remain for backward compatibility. However, this name is mostly a remnant of legacy code, and switching to `$post_id` where appropriate brings more consistency with the rest of core.

Additionally, this commit resolves a few WPCS warnings in core:
{{{
Variable "$post_IDs" is not in valid snake_case format
}}}

This affects:
* Function parameters in:
 * `add_meta()`
 * `post_preview()`
 * `WP_Embed::delete_oembed_caches()`
 * `WP_Embed::cache_oembed()`
 * `wp_get_post_cats()`
 * `wp_set_post_cats()`
 * `wp_unique_post_slug()`
 * `wp_set_post_categories()`
 * `wp_check_post_hierarchy_for_loops()`
 * `wp_add_trashed_suffix_to_post_name_for_trashed_posts()`
 * `wp_filter_wp_template_unique_post_slug()`
 * `wp_xmlrpc_server::add_enclosure_if_new()`
 * `wp_xmlrpc_server::attach_uploads()`
 * `wp_xmlrpc_server::mt_getTrackbackPings()`
* Internal variables in:
 * `wp_ajax_inline_save()`
 * `wp_ajax_set_post_thumbnail()`
 * `wp_ajax_get_post_thumbnail_html()`
 * `edit_post()`
 * `bulk_edit_posts()`
 * `wp_write_post()`
 * `WP_Embed::shortcode()`
 * `wp_insert_post()`
 * `wp_xmlrpc_server::_insert_post()`
 * `wp_xmlrpc_server::blogger_getPost()`
 * `wp_xmlrpc_server::blogger_newPost()`
 * `wp_xmlrpc_server::blogger_editPost()`
 * `wp_xmlrpc_server::blogger_deletePost()`
 * `wp_xmlrpc_server::mw_getPost()`
 * `wp_xmlrpc_server::mw_newPost()`
 * `wp_xmlrpc_server::mw_editPost()`
 * `wp_xmlrpc_server::mt_getPostCategories()`
 * `wp_xmlrpc_server::mt_setPostCategories()`
 * `wp_xmlrpc_server::mt_publishPost()`
 * `wp_xmlrpc_server::pingback_ping()`
* Hook parameters in:
 * `oembed_ttl`
 * `embed_oembed_html`
 * `wp_insert_post_parent`
 * `add_trashed_suffix_to_trashed_posts`
 * `pre_post_update`
 * `edit_attachment`
 * `attachment_updated`
 * `add_attachment`
 * `edit_post_{$post->post_type}`
 * `edit_post`
 * `post_updated`
 * `save_post_{$post->post_type}`
 * `save_post`
 * `wp_insert_post`
 * `pre_wp_unique_post_slug`
 * `wp_unique_post_slug`
 * `xmlrpc_call_success_blogger_newPost`
 * `xmlrpc_call_success_blogger_editPost`
 * `xmlrpc_call_success_blogger_deletePost`
 * `xmlrpc_call_success_mw_newPost`
 * `xmlrpc_call_success_mw_editPost`

Note: The name change only affects variable names and DocBlocks.

The change does not affect the `$post_ID` global still used in a few places.

Follow-up to [51399], [52958], [53723], [53729], [55190], [55308], [55334].

Props mahekkalola, tanjimtc71, SergeyBiryukov.
Fixes #57692.
Built from https://develop.svn.wordpress.org/trunk@55365


git-svn-id: http://core.svn.wordpress.org/trunk@54898 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-19 15:05:22 +00:00
Sergey Biryukov
454752d283 Coding Standards: Improve variables names in post and comment page link functions.
This commit renames a few internal variables for better clarity and consistency:

* `$nextpage` to `$next_page` in:
 * `get_next_posts_page_link()`
 * `get_next_posts_link()`
 * `get_next_comments_link()`
* `$nextpage` to `$previous_page` in:
 * `get_previous_posts_page_link()`
* `$prevpage` to `$previous_page` in:
 * `get_previous_comments_link()`

Includes minor code layout fixes for better readability.

Follow-up to [5045], [8502], [8961], [28111].

Props dalirajab, SergeyBiryukov.
Fixes #57746.
Built from https://develop.svn.wordpress.org/trunk@55364


git-svn-id: http://core.svn.wordpress.org/trunk@54897 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-18 15:09:18 +00:00
Sergey Biryukov
89bb47e4e1 Docs: Add www. prefix to some PHP manual links in code comments.
This avoids an extra redirect and brings more consistency with other links to the PHP website in core.

Follow-up to [42980], [50914], [55355].

See #56792.
Built from https://develop.svn.wordpress.org/trunk@55363


git-svn-id: http://core.svn.wordpress.org/trunk@54896 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-18 14:23:21 +00:00
danielbachhuber
07720ec51f REST API: Only use Latin characters in test filenames.
Non-Latin characters can break SVN checkout in some environments.

Follow up from [55294].

See #57329, #57761.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54895 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-17 18:39:22 +00:00
TimothyBlynJacobs
42b25d58ea REST API: Normalize WP_REST_Server::dispatch() to return a response object.
Previously, the `rest_pre_dispatch` filter could be used to return a `WP_Error` instance. This would cause a fatal error for `rest_post_dispath` 
filters that were rightly expecting a `WP_REST_Response` object to be passed instead.

Props DaveFX, felipeelia.
Fixes #56566.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54894 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-17 15:45:24 +00:00
Sergey Biryukov
db71029a47 Users: Correct the error code in wp_insert_user() when login matches an existing email.
Move the test next to the other tests for `user_login`.

Follow-up to [55358].

See #57394.
Built from https://develop.svn.wordpress.org/trunk@55360


git-svn-id: http://core.svn.wordpress.org/trunk@54893 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-17 10:15:22 +00:00
audrasjb
818e9581a8 Upgrade/Install: Update available theme updates count when a theme si deleted.
This changeset fixes an issue where the available theme updates count was not updated after a theme is deleted.

Props nazmulhasan103, riccardodicurti, sabernhardt, ironprogrammer, costdev, robinwpdeveloper, rahmantasnia.
Fixes #57183.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54892 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-17 09:54:19 +00:00
Adam Silverstein
1b873c8a19 Login and Registration: prevent registering with username that matches previous user email.
When registering a new user, check that no existing user has an email matching the username.

Prevents a login name collision when one user registers with the email address user@test.com and a second user tries to register with the username user@test.com.

Props buutqn, dunhakdis, roytanck, ajayver.
Fixes #57394.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54891 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-17 08:10:22 +00:00
audrasjb
f0789b6423 Docs: Replace HTTP with HTTPS in PHP Manual links located in WP_Privacy_Policy_Content class.
Follow-up to [55355].

See #56792, #57017.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54889 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-16 23:11:28 +00:00
audrasjb
5fd4961a97 Docs: Replace HTTP with HTTPS in PHP Manual links located in wp-load.php.
Props shamimmiashuhagh.
See #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54888 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-16 23:08:20 +00:00
Andrew Ozz
e3d1a1291f Filesystem API: Use trailingslashit( $path ) instead of $path . '/'. Fixes a warning when $path already ends with a slash.
Props: costdev, afragen, mukesh27.
Fixes: #57516.
Built from https://develop.svn.wordpress.org/trunk@55354


git-svn-id: http://core.svn.wordpress.org/trunk@54887 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-16 22:13:28 +00:00
Helen Hou-Sandí
c54e29fd68 Build/Test Tools: Improve devcontainer setup for non-Codespaces usage
This now runs in local Docker as well. Sets the executable propset to explicitly identify `install-tool.sh` and `setup.sh` as executable. Unclear if this will sync via the Git mirror; ideally it would as otherwise the two files show as modified in a Git clone even in a fresh container.

Props samruddhikhandale.
See #57187.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54886 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-16 03:50:19 +00:00
Sergey Biryukov
6ead8cfda8 Coding Standards: Replace strval() with (string) type casting in wp_nav_menu().
This adjusts a newly introduced instance for consistency with the rest of core.

Follow-up to [49108], [55059].

See #57169.
Built from https://develop.svn.wordpress.org/trunk@55352


git-svn-id: http://core.svn.wordpress.org/trunk@54885 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-16 00:04:21 +00:00
Sergey Biryukov
f8dd6946fc I18N: Check that $wp_locale global is set before calling its methods.
This avoids a fatal error if these functions are called in a mu-plugin before `$wp_locale` is set:
* `wp_get_list_item_separator()`
* `wp_get_word_count_type()`

Follow-up to [52929], [52933], [55279], [55295].

Props kraftbj.
Fixes #56698.
Built from https://develop.svn.wordpress.org/trunk@55351


git-svn-id: http://core.svn.wordpress.org/trunk@54884 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-15 23:37:17 +00:00
audrasjb
ae9744d1cc I18N: Add new strings to about.php for use with end-of-life updates.
This changeset adds two additional translation strings in the changelog file, for use when releasing the final version of WordPress on a particular branch.

Props peterwilsoncc, audrasjb, mukesh27, mukesh27.
Fixes #57216.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-15 23:33:18 +00:00
audrasjb
0bccdce442 Docs: Use correct 6.2.0 @since version in multiple docblocks.
Props kebbet, audrasjb, mukesh27.
See #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54882 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-15 22:56:20 +00:00
Sergey Biryukov
b62555410f Docs: Update the wording for the Update Services link on Writing Settings screen.
The Codex URL was replaced with the corresponding HelpHub article a while ago.

Follow-up to [49912].

See #48987.
Built from https://develop.svn.wordpress.org/trunk@55347


git-svn-id: http://core.svn.wordpress.org/trunk@54880 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-15 19:18:18 +00:00
Sergey Biryukov
b9a31d5343 Docs: Improve code comments in some sanitizing functions.
This aims to clarify a few inline comments related to removing percent-encoded characters and HTML entities.

Affected functions:
* `sanitize_user()`
* `sanitize_title_with_dashes()`
* `sanitize_html_class()`
* `_sanitize_text_fields()`
* `get_comments_number_text()`

Follow-up to [465], [3454], [11433], [12503], [37987].

Props ace100, tanjimtc71, codemonksuvro, SergeyBiryukov.
Fixes #57712.
Built from https://develop.svn.wordpress.org/trunk@55346


git-svn-id: http://core.svn.wordpress.org/trunk@54879 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-15 13:06:21 +00:00
Peter Wilson
5deb3698e5 Editor: Prevent KSES stripping global layout style properties.
Layout style properties are stored using indirect values, rather than direct CSS properties. 

Allow users without the `unfiltered_html` capability to modify global styles using the indirect block spacing properties `contentSize`, `wideSize`, and `blockGap`, using a mapping of the eventual CSS property to the indirect property stored in `theme.json`. The mapped CSS property is then used for CSS validation.

Props andrewserong, costdev, hellofromtonya, mamaduka, mmtr86.
Fixes #57321.



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


git-svn-id: http://core.svn.wordpress.org/trunk@54878 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-15 03:57:17 +00:00
Peter Wilson
fc49b0b92a Date/Time: Revert mysql2date changes in [55343].
These changes will be targeted to the 6.3 release.

See #57705.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54877 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-15 02:02:16 +00:00
spacedmonkey
0dc9b1a9b8 Date/Time: Save a call to wp_timezone in mysql2date.
Save a call to `wp_timezone` in `mysql2date` by saving the timezone to a variable and pass it into `wp_date` function call. 

Props spacedmonkey, costdev, SergeyBiryukov, audrasjb.
Fixes #57705.
Built from https://develop.svn.wordpress.org/trunk@55343


git-svn-id: http://core.svn.wordpress.org/trunk@54876 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-14 21:41:20 +00:00
hellofromTonya
14f8608af9 Build/Test Tools: Fix invalid styles data type PHP Warning in REST_Block_Type_Controller_Test::test_get_item_invalid().
Sets the `styles` block setting to an empty array in the `REST_Block_Type_Controller_Test::test_get_item_invalid()` test to resolve:

{{{
Warning: foreach() argument must be of type array|object, string given in wp-includes/class-wp-theme-json.php on line 835
}}}

Previously the test set the `styles` setting to a string value, which is incompatible. The problem surfaced after [55172] added a `foreach` to iterate the `styles`. The root cause was due to this test passing a string instead of an array.

Why?

`WP_Block_Type` `styles` property is documented as only accepting an array data type. At the time of this changeset, it does not validate before setting the property.

Code interacting with the property expects it to be an array data type. The PHP Warning alerts that of a doing it wrong when the incorrect data type is registered for the block type.

Follow-up to [55172], [48173].

Props tanjimtc71, hellofromTonya, kapilpaul.
Fixes #57706.
Built from https://develop.svn.wordpress.org/trunk@55342


git-svn-id: http://core.svn.wordpress.org/trunk@54875 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-14 19:10:21 +00:00
hellofromTonya
566eaaafa2 Build/Test Tools: Fix inaccurate coverage in Tests_Functions_wpListPluck::set_up().
The call stack for `WP_UnitTestCase_Base::set_up()` includes a call to `WP_List_Util::pluck()`, which creates an inaccurate coverage report for this method.

To resolve, `parent::set_up()` is removed from `Tests_Functions_wpListPluck::set_up()`.

To ensure that deprecation and incorrect usage notices continue to be detectable, `$this->expectDeprecated()` is added in the test's `set_up()` fixture.

Follow-up to [51663], [28900].

Props costdev, jrf, SergeyBiryukov, audrasjb.
Fixes #56706.
Built from https://develop.svn.wordpress.org/trunk@55341


git-svn-id: http://core.svn.wordpress.org/trunk@54874 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-14 18:21:23 +00:00
audrasjb
4f9ff9b25b Post WordPress 6.2 Beta 2 version bump.
Built from https://develop.svn.wordpress.org/trunk@55340


git-svn-id: http://core.svn.wordpress.org/trunk@54873 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-14 18:05:19 +00:00
audrasjb
759a05a840 WordPress 6.2 Beta 2.
Built from https://develop.svn.wordpress.org/trunk@55339


git-svn-id: http://core.svn.wordpress.org/trunk@54872 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-14 17:46:23 +00:00
hellofromTonya
ab35789175 Editor: Remove missing postType and postId query args Site Editor redirect.
Removes the server-side redirection if missing `postType` and `postId` query args when visiting Site Editor. Why? This redirect is no longer needed as the routing is now handled client side (via [55333]).

References:
* [https://github.com/WordPress/gutenberg/pull/48023 Gutenberg PR 48023]
* [https://github.com/WordPress/gutenberg/pull/47777 Gutenberg PR 47777]

Follow-up to [55333], [53413], [53093].

Props ntsekouras, youknowriad.
Fixes #57716.
Built from https://develop.svn.wordpress.org/trunk@55338


git-svn-id: http://core.svn.wordpress.org/trunk@54871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-14 16:26:18 +00:00
Sergey Biryukov
fb6c959884 Tests: Merge file-level and class-level DocBlocks in various unit test files.
Per the [https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/#6-file-headers documentation standards], whenever possible, all WordPress files should contain a header DocBlock, regardless of the file’s contents – this includes files containing classes.

However, this recommendation makes less sense for unit test classes if not applied consistently, and the duplicate tags cause some confusion.

This commit aims to reduce confusion and avoid repeating information by combining the DocBlocks.

Follow-up to [40607], [43183], [43291], [43292], [43499], [43568], [44502], [44535], [44628], [44786], [44824], [44906], [44909], [46175].

Props wojtekn, antonvlasenko, arafatjamil01, hztyfoon, mukesh27, costdev, jamilbd07, robinwpdeveloper, SergeyBiryukov.
Fixes #57099.
Built from https://develop.svn.wordpress.org/trunk@55337


git-svn-id: http://core.svn.wordpress.org/trunk@54870 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-14 16:12:17 +00:00
audrasjb
592e136b67 Feeds: Fix various typos in MagpieRSS.
Props nithins53, desrosj, anantajitjg, mukesh27.
Fixes #57102.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54869 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-14 16:06:21 +00:00
davidbaumwald
f1e01d188c Themes: Use add_action for pre_get_posts hook in _add_template_loader_filters().
Although `add_action` and `add_filter` are internally the same, `pre_get_posts` is an action hook.  This change updates the hook type to match what developers would expect when evaluating the code.

Follow-up to [52316].

Props swissspidy, riccardodicurti.
Fixes #57097.
Built from https://develop.svn.wordpress.org/trunk@55335


git-svn-id: http://core.svn.wordpress.org/trunk@54868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-14 15:57:21 +00:00
Sergey Biryukov
6e59ccc47e Coding Standards: Rename the remaining $cat_ID variables to $cat_id.
This resolves a few WPCS warnings:
{{{
Variable "$cat_ID" is not in valid snake_case format, try "$cat_i_d"
}}}

Affected functions:
* `wp_delete_category()`
* `get_category_rss_link()`
* `get_catname()`

Follow-up to [836], [2068], [2551], [2695], [6365], [10959], [52958], [55190].

Fixes #56754.
Built from https://develop.svn.wordpress.org/trunk@55334


git-svn-id: http://core.svn.wordpress.org/trunk@54867 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-14 15:46:18 +00:00
hellofromTonya
8588041fd2 Editor: Update @wordpress packages for 6.2 Beta 2.
Updates the `@wordpress` packages to include the following changes:

- Add missing period in keyboard shortcut descriptions
- Site Editor: Append template type and name to the site editor page title
- Specify active color state for template navigation button
- Global Styles: Move more link about custom CSS to part of description
- ToolsPanel: Display optional items when values are updated externally
- File block: Re-add editor styles for classic themes
- Enable undo after creating a new menu
- Style Book: Exclude blocks that are not allowed to insert
- Add basic tsconfig.json validation
- Fix Experiments native variant breakage
- Update moment and moment-timezone packages to fix timezone issues
- NavigatorButton: Reuse Button types
- ToolsPanel: Ensure display of optional items when panel id is null
- ColorPalette: Ensure text label contrast checking works with CSS variables
- Components: Add support for named arguments in the navigator components
- Rename experiments package to private-apis
- Cherry-pick CLI: Fix the default label to match the documentation
- Handle block metadata attribute and related experimental APIs
- Fix: Remove browser default border for iframe in the editor
- [Layout]: Fix align controls for hybrid themes
- Visual Regression tests: use default playwright utils
- SelectControl: Fix multiple prop styling
- Fix clicking on the toggle button not closing the block inserter
- Update deps for the useEffect that creates navigation menus
- Minor updates in Private APIs docs
- Site Editor: Fix custom Template Parts rename action
- [Block Library - Cover]: Ensure url is not malformed due to sanitization through wp_kses
- Revert "Prevent the image from being resized larger than its container"
- Lodash: Remove from @wordpress/keycodes package
- Distraction free mode: Fix keyboard shortcut not working
- Popover: lock the __experimentalPopoverPositionToPlacement function
- Rename the "experiments" export to "privateApis"
- Add an aria label to the site save dialog
- Navigator: add more pattern matching tests, refine existing tests
- Add parent navigation support for the navigator component
- Add back link to Design heading in site editor navigation to return to Dashboard
- Add a nested level when selecting templates or template parts
- Move site editor 6.2 specific code to the right file
- Fix site editor navigation

References:
* [1bf01c01a8 Gutenberg's commit for publishing the packages]

Follow-up to [55257].

Props ntsekouras.
See #57471.
Built from https://develop.svn.wordpress.org/trunk@55333


git-svn-id: http://core.svn.wordpress.org/trunk@54866 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-14 15:44:36 +00:00
Sergey Biryukov
b23607d537 Docs: Add a @since note about Twenty Twenty-Three for WP_Theme::$default_themes.
Follow-up to [51328], [52941], [54236].

Props petitphp.
Fixes #57714.
Built from https://develop.svn.wordpress.org/trunk@55332


git-svn-id: http://core.svn.wordpress.org/trunk@54865 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-14 14:38:22 +00:00
audrasjb
47b1864c2e Permalinks: Properly escape strings in Permalinks Settings screen.
Props jaedm97, audrasjb, robinwpdeveloper, shraboni.
Fixes #57143.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54864 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-14 11:34:23 +00:00
Peter Wilson
6310d1d21a Bundled themes: Recommit generated files following [55329].
See #56226.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54863 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-14 04:22:21 +00:00
Peter Wilson
5237f454bd Bundled themes: Fix row variation nested in group block.
Remove the `display` property from the custom group block styles to prevent the flex layout in the row variation from been removed.

Props abirhasandipu, poena, robinwpdeveloper.
Fixes #56226.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54862 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-14 04:03:18 +00:00
Peter Wilson
afe51338ac Menus: Test creating parent after a child doesn't throw an error.
As menus are re-arranged, it's possible a menu item was created prior to its parent.

This introduces a test to ensure the order in which menu items are created relevant to their parents does not trigger errors.

Props costdev, peterwilsoncc.
Fixes #57122.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54861 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-14 03:32:19 +00:00
joedolson
fe9d343775 Administration: Fix JavaScript test failure.
Remove unused variable `e` that I removed from Github, but failed to remove before committing. Follow up to [55326].

Unprops joedolson.
Fixes #53587.
Built from https://develop.svn.wordpress.org/trunk@55327


git-svn-id: http://core.svn.wordpress.org/trunk@54860 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-14 00:41:19 +00:00
joedolson
cc27b6cc19 Administration: Close admin menu when focus moves to body.
User should not have to reach the admin menu toggle in order to close the menu. This can be a problem for one-handed mobile use, users with small hands, and numerous other situational usages.

Close the admin menu when focus moves anywhere other than the menu or the menu toggle and the current document is active.

Props kaneva, sabernhardt, costdev, ryokuhi, hellofromtonya, dhusakovic, thelovekesh, joedolson.
Fixes #53587.
Built from https://develop.svn.wordpress.org/trunk@55326


git-svn-id: http://core.svn.wordpress.org/trunk@54859 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-14 00:38:20 +00:00
hellofromTonya
5584cf60c0 REST API: Remove 'Invalid user ID' error in WP_REST_Users_Controller::update_item().
Removes the `WP_Error` code for `'Invalid user ID.'`. Why?

tl;dr
This branch will never be entered as the `$user` will never be falsey.

Longer reasoning:

[39954] introduced `WP_REST_Users_Controller::get_user()` method to encapsulate getting the user and handling the `'Invalid user ID.'` `WP_Error`. It replaced `get_userdata()` in `WP_REST_Users_Controller::update_item()` but left the existing `'Invalid user ID.'` `WP_Error` introduced in [38832].

The code removed in this changeset will never be reached because `$user` will never be falsey. Rather, `WP_REST_Users_Controller::get_user()` will always return an instance of `WP_Error` or `WP_User`. 

Could the user's ID be falsey?
No. Why? `WP_REST_Users_Controller::get_user()` checks that the user exists, which checks if the ID is falsey.

Therefore, the code can safely be removed.

Follow-up to [39954], [38832].

Props jrf, costdev, hellofromTonya, SergeyBiryukov.
Fixes #56662.
Built from https://develop.svn.wordpress.org/trunk@55325


git-svn-id: http://core.svn.wordpress.org/trunk@54858 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-13 23:10:20 +00:00
Sergey Biryukov
371afa317c Comments: Use correct orderby parameter name in personal data exporter and eraser.
This ensures that `get_comments()` is called with the correct parameter name in:
* `wp_comments_personal_data_exporter()`
* `wp_comments_personal_data_eraser()`

Follow-up to [42888], [42994].

Props smeunus, kapilpaul, SergeyBiryukov.
Fixes #57700.
Built from https://develop.svn.wordpress.org/trunk@55324


git-svn-id: http://core.svn.wordpress.org/trunk@54857 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-13 22:05:22 +00:00
hellofromTonya
854f388d02 Editor: Restores file block button styles for classic themes.
Adds styles into `wp-includes/css/classic-themes.css` to restore file block button element styling for classic themes.

Why?

In [54257] and [54118], button element styles were moved from each block to `theme.json`. For the file block, the download button styles were removed from the block's stylesheet. These changes impacted themes without a `theme.json` file (i.e. classic themes).

This changeset restores the styles for backwards-compatibility.

References:
* [https://github.com/WordPress/gutenberg/pull/47686 Gutenberg PR 47686]

Follow-up to [54257], [54118].

Props wildworks, scruffian, mamaduka, ntsekouras.
Fixes #57688.
Built from https://develop.svn.wordpress.org/trunk@55323


git-svn-id: http://core.svn.wordpress.org/trunk@54856 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-13 20:50:19 +00:00
Sergey Biryukov
3ed98d6e72 Tests: Declare the $post_id property in wp_comments_personal_data_exporter() tests.
Use the same approach in `wp_comments_personal_data_eraser()` for consistency and to minimize the number of fixtures created in each individual test.

Follow-up to [55319], [55321].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54855 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-13 19:37:22 +00:00
Sergey Biryukov
95fb91bc18 Tests: Move wp_comments_personal_data_exporter() tests to their own file.
This aims to make the tests more discoverable and easier to expand.

Follow-up to [42987], [55319].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@55321


git-svn-id: http://core.svn.wordpress.org/trunk@54854 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-13 19:13:20 +00:00
Sergey Biryukov
20d73096b2 Tests: Add missing @covers tag for a wp_update_comment() test.
Follow-up to [37609], [53863].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@55320


git-svn-id: http://core.svn.wordpress.org/trunk@54853 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-13 19:03:16 +00:00
Sergey Biryukov
4cbf7e7e7a Tests: Move wp_comments_personal_data_eraser() tests to their own file.
This aims to make the tests more discoverable and easier to expand.

Follow-up to [42994].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@55319


git-svn-id: http://core.svn.wordpress.org/trunk@54852 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-13 18:58:20 +00:00
Felix Arntz
1da2841c07 Media: Enhance logic to determine LCP image in block themes and avoid lazy-loading it.
[52065] originally introduced the logic to guess the LCP image based on certain heuristics and to not lazy-load that image. However, with the introduction of block themes, that logic was not functioning correctly, resulting in all featured images to be lazy-loaded, regardless of whether it was the LCP image or not.

Together with an update to the `core/post-featured-image` block included in [55079], this changeset fixes the logic to correctly handle featured images in block themes as well.

Additionally, in combination with an update to the `core/template-part` block from [55246], this changeset includes an enhancement which uses the benefits of block template parts to avoid lazy-loading images in the `header` block template part, making the lazy-loading heuristics even more accurate for sites using a block theme.

Props flixos90, adamsilverstein, mamaduka, antonvlasenko, shahidul95, reduanmasud, costdev, mukesh27, ironprogrammer, manfcarlo, robinwpdeveloper, spacedmonkey.
Fixes #56930.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54851 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-13 18:34:17 +00:00
audrasjb
588b002955 Twenty Twenty: Properly reflect text color changes in Quote and Pullquote block.
This changeset ensures that text color for citation are inherited when the user specifies color for the Pullquote or Quote block, or if one of those blocks is inside a block with a background.

Props nithins53, kajalgohel, kmadhak, sabernhardt, devtanbir, james-roberts, sapayth, rafinkhan, robinwpdeveloper, poena.
Fixes #55990.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54850 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-13 15:20:18 +00:00
audrasjb
b9dbddaac5 Docs: Various improvements in XML-RPC Class function descriptions, as per docblocks standards.
See #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54849 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-13 15:18:19 +00:00
Sergey Biryukov
f77ce1d953 Tests: Rename the html tests directory to html-api.
This matches the `WP_HTML_Tag_Processor` class location in `wp-includes` and the `@group` name used in the tests.

Follow-up to [55203].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@55315


git-svn-id: http://core.svn.wordpress.org/trunk@54848 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-13 14:40:19 +00:00
hellofromTonya
be815b3093 Themes: Remove local() from @font-face styles in _wp_theme_json_webfonts_handler().
Removes adding `local()` as a `@font-face` `src` within `_wp_theme_json_webfonts_handler()`.

Why?

To fix font incompatibilities when a user has the font-family locally installed on their viewing computer or device. It's unknown if all of the font-face variations specified by theme.json and/or global styles are:

* installed on the user's computer/device.
* and in one file or multiple files.

The previous implementation used the `src` specified when registering the font with the API. That src will likely vary from user computer/device to user computer/device.

To avoid these unknowns which could cause incompatibilities or styling issues, this changeset removes adding `local()` to the generated font-face CSS styles.

References:
* [https://github.com/WordPress/gutenberg/pull/47254 Gutenberg PR 47254]

Follow-up to [53282].

Props luehrsen, aristath, ehtmlu, hellofromTonya, wetah.
Fixes #57430.
Built from https://develop.svn.wordpress.org/trunk@55314


git-svn-id: http://core.svn.wordpress.org/trunk@54847 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-13 14:33:18 +00:00
Sergey Biryukov
e70f9b1a11 Tests: Move PasswordHash test file to a more appropriate place.
While also used for post passwords and application passwords, the PasswordHash library appears to be initially introduced and primarily used for user passwords, so the test file can be moved to the `user` directory.

Follow-up to [6350], [55310].

See #56340.
Built from https://develop.svn.wordpress.org/trunk@55313


git-svn-id: http://core.svn.wordpress.org/trunk@54846 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-13 14:22:21 +00:00
audrasjb
170d435c0b Twenty Twelve: Properly reflect text color changes in Table block.
This changeset makes the table header cells also inherit text colors, when the user selects a text color.

Props nidhidhandhukiya, sabernhardt, poena, faguni22.
Fixes #56466.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54845 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-13 09:23:19 +00:00
audrasjb
a67d0acee7 Docs: Use third-person singular verbs for WP_Meta_Query related function descriptions, as per docblocks standards.
See #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54844 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-13 09:21:18 +00:00