Commit Graph

47332 Commits

Author SHA1 Message Date
Greg Ziółkowski
7a8ea502cf Editor: Correctly merge custom CSS into global styles
Update the get_block_editor_settings function and merge custom CSS directly into the $global_styles array.

Fixes #57833.
Props Mamaduka, poena, sakibmd.



git-svn-id: https://develop.svn.wordpress.org/trunk@55438 602fd350-edb4-49c9-b593-d223f7449a82
2023-03-01 11:41:53 +00:00
Andrew Ozz
0bbf09f496 Media: Revert the addition of a $size parameter to get_attached_file().
Reverts [55199], [55202], and [55217] but keeps the updated docs.

Props: flixos90, joedolson, azaozz.
Fixes: #51780.

git-svn-id: https://develop.svn.wordpress.org/trunk@55437 602fd350-edb4-49c9-b593-d223f7449a82
2023-03-01 00:34:18 +00:00
Tonya Mork
5ce8b1f9ed Editor: Deprecate _resolve_home_block_template().
The internal Core-only `_resolve_home_block_template()` function was introduced in [53093] for a specific purpose of resolving the template for a site's home page. It was used as part of the Site Editor's redirect when the `postType` and `postId` query args were missing. The server-side handling was removed in [55338]. The function is no longer used in Core.

This changeset deprecates the function and removes its tests.

Follow-up to [55338], [53093].

Props johnbillion, hellofromTonya.
Fixes #57716.

git-svn-id: https://develop.svn.wordpress.org/trunk@55436 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-28 15:05:50 +00:00
Tonya Mork
ad6e01a434 Site Editor: Add 'path' query arg to Appearance > Template Parts menu.
To display a list of block-based template parts for classic themes, this changeset adds a `path` query arg to the Appearance > Template Parts menu URL. This change is necessary due to recent changes to Site Editor's client-side routing.

