This changeset prevents object replacement characters – UTF-8 `%ef%bf%bc`, used as a placeholder in text for an otherwise unspecified object – from being added to slugs.
Props cantuaria, costdev, audrasjb, SergeyBiryukov, archon810, maciejmackowiak, BaneD, markparnell, ironprogrammer, dmsnell, nikkigagency, webprom.
Fixes#55117.
Built from https://develop.svn.wordpress.org/trunk@54474
git-svn-id: http://core.svn.wordpress.org/trunk@54033 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset adds better support for plural forms in update admin notices generated on the Themes and Plugins screens. This fixes issues when translating into languages that have more than one plural form, or more complicated rules for singular form usage.
Props ideag, SergeyBiryukov, daledupreez, audrasjb.
Fixes#37287.
Built from https://develop.svn.wordpress.org/trunk@54469
git-svn-id: http://core.svn.wordpress.org/trunk@54028 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `blogger.getUsersBlogs` endpoint does not currently work on Multisite environments which require HTTPS.
This changes `wp_xmlrpc_server::_multisite_getUsersBlogs()` to call the method directly instead of relying on a new `IXR_Client` request, which only supports HTTP.
Props dd32.
Fixes#56492.
Built from https://develop.svn.wordpress.org/trunk@54468
git-svn-id: http://core.svn.wordpress.org/trunk@54027 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Most notably in this update, Twenty Twenty-Three becomes the second default theme to have the “Accessibility Ready” tag.
For a full list of changes being included, see the `twentytwentythree` repository on GitHub: ca662828b7...4ea5d832ec.
Follow up to [54235], [54236], [54312], [54372].
Props mikachan, madhudollu, tahmidulkarim, joen, poena, scruffian, beafialho, colorful-tones, audrasjb, critterverse, luminuu, wildworks, hiyascout, desrosj.
Fixes#56383.
Built from https://develop.svn.wordpress.org/trunk@54467
git-svn-id: http://core.svn.wordpress.org/trunk@54026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset ensures `background-attachment` is set to `scroll` for parallax images when the browser is iOS Safari and the screen is at least 48em (768px) wide. Narrower screens have the default `scroll` value regardless of the browser. It prevents from scaling issues on the images featured on the front page using Twenty Seventeen.
Props JarretC, sabernhardt, mrfoxtalbot, dkotter.
Fixes#48195.
Built from https://develop.svn.wordpress.org/trunk@54450
git-svn-id: http://core.svn.wordpress.org/trunk@54009 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset removes all instances of `_wp_http_referer` variable from the URL when creating a hidden input for `_wp_http_referer`. It prevents the hidden field from having an additional version of `_wp_http_referer` each time the form is submitted.
Props msolution, justinahinon, pbearne, mikeschroder, mukesh27, audrasjb, Clorith, chaion07, robinwpdeveloper, hztyfoon, davidbaumwald, costdev, adamsilverstein.
Fixes#54106.
Built from https://develop.svn.wordpress.org/trunk@54449
git-svn-id: http://core.svn.wordpress.org/trunk@54008 1a063a9b-81f0-0310-95a4-ce76da25c4cd
WordPress has recently introduced a variety of caching API improvements:
* `wp_cache_add_multiple()`
* `wp_cache_set_multiple()`
* `wp_cache_get_multiple()`
* `wp_cache_delete_multiple()`
* `wp_cache_flush_runtime()`
* `wp_cache_flush_group()`
Although WordPress core provides a compatibility layer if these functions are missing from third-party object cache implementations, there should be a method of checking whether the cache backend supports a particular feature.
This commit aims to improve developer experience by allowing third-party object cache plugins to declare a `wp_cache_supports()` function and correctly list their supported features:
* `add_multiple`
* `set_multiple`
* `get_multiple`
* `delete_multiple`
* `flush_runtime`
* `flush_group`
Note: The `wp_cache_supports()` function replaces and supersedes the `wp_cache_supports_group_flush()` function added earlier.
Follow-up to [47938], [47944], [52700], [52703], [52706], [52708], [53763], [53767], [54423].
Props johnjamesjacoby, tillkruess, spacedmonkey, SergeyBiryukov.
Fixes#56605.
Built from https://develop.svn.wordpress.org/trunk@54448
git-svn-id: http://core.svn.wordpress.org/trunk@54007 1a063a9b-81f0-0310-95a4-ce76da25c4cd
As the function can be used in a variety of contexts, the `_screen` suffix may not always be appropriate.
This commit aims to reduce confusion by renaming the newly added `is_login_screen()` function to `is_login()`, which better aligns with `is_admin()` and the related `is_*_admin()` function family.
While it does not save a lot of lines of code, this function aims to save developers some time that would otherwise be spent investigating the most reliable way to determine whether the current request is for the login screen.
Implementation details:
* By checking `wp_login_url()`, the function accounts for custom login locations set via the `login_url` filter.
* By checking `$_SERVER['SCRIPT_NAME']` directly, instead of `did_action( 'login_form_login' )` or `$pagenow` global, the function can work as early as possible, for example in a must-use plugin.
Follow-up to [53884].
Props azaozz.
Fixes#19898. See #56400.
Built from https://develop.svn.wordpress.org/trunk@54447
git-svn-id: http://core.svn.wordpress.org/trunk@54006 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This ensures that not only the return values match the expected results, but also that their type is the same.
Previously committed in [54402], these instances appear to be accidentally reverted to `assertEquals()` in [54443].
Follow-up to [52275], [54162], [54402], [54443].
See #55654.
Built from https://develop.svn.wordpress.org/trunk@54446
git-svn-id: http://core.svn.wordpress.org/trunk@54005 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This change updates `get_(posts|terms)()` to direct `WP_Query` calls and adds additional parameters to each query to improve performance.
Follow-up to [54280], [54333], [54370], and [54388].
Props spacedmonkey, peterwilsoncc.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54445
git-svn-id: http://core.svn.wordpress.org/trunk@54004 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset adds unit test coverage for the following features:
- Gradients
- `filter` (Duotones)
- `blockGap`
- `shadow`
- `useRootPaddingAwareAlignments`
- `appearanceTools`
Props gunterer, johnregan3, audrasjb, mukesh27.
Fixes#56611.
Built from https://develop.svn.wordpress.org/trunk@54443
git-svn-id: http://core.svn.wordpress.org/trunk@54002 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset ensures the directory path is provided in error messages when `_unzip_file_pclzip()` is unable to create a directory. This removes `substr()` which was returning an empty string in some use cases.
Props gunterer, SergeyBiryukov, n8finch, peterwilsoncc, audrasjb, rsiddharth, costdev , desrosj, mukesh27.
Fixes#54477.
Built from https://develop.svn.wordpress.org/trunk@54442
git-svn-id: http://core.svn.wordpress.org/trunk@54001 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The tests use two images that were deleted on teardown and recreated on setup for every single test. This appears to be unnecessary, as the files can instead only be recreated if they are missing, and deleted after the test run is complete.
This commit reduces ~200 redundant file copying operations to ~5 when running this test class.
Follow-up to [38832], [48291], [54424].
See #55652.
Built from https://develop.svn.wordpress.org/trunk@54428
git-svn-id: http://core.svn.wordpress.org/trunk@53987 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The test for `WP_Customizer_Manager::import_theme_starter_content()` creates two attachments that remain in the `uploads` directory after the test run is complete.
This commit follows the approach from `WP_REST_Posts_Controller` tests and utilizes an `$attachments_created` property to track any files uploaded in the current test run and clean them up afterwards.
This makes sure there are no leftover images after the test class is run.
Follow-up to [39276], [39346], [39411], [40142], [53935], [54424].
See #55652.
Built from https://develop.svn.wordpress.org/trunk@54425
git-svn-id: http://core.svn.wordpress.org/trunk@53984 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This was added to avoid creating leftover image sub-sizes in the version-controlled `DIR_TESTDATA` directory.
However, this does not appear to be necessary:
* `WP_Customizer_Manager::import_theme_starter_content()` already [source:tags/6.0.2/src/wp-includes/class-wp-customize-manager.php?marks=1370-1374#L1367 makes a copy of the image] before sideloading, so the test was essentially working with a copy of a copy.
* The images were only used in one test out of 70 and do not need to be copied for every single test.
Upon further investigation, there is also no evidence that creating these copies actually resolved the reported issue:
* `WP_UnitTest_Factory_For_Attachment::create_object()` inserts an attachment, but does not create image sub-sizes.
* `media_handle_sideload()` does create image sub-sizes, but the file is already in the media library by that time, and sub-sizes are created in the `uploads` directory, not in the version-controlled `DIR_TESTDATA` directory.
This commit removes ~140 redundant file copying operations when running the test suite.
Follow-up to [39276], [39346], [39411], [40142].
See #55652.
Built from https://develop.svn.wordpress.org/trunk@54424
git-svn-id: http://core.svn.wordpress.org/trunk@53983 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Since this object cache implementation was added, WordPress has introduced a variety of caching API improvements:
* `wp_cache_add_multiple()`
* `wp_cache_set_multiple()`
* `wp_cache_get_multiple()`
* `wp_cache_delete_multiple()`
Although WordPress core provides a compatibility layer if these functions are missing from third-party object caches, this commit updates the Memcached object cache used in the test suite to implement these new functions directly.
Follow-up to [40561], [47938], [47944], [52700], [52703], [52706], [52708].
Props petitphp, spacedmonkey, tillkruss, SergeyBiryukov.
Fixes#54864.
Built from https://develop.svn.wordpress.org/trunk@54423
git-svn-id: http://core.svn.wordpress.org/trunk@53982 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Ensure that the mime type passed to the `wp_editor_set_quality` filter is correct when the output format is altered with the `image_editor_output_format` filter and the image is saved multiple times, for example when generating sub sizes. Previously, the original image mime type was passed instead of the output type after the initial save.
Props flixos90, peterwilsoncc.
Fixes#56442.
Built from https://develop.svn.wordpress.org/trunk@54417
git-svn-id: http://core.svn.wordpress.org/trunk@53976 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When the output format is altered with the `image_editor_output_format` filter, prefer the image engine that supports both input an output types, falling back to the engine that supports the input type.
Correct an issue where the output format filter wasn't respected because the selected engine didn't support the output format.
Props mikeschroder, ironprogrammer.
Fixes#54476.
Built from https://develop.svn.wordpress.org/trunk@54416
git-svn-id: http://core.svn.wordpress.org/trunk@53975 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This affects:
* `register_block_script_handle()`
* `register_block_style_handle()`
Both functions set a variable with this code:
{{{
$wpinc_path_norm = wp_normalize_path( realpath( ABSPATH . WPINC ) );
}}}
That value never changes during page load, so we can save it to a static variable. By doing so, we can avoid ~200 calls to `realpath()` and `wp_normalize_path()`, or even more if third-party plugins register scripts or styles.
Follow-up to [52291], [52939], [54290], [54291], [54309], [54327].
Props aristath, mukesh27, SergeyBiryukov.
Fixes#56758.
Built from https://develop.svn.wordpress.org/trunk@54415
git-svn-id: http://core.svn.wordpress.org/trunk@53974 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When initially defaulting the screen `$id` in `WP_Screen::get()`, if the `$hook_name` parameter is not supplied, an `else` fallback uses `$GLOBALS['hook_suffix']`. However, in some cases, `hook_suffix` doesn't exist in the global scope. This produces an "Undefined index" notice on < PHP 8, and a warning in >= PHP 8.
This change ensures `$GLOBALS['hook_suffix']` has a value before using it as a fallback for the screen ID.
Props splendorstudio, SergeyBiryukov, htdat, mukesh27, dd32, costdev.
Fixes#49089.
Built from https://develop.svn.wordpress.org/trunk@54414
git-svn-id: http://core.svn.wordpress.org/trunk@53973 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset updates the blocks origin name from core to blocks and adds it to the list of valid origins for `theme.json`.
(See the original fix in [https://github.com//pull/3319 Gutenberg's PR 44363]).
Why?
- This new origin was missing from the list.
- The `core` name is not reflective of what it does, as this data origin is related to block styles, whether they come with WordPress or third-party blocks.
- The existing filter for this piece of data is called `theme_json_blocks`, to reflect it filters "block" data.
- Though `core` origin was used in the past for `default`, this commit reverts it. Why? It was confusing. The goal is to use names that communicate what part of the pipeline are processing (`default > blocks > theme > custom`).
How?
- Renames the string, from `core` to `blocks`.
- Adds `blocks` to the list of valid origins.
- Verifies that the `$theme_json->get_stylesheet()` call uses the proper `$origins` at all times.
Follow-up to [54162], [54251].
Props oandregal, czapla, jorgefilipecosta, scruffian, bernhard-reiter hellofromTonya.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54408
git-svn-id: http://core.svn.wordpress.org/trunk@53967 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `sync-stable-blocks.js` file is used to compile the contents of `require-dynamic-blocks.php`, which includes the PHP files required for dynamic Core blocks.
Since these files define PHP functions, `require_once` should be used instead of `require` to guard against fatal errors.
Follow up to [53688].
Props aristath, SergeyBiryukov, desrosj.
Fixes#56738. See #56179.
Built from https://develop.svn.wordpress.org/trunk@54406
git-svn-id: http://core.svn.wordpress.org/trunk@53965 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Includes:
* Adjusting test method descriptions and comments per the documentation standards.
* Creating image editor class instances directly, instead of calling `wp_get_image_editor()`.
* Cleaning up temporary files before performing assertions, where possible.
* Using more consistent variable names for image editor class instances.
* Reordering some test methods.
Follow-up to [1182/tests], [1188/tests], [27794], [30549], [30990], [31040], [39580], [40123], [49230], [49488], [49542], [49751].
See #55652.
Built from https://develop.svn.wordpress.org/trunk@54401
git-svn-id: http://core.svn.wordpress.org/trunk@53960 1a063a9b-81f0-0310-95a4-ce76da25c4cd