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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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