Reference:
* [https://github.com/WordPress/gutenberg/pull/48343 Gutenberg PR 48343]
* [https://github.com/WordPress/gutenberg/pull/42729 Gutenberg PR 42729]

Follow-up to [55392], [54176].

Props mamaduka, audrasjb, fabiankaegy, hellofromTonya, kevin940726, mukesh27, youknowriad.
Fixes #57819.

git-svn-id: https://develop.svn.wordpress.org/trunk@55435 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-28 15:02:18 +00:00
Sergey Biryukov
d401685675 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@55434 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-28 13:50:38 +00:00
Sergey Biryukov
12069068bd 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@55433 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-28 13:20:04 +00:00
Jb Audras
b4000c3aaa 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@55432 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-28 12:50:46 +00:00
Jb Audras
f0f63fe4b2 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@55431 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-28 12:46:10 +00:00
Peter Wilson
63b3c26f07 Formatting: Add aspect-ratio tests for safecss_filter_attr().
Follow up to [55309].

Props rahmohn, desrosj, mukesh27.
Fixes #57664.


git-svn-id: https://develop.svn.wordpress.org/trunk@55430 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-28 02:50:28 +00:00
Jb Audras
c102b78ea6 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@55429 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-27 23:14:57 +00:00
Jb Audras
9114d746bb Docs: Fix erroneous @since mention in wp_internal_hosts hook.
Follow-up to [55289].

Props wildworks, SergeyBiryukov, simongomes02.
Fixes #57796.


git-svn-id: https://develop.svn.wordpress.org/trunk@55428 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-27 22:53:44 +00:00
Felix Arntz
09a0db5897 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@55427 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-27 17:30:07 +00:00
Sergey Biryukov
18878a1d93 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@55426 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-27 15:32:22 +00:00
Sergey Biryukov
12fcc5cfac 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@55425 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-26 15:17:45 +00:00
Sergey Biryukov
21d70052b6 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@55424 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-25 21:54:03 +00:00
Sergey Biryukov
c758a10d98 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@55423 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-25 10:57:14 +00:00
Sergey Biryukov
7d8b5e89bc 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@55422 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-24 15:24:25 +00:00
Sergey Biryukov
1b949ded14 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@55421 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-24 15:08:26 +00:00
Sergey Biryukov
5fd8bed76b 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@55420 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-24 06:21:21 +00:00
Sergey Biryukov
b394c9c144 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@55419 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-24 01:21:54 +00:00
Joe Dolson
cc8dd3e1f6 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@55418 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-23 22:11:51 +00:00
Felix Arntz
dff607e96e 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@55417 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-23 21:32:15 +00:00
Sergey Biryukov
c2a4cce173 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@55416 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-23 12:32:37 +00:00
Jb Audras
4e7e3c2dd6 Help/About: Use a consistent capitalization for "Support forums" links across WP Admin.
Follow-up to [55412], [55413].

See #57726.


git-svn-id: https://develop.svn.wordpress.org/trunk@55415 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-23 11:11:38 +00:00
Jb Audras
cfc2be2383 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@55414 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-23 11:04:40 +00:00
Jb Audras
7a90e6cbfa 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@55413 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-23 10:47:19 +00:00
Jb Audras
0a422d3f4b 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@55412 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-23 10:36:33 +00:00
Jb Audras
e2ce8d4815 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@55411 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-23 10:05:51 +00:00
Jb Audras
f01313a474 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@55410 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-22 23:37:35 +00:00
Joe Dolson
5595995191 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@55409 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-22 22:00:08 +00:00
John Blackbourn
6b04c0b9f8 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


git-svn-id: https://develop.svn.wordpress.org/trunk@55408 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-22 20:54:05 +00:00
Tonya Mork
83ae6b790e 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@55407 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-22 20:53:41 +00:00
John Blackbourn
b0754798c6 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


git-svn-id: https://develop.svn.wordpress.org/trunk@55406 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-22 20:47:38 +00:00
Tonya Mork
05648a50aa 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@55405 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-22 15:58:56 +00:00
Sergey Biryukov
01c65c0c36 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@55404 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-22 14:23:50 +00:00
gziolo
552178a95a 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@55402 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-22 06:22:02 +00:00
Dominik Schilling
365efb13c2 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@55401 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-21 21:02:28 +00:00
Jb Audras
dac04be1ef Post WordPress 6.2 Beta 3 version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@55400 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-21 18:04:07 +00:00
Jb Audras
14242e839f WordPress 6.2 Beta 3.
git-svn-id: https://develop.svn.wordpress.org/trunk@55399 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-21 17:22:04 +00:00
Sergey Biryukov
31e3936075 Docs: Document default values for optional parameters in various DocBlocks.
Props paulkevan, costdev, audrasjb, SergeyBiryukov.
See #56792.

git-svn-id: https://develop.svn.wordpress.org/trunk@55398 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-21 16:37:03 +00:00
Timothy Jacobs
ef89c31cce 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@55397 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-21 15:57:36 +00:00
Jb Audras
683bba1b2d 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@55396 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-21 15:53:10 +00:00
Tonya Mork
64466d3c35 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@55395 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-21 15:26:10 +00:00
Jb Audras
910a76f5c2 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@55394 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-21 14:50:49 +00:00
Sergey Biryukov
64d6d5d479 Tests: Remove duplicate DocBlock opening characters in tests/theme/wpTheme.php.
Follow-up to [814/tests], [904/tests], [50967].

Props mukesh27, costdev.
See #56792.

git-svn-id: https://develop.svn.wordpress.org/trunk@55393 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-21 13:53:11 +00:00
Greg Ziółkowski
30cf035f43 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@55392 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-21 13:06:33 +00:00
Peter Wilson
072274690b 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@55370 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-21 01:47:57 +00:00
Peter Wilson
2a753c1057 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@55369 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-21 01:43:33 +00:00
Tonya Mork
cdcbfd19f4 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@55368 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-20 21:11:57 +00:00
Sergey Biryukov
cd1228df78 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@55367 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-20 16:03:17 +00:00