Commit Graph

20998 Commits

Author SHA1 Message Date
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
audrasjb
5ea4666f2d External Libraries: Prevent a PHP 8.1 deprecation notice in PasswordHash::gensalt_blowfish().
This changeset uses an `(int)` cast to prevent a PHP 8.1 deprecation notice for "Implicit conversation from float to int loses precision" in `PasswordHash::gensalt_blowfish()`.

Props hanshenrik, jrf, desrosj, costdev.
Fixes #56340.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54843 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-13 09:08:23 +00:00
audrasjb
125d3fd72e Formatting: Add aspect-ratio as valid CSS property in KSES.
This changeset adds support for the `aspect-ratio` CSS property, which is considered safe for inline CSS.

Props ajlende, peterwilsoncc.
Fixes #57664.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54842 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-13 08:47:21 +00:00
Sergey Biryukov
bd92d87b74 Coding Standards: Rename $comment_ID variable to $comment_id in various files.
This resolves 80+ WPCS warnings in core:
{{{
Variable "$comment_ID" is not in valid snake_case format
}}}

While matching the database field of the same name, the `$comment_ID` variable did not follow the WordPress coding standards, and is now renamed to address that.

This affects:
* Function parameters in:
 * `get_comment_author()`
 * `comment_author()`
 * `get_comment_author_email()`
 * `comment_author_email()`
 * `get_comment_author_link()`
 * `comment_author_link()`
 * `get_comment_author_IP()`
 * `comment_author_IP()`
 * `get_comment_author_rl()`
 * `comment_author_url()`
 * `get_comment_date()`
 * `comment_date()`
 * `get_comment_excerpt()`
 * `comment_excerpt()`
 * `get_comment_text()`
 * `comment_text()`
 * `get_comment_time()`
 * `comment_time()`
 * `get_comment_type()`
 * `get_page_of_comment()`
 * `wp_new_comment_notify_moderator()`
 * `wp_new_comment_notify_postauthor()`
 * `get_commentdata()`

* Internal variables in:
 * `get_comment_ID()`
 * `wp_new_comment()`
 * `wp_xmlrpc_server::wp_deleteComment()`
 * `wp_xmlrpc_server::wp_editComment()`
 * `wp_xmlrpc_server::wp_newComment()`
 * `wp_xmlrpc_server::pingback_ping()`

* Hook parameters in:
 * `get_comment_author`
 * `comment_author`
 * `get_comment_author_email`
 * `author_email`
 * `get_comment_author_link`
 * `get_comment_author_IP`
 * `get_comment_author_url`
 * `comment_url`
 * `get_comment_excerpt`
 * `comment_excerpt`
 * `get_comment_ID`
 * `get_comment_type`
 * `get_page_of_comment`
 * `comment_{$new_status}_{$comment->comment_type}`
 * `comment_post`
 * `notify_moderator`
 * `notify_post_author`
 * `commentrss2_item`
 * `xmlrpc_call_success_wp_deleteComment`
 * `xmlrpc_call_success_wp_editComment`
 * `xmlrpc_call_success_wp_newComment`
 * `pingback_post`

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

The change does not affect:

* `comment_ID` as the `$orderby` value in `WP_Comment_Query::__construct()`
* `comment_ID` as the `$orderby` value in `WP_Comment::get_children()`
* `comment_ID` as part of `$commentarr` parameter in `wp_update_comment()`

The associated array keys still match the database field.

Follow-up to [53723].

Props krunal265, costdev, SergeyBiryukov.
Fixes #57671. See #56791.
Built from https://develop.svn.wordpress.org/trunk@55308


git-svn-id: http://core.svn.wordpress.org/trunk@54841 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-12 18:08:21 +00:00
joedolson
10a1594b64 Toolbar: Prevent false positive on automated contrast testing.
The non-focused state of the `.screen-reader-shortcut` element in the admin bar fails contrast tests. This has no real-world consequences, but raises false positives in some automated testing tools. This fix is largely so people using automated testing will not raise false positives.

Props sabernhardt, afercia, robinwpdeveloper, re_enter_rupok.
Fixes #56789.
Built from https://develop.svn.wordpress.org/trunk@55307


git-svn-id: http://core.svn.wordpress.org/trunk@54840 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-11 17:39:20 +00:00
Sergey Biryukov
5826e74499 Coding Standards: Pass correct value to get_delete_post_link() in attachment_submit_meta_box().
The `$deprecated` parameter of `get_delete_post_link()` is documented to accept a string, not `null`.

Follow-up to [14099], [21948].

Props krunal265, jrf.
Fixes #57690.
Built from https://develop.svn.wordpress.org/trunk@55306


git-svn-id: http://core.svn.wordpress.org/trunk@54839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-11 13:12:19 +00:00
Sergey Biryukov
42d571decb Mail: Check that set_time_limit() function is available before using it in class-pop3.php.
This avoids a fatal error if the function is disabled on certain environments.

Follow-up to [55258].

Props mujuonly.
Fixes #57659.
Built from https://develop.svn.wordpress.org/trunk@55305


