This commit adds block-level settings in the core. Block level settings allow a block to define the preset settings of its nested blocks using the same shape as theme.json.
Props oandregal, Mamaduka, jorgefilipecosta, dmsnell, adamziel.
57651 #57651.
Built from https://develop.svn.wordpress.org/trunk@55255
git-svn-id: http://core.svn.wordpress.org/trunk@54788 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset introduces a new filter for `wp_save_post_revision()`. `wp_save_post_revision_revisions_before_deletion` passes the revisions to be considered for deletion, and the new revision's post ID.
This allows extenders to exclude specific revisions from being considered for deletion.
Props jhned, costdev, audrasjb, adamsilverstein, mukesh27.
Fixes#57320.
Built from https://develop.svn.wordpress.org/trunk@55254
git-svn-id: http://core.svn.wordpress.org/trunk@54787 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In [47938] the `wp_cache_get_multiple` function was added to core. This function allows for multiple cache keys to be received from cache in a single function call. `wp_queue_posts_for_term_meta_lazyload` function does many calls to cache. To get taxonomy relationship for multiple posts and get all terms. Replace calls to `get_object_term_cache` with calls to `wp_cache_get_multiple` and `_prime_term_caches`. This improves performance on sites that implement the `wp_cache_get_multiple` in their object caching drop-in.
Props spacedmonkey, ocean90, SergeyBiryukov, costdev, flixos90, joemcgill, 10upsimon.
Fixes#57150.
Built from https://develop.svn.wordpress.org/trunk@55252
git-svn-id: http://core.svn.wordpress.org/trunk@54785 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset improves the way quotation marks are handled in the Playlist template.
Follow-up to [27239], [33643 ].
Props hvar, Presskopp, sabernhardt, james-roberts, arrasel403, abidhasan112, robinwpdeveloper, costdev, mukesh27.
Fixes#50865.
Built from https://develop.svn.wordpress.org/trunk@55251
git-svn-id: http://core.svn.wordpress.org/trunk@54784 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Previously, the `s` argument of the `WP_Query::parse_query()` method searched the `post_title`, `post_excerpt`, and `post_content` fields, with no way of controlling this apart from using the `posts_search` filter and adjusting the SQL manually. This changeset adds the ability to specify which fields are searched when performing a query, using the `search_columns` argument.
Props johnbillion, birgire, petitphp, audrasjb, costdev, mukesh27.
Fixes#43867.
Built from https://develop.svn.wordpress.org/trunk@55248
git-svn-id: http://core.svn.wordpress.org/trunk@54781 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In addition to all the packages being updated to the latest versions,
this commit also includes some mandatory changes to avoid editor breakage:
- Update React to to 18.2.0.
- Add the right stylesheets to support iframed block editors.
Props ntsekouras, mamaduka, flixos90, desrosj, peterwilsoncc.
See #57471.
Built from https://develop.svn.wordpress.org/trunk@55246
git-svn-id: http://core.svn.wordpress.org/trunk@54779 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Check the input of `wp_strip_all_tags()` before passing it to `strip_tags()`. This protects against fatal errors introduced in PHP 8, retaining the `E_USER_WARNING` from PHP 7, and prevents a PHP 8.1 deprecation notice when passing null.
Props chocofc1, costdev, jrf, dd32, audrasjb, peterwilsoncc.
Fixes#56434.
Built from https://develop.svn.wordpress.org/trunk@55245
git-svn-id: http://core.svn.wordpress.org/trunk@54778 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The emoji feature detection that occurs on every page load by default has been broken at least since [45769], causing the feature detection to fail for browsers that in fact support emoji correctly. This has led to the `wp-emoji-release.min.js` file being loaded unnecessarily even in modern browsers, which accounts for roughly 4.7 KB of extra JavaScript on every page load.
This changeset fixes the feature detection, by using the correct sequences of char codes.
Props sergiomdgomes, dmsnell, peterwilsoncc.
Fixes#57301.
Built from https://develop.svn.wordpress.org/trunk@55241
git-svn-id: http://core.svn.wordpress.org/trunk@54774 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset adds a `block_theme` entry in the theme cache data, similar to the existing entries `headers`, `errors`, `stylesheet`, and `template`.
Props spacedmonkey, costdev, joemcgill, flixos90, mukesh27, adamsilverstein.
Fixes#57114.
Built from https://develop.svn.wordpress.org/trunk@55236
git-svn-id: http://core.svn.wordpress.org/trunk@54769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit includes the latest updates WP_Theme_JSON_Resolver class made in the block editor. Some of these updates improve the performance of the class.
Props Mamaduka, hellofromTonya, flixos90, jorgefilipecosta, oandregal, spacedmonkey, audrasjb, costdev, scruffian.
Closes#57545.
Built from https://develop.svn.wordpress.org/trunk@55231
git-svn-id: http://core.svn.wordpress.org/trunk@54764 1a063a9b-81f0-0310-95a4-ce76da25c4cd
If the `clear_working` flag in `WP_Upgrader::install_package()` is false, the source should not be removed, so `copy_dir()` should be used instead.
Partial updates, like language packs, may want to retain the destination. If the destination exists or has contents, this may be a partial update, and the destination should not be removed, so `copy_dir()` should be used instead.
Follow-up to [55204], [55219], [55220], [55223], [55226].
Props afragen, costdev, swissspidy.
See #57557.
Built from https://develop.svn.wordpress.org/trunk@55229
git-svn-id: http://core.svn.wordpress.org/trunk@54762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset ensures text color changes on Pullquote block are reflected on both front-end and in the editor.
Props umesh84, audrasjb, sabernhardt, bgoewert, ruchirj, amitbarai013, robinwpdeveloper, shamayel007.
Fixes#56006.
Built from https://develop.svn.wordpress.org/trunk@55228
git-svn-id: http://core.svn.wordpress.org/trunk@54761 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Correctly instantiate `WP_Error()` within `move_dir()` to prevent a fatal error when unable to delete an existing directory that is intended to be replaced.
Follow-up to [55204], [55219], [55220], [55223].
Props swissspidy, costdev, afragen.
Fixes#57375.
Built from https://develop.svn.wordpress.org/trunk@55226
git-svn-id: http://core.svn.wordpress.org/trunk@54759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Intentional preloading of Requests 2.x classes and interfaces using their old (Requests 1.x) names should not produce deprecation notices.
This commit defines `REQUESTS_SILENCE_PSR0_DEPRECATIONS` as `true` in `_preload_old_requests_classes_and_interfaces()`.
Follow-up to [54997], [55007], [55046].
Props costdev, afragen, jrf.
Fixes#54504.
Built from https://develop.svn.wordpress.org/trunk@55225
git-svn-id: http://core.svn.wordpress.org/trunk@54758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This is a follow-up to [55161] to rename `::get_current_locale()` to `::get_switched_locale()` and `::get_current_user_id()` to `::get_switched_user_id()` for improved clarity.
Also:
* Fix docblock for `switch_locale` filter. The User ID is `false` if missing, not `null`.
* Add additional test involving `restore_previous_locale()` and improve test cleanup.
And most importantly: happy birthday ocean90! 🎂
Props johnjamesjacoby, ocean90.
See #57123.
Built from https://develop.svn.wordpress.org/trunk@55224
git-svn-id: http://core.svn.wordpress.org/trunk@54757 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Revert [55169] and mark #56689 as wontfix. `get_page_by_path` can not use `WP_Query`, as is results in fatel errors for those using `get_page_by_path` in the `pre_get_posts` action or `posts_pre_query` filter. This sadly means that `WP_Query` can never be used in `get_page_by_path`.
Props spacedmonkey, iandunn, mukesh27, joemcgill, adamsilverstein, otto42.
See #56689.
Built from https://develop.svn.wordpress.org/trunk@55215
git-svn-id: http://core.svn.wordpress.org/trunk@54748 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset improves the consistency in capitalization of fetching and outputting of request headers. It also updates occurrences found in some docblocks.
Props johnjamesjacoby, costdev, audrasjb, petitphp, mhkuu, SergeyBiryukov.
Fixes#54225.
Built from https://develop.svn.wordpress.org/trunk@55210
git-svn-id: http://core.svn.wordpress.org/trunk@54743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
On some servers, consecutive periods in a filename can cause a 403 Forbidden response.
This changeset replaces consecutive periods with a single period, and adds related unit tests.
Props ArtZ91, costdev, SergeyBiryukov, arthurshlain, mukesh27.
Fixes#57242.
Built from https://develop.svn.wordpress.org/trunk@55209
git-svn-id: http://core.svn.wordpress.org/trunk@54742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Formally deprecate `get_page_by_title()`. In its current form the function is unpredictable in that it may return a result that leads to a 404 error and will return different results depending on the database version/engine combination used.
It is recommended developers use `WP_Query` instead:
{{{
$query = new WP_Query(
array(
'post_type' => 'page',
'title' => 'Sample Page',
)
);
}}}
Props TimothyBlynJacobs, costdev, mukesh27, spacedmonkey, peterwilsoncc.
Fixes#57041.
Built from https://develop.svn.wordpress.org/trunk@55207
git-svn-id: http://core.svn.wordpress.org/trunk@54740 1a063a9b-81f0-0310-95a4-ce76da25c4cd