git-svn-id: http://core.svn.wordpress.org/trunk@54838 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-11 12:43:22 +00:00
Sergey Biryukov
09cc873d3a Docs: Replace short array syntax in WP_HTML_Tag_Processor documentation.
Per [https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#declaring-arrays WordPress PHP Coding Standards]:
> Using long array syntax ( `array( 1, 2, 3 )` ) for declaring arrays is generally more readable than short array syntax ( `[ 1, 2, 3 ]` ), particularly for those with vision difficulties. Additionally, it’s much more descriptive for beginners.
> 
> Arrays must be declared using long array syntax.

Original PR from Gutenberg repository:
* [https://github.com/WordPress/gutenberg/pull/47958 #47958 Docs: Don't recommend using short array syntax in WP_HTML_Tag_Processor]

Follow-up to [55203], [55206].

Props aristath, poena.
Fixes #57691.
Built from https://develop.svn.wordpress.org/trunk@55304


git-svn-id: http://core.svn.wordpress.org/trunk@54837 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-10 10:59:25 +00:00
Helen Hou-Sandí
facdf664c9 Build/Test Tools: Add a devcontainer for Codespaces support.
This adds a devcontainer configuration tested for use with GitHub Codespaces. It is currently built on top of the Docker `wordpress` image for initial trial purposes. We should eventually be using our own containers to fully own the environment.

This should be considered a beta run to get a sense of how well cloud dev containers work for core contributors, in particular at contributor day events with limited bandwidth and mobile devices.

Props samruddhikhandale, dinhtungdu, helen, craiglpeters, sam1el, wirecat.
See #57187.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54836 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-10 03:01:18 +00:00
Pascal Birchler
cb9f9d81b2 I18N: Prevent fatal error in WP_Textdomain_Registry.
Use `rtrim` instead of `untrailingslashit` and `trailingslashit` directly.

Avoids `formatting.php` dependency and thus prevents an error when called via `wp_load_translations_early()`, which happens e.g. when in maintenance mode.

Props grl570810, ocean90.
Fixes #57218.
Built from https://develop.svn.wordpress.org/trunk@55302


git-svn-id: http://core.svn.wordpress.org/trunk@54835 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-09 16:35:22 +00:00
Sergey Biryukov
bc0c01b1ac Login and Registration: Set correct default values in wp_signon().
The `$credentials['user_login']` and `$credentials['user_password']` parameters are passed by reference to the `wp_authenticate` action, and are at that point [https://www.php.net/manual/en/language.references.pass.php#124383 created as null] if they don't exist in the array.

This commit sets those values to an empty string, resolving two PHP 8.1 deprecation notices:
 * One from `preg_replace()` in `wp_strip_all_tags()` via `sanitize_user()` in `wp_authenticate()`:
{{{
Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
}}}
 * One from `trim()` in `wp_authenticate()` itself:
{{{
Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated
}}}

Includes documenting the `$credentials` parameter using hash notation.

Follow-up to [6643], [37697].

Props lenasterg, TobiasBg, ocean90, afragen, lkraav, SergeyBiryukov.
Fixes #56850.
Built from https://develop.svn.wordpress.org/trunk@55301


git-svn-id: http://core.svn.wordpress.org/trunk@54834 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-09 01:31:22 +00:00
danielbachhuber
d1b96a8e04 Media: Use strict comparison in make_subsize().
Follow up from [55278].

Props bueltge, desrosj, mukesh27.
See #57370.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54833 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-08 20:51:21 +00:00
joedolson
be531bdd37 Media: Fix focus loss updating custom fields in media modal.
When the save action runs to dynamically save changes to custom fields in the media modal, the custom fields container is re-rendered, losing focus. Remove the re-rendering of custom fields to prevent loss of focus.

Props lucymtc, teebee, syhc, afrin29, antpb, joedolson.
Fixes #40909.
Built from https://develop.svn.wordpress.org/trunk@55299


git-svn-id: http://core.svn.wordpress.org/trunk@54832 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-08 19:40:19 +00:00
Sergey Biryukov
411cd2f5b3 Docs: Correct @since tag for WP_Locale_Switcher::$stack.
The `WP_Locale_Switcher::$locales` property was replaced with `::$stack` in WordPress 6.2.

Follow-up to [38961], [55161], [55224].

See #57123.
Built from https://develop.svn.wordpress.org/trunk@55298


git-svn-id: http://core.svn.wordpress.org/trunk@54831 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-08 17:08:21 +00:00
audrasjb
a612564204 Help/About: Add info about the "View" row action link to the Users screen help tab.
Props kebbet, audrasjb, SergeyBiryukov, webcommsat.
Fixes #57666.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54830 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-08 16:14:18 +00:00
hellofromTonya
ecb9325014 Upgrade/Install: Skip preloading Requests for WordPress versions before 4.6.
Skip preloading Requests files in `_preload_old_requests_classes_and_interfaces()` when updating from a WordPress version older than 4.6.

Why?

Requests library was first introduced into WordPress 4.6 via #33055 / [37428]. If a user is upgrading from a version older than 4.6, this changeset prevents the Requests preloading to prevent a fatal error of attempting to load files that do not exist in their current WordPress version.

Follow-up to [54997], [37428].

Props afragen, costdev, ironprogrammer, antonvlasenko.
Fixes #57662.
Built from https://develop.svn.wordpress.org/trunk@55296


git-svn-id: http://core.svn.wordpress.org/trunk@54829 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-08 15:03:19 +00:00
Sergey Biryukov
e841840662 Docs: Document possible return values for wp_get_word_count_type().
Follow-up to [55279].

See #56698.
Built from https://develop.svn.wordpress.org/trunk@55295


git-svn-id: http://core.svn.wordpress.org/trunk@54828 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-08 10:17:23 +00:00
danielbachhuber
e41af7cdc6 REST API: Support non-Latin characters in template route regex.
Non-Latin characters are URL-encoded (e.g. `%cf%84%ce%b5%cf%83%cf%84`). Matching `%` in the route ensures templates with non-Latin titles can be properly saved.

Props antonyagrios, mburridge.
Fixes #57329.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54827 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-07 23:47:23 +00:00
John Blackbourn
270a3d009d Docs: Miscellaneous improvements and corrections to docblocks.
See #56792

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


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