Workaround `wp_img_tag_add_decoding_attr()` potentially breaking JavaScript and JSON data by limiting the addition of the decoding attribute to image tags using unescaped double quoted attributes `src` attributes.
Props rodricus, TimothyBlynJacobs, joelmadigan, mw108, adamsilverstein, flixos90, desrosj, mukesh27.
Fixes#56969.
Built from https://develop.svn.wordpress.org/trunk@54802
git-svn-id: http://core.svn.wordpress.org/trunk@54354 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Ensure the `menu-item-has-children` class is added to sub-menu items when `wp_nav_menu()` is called with the `depth` parameter specified to a non-zero value.
Follow up to [54478].
Props davidvongries, fpodhorsky, hellofromTonya, innovext, larsmqller, LeonidasMilossis, mattkeys, mukesh27, nuvoPoint, ocean90, outrankjames, petitphp, SergeyBiryukov, sippis, webmandesign.
Fixes#56946.
See #28620.
Built from https://develop.svn.wordpress.org/trunk@54801
git-svn-id: http://core.svn.wordpress.org/trunk@54353 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Here's what it does:
* Do not load and parse `theme-i18n.json` schema if the theme does not have a `theme.json` file.
* Fix the variable caching layer around the theme's `theme.json` parsing so that a parent's theme `theme.json` is cached as well.
* Do not run a `WP_Query` for global styles for a user when the theme does not have a `theme.json`.
In a basic WordPress setup, this changeset improves `wp_head` execution time for classic themes by 10%, and overall response time for both block themes and classic themes by 4%. This may seem like a small win, but 4% reduced overall response time is actually quite a bit for one change, and it is worth mentioning that this is just one of several other little performance tweaks which are being worked on to improve performance of `theme.json` parsing further.
Props flixos90, manuilov, oandregal, peterwilsoncc, spacedmonkey.
Fixes#56945.
Built from https://develop.svn.wordpress.org/trunk@54799
git-svn-id: http://core.svn.wordpress.org/trunk@54351 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In [53874] the optional `$locale` parameter was added to `load_textdomain()`. While most `load_textdomain()` calls in core were were updated, some were missed. Passing the original locale avoids the need to call `determine_locale()` by `load_textdomain()` which is used as a fallback.
Props ocean90, swissspidy, desrosj.
See #57060.
Built from https://develop.svn.wordpress.org/trunk@54797
git-svn-id: http://core.svn.wordpress.org/trunk@54349 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Due to auto-increment, when running various test groups or classes separately, in this case running all of the tests under `phpunit/tests/multisite/` by including the `--filter Tests_Multisite` parameter, it is entirely possible for the blog ID 42 to actually exist, making the test's assumption incorrect.
By using `PHP_INT_MAX` instead, we can avoid a collision with a fixture of another test.
Follow-up to [31157].
See #56793.
Built from https://develop.svn.wordpress.org/trunk@54791
git-svn-id: http://core.svn.wordpress.org/trunk@54343 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Resolves a fatal error due to `get_template_hierarchy()` due to incompatible older Gutenberg versions.
[54269] introduced this new function for 6.1. The function was introduced in Gutenberg 13.9.0. However, it was not guarded to protect the plugin from when the function was loaded in Core. Gutenberg 14.1.0 added the `function_exists()` guard to protect the plugin from the fatal error.
Minimum compatible version:
This commit changes the Gutenberg minimum compatible version number to 14.1. For versions older than 14.1, the plugin will deactivate when upgrading Core to 6.1 or newer.
Function rename:
Past commits renamed the upgrade function by changing Core's version number. This commit renames the function to be generic, i.e. `_upgrade_core_deactivate_incompatible_plugins()` and adopts the `@since [reason]` strategy to track historical changes to the function.
Follow-up to [54269], [52199], [52166], [52165], [51180].
Props namithjawahar, hellofromTonya, azaozz, desrosj, ironprogrammer.
Fixes#56985.
Built from https://develop.svn.wordpress.org/trunk@54789
git-svn-id: http://core.svn.wordpress.org/trunk@54341 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Prevent term `NOT EXISTS` queries causing `redirect_canonical()` to throw a fatal error in PHP 8 and above, or a warning in earlier versions.
This ensures the `tax_query`'s `terms` property both exists and is countable before attempting to count it.
Props codesdnc, SergeyBiryukov, kadamwhite, costdev, miguelaxcar.
Fixes#55955.
Built from https://develop.svn.wordpress.org/trunk@54785
git-svn-id: http://core.svn.wordpress.org/trunk@54337 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Revert to legacy database query in `get_pages_by_title()`. Due to the lack of `orderby` clause in the previous database query, it is not possible to gain consistent results by converting the function to a `WP_Query` wrapper.
Reverts [54271, 54242, 54234].
Props Bjorn2404, 10upsimon, dilipbheda, mukesh27, spacedmonkey, TimothyBlynJacobs, rjasdfiii, stentibbing, pbiron, pento.
Fixes#57039, #56991.
See #57041.
Built from https://develop.svn.wordpress.org/trunk@54782
git-svn-id: http://core.svn.wordpress.org/trunk@54334 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset fixes the `$preload_paths` parameter type for `block_editor_rest_api_preload()` and related hooks. This parameter expects an array of strings OR an array where the path is the first element (index 0) of this array.
Props chouby.
Fixes#56810.
See #56792.
Built from https://develop.svn.wordpress.org/trunk@54776
git-svn-id: http://core.svn.wordpress.org/trunk@54328 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Re-order the link pseudo classes to follow the long term LoVe (F)HA rule when set via `theme.json`.
In order that the CSS cascade behaves in a predictable manner, it's recommended that the selectors follow the order `:visited`, `:focus`/`:hover`, `:active`. As order affects the specificity, this ensures the interaction states override the visited states. CSS specificity is really quite beautiful, although complex.
Props mikachan, sabernhardt, davidbaumwald, mukesh27, Mamaduka, desrosj.
Fixes#56928.
Built from https://develop.svn.wordpress.org/trunk@54774
git-svn-id: http://core.svn.wordpress.org/trunk@54326 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Ensure only full post objects are passed to `update_post_author_caches()` when called within `WP_Query::the_post()`. This prevents an error when starting the Loop for Queries initiated with a subset of fields or IDs only.
Props konyoldeath, dd32, lozula, TimothyBlynJacobs, spacedmonkey, mxbclang, peterwilsoncc.
Fixes#56948.
Built from https://develop.svn.wordpress.org/trunk@54771
git-svn-id: http://core.svn.wordpress.org/trunk@54323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Change `orderby` clause used within `WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles` to `date` to match the `WP_Query` documentation for the parameter.
Props miguelaxcar, johnbillion, JeffPaul, spacedmonkey, mxbclang, mukesh27.
Fixes#56900.
Built from https://develop.svn.wordpress.org/trunk@54770
git-svn-id: http://core.svn.wordpress.org/trunk@54322 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `wp_max_upload_size()` function can be expensive to call, especially for large sites or multisites. For the frontend usage of `get_default_block_editor_settings()` knowing the allowed upload size is typically unnecessary.
This changeset adds a condition so that `wp_max_upload_size()` is only called if the current user can actually `upload_files`. It keeps the data present when it is actually needed while avoiding the execution overhead when it is not needed.
Props janthiel, Clorith, flixos90, spacedmonkey.
Fixes#56815.
Built from https://develop.svn.wordpress.org/trunk@54769
git-svn-id: http://core.svn.wordpress.org/trunk@54321 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Bypass caching within `WP_Query` when the `SELECT` clause has been modified via a filter. This prevents both cache key collisions and the returning of incomplete or unexpected results when the `SELECT` clause has been modified by an extender.
Props pypwalters, claytoncollie, johnwatkins0, TimothyBlynJacobs, costdev, spacedmonkey, peterwilsoncc.
Fixes#57012.
Built from https://develop.svn.wordpress.org/trunk@54768
git-svn-id: http://core.svn.wordpress.org/trunk@54320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In #55594 user meta caching was enabled by default when making a `WP_User_Query`. Previously, this was only enabled if a developer specifically queried for 'all_with_meta'
fields. User meta caching is implemented using a pluggable function, `cache_users`. If a plugin runs a `WP_User_Query` before pluggable functions have been defined, this
will now cause a fatal error.
In this commit, a `function_exists` check is introduced to avoid calling `cache_users` if it's not defined. Additionally, a `_doing_it_wrong` notice is issued if the
`WP_User_Query::query` method is called before the 'plugins_loaded' hook.
Props carazo, subrataemfluence, oakesjosh, spacedmonkey, obenland, SergeyBiryukov, peterwilsoncc.
Fixes#56952.
Built from https://develop.svn.wordpress.org/trunk@54766
git-svn-id: http://core.svn.wordpress.org/trunk@54318 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The previous iteration of the test passed when run in isolation but failed when running the whole test suite.
Restoring the `switch_to_blog()` call allows the test to pass again pending a deeper investigation.
Follow-up to [54760].
See #57023.
Built from https://develop.svn.wordpress.org/trunk@54762
git-svn-id: http://core.svn.wordpress.org/trunk@54314 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Reduce some of the clutter in `tests/multisite/site.php` and introduce `tests/multisite/updateBlogStatus.php`. Tests moved over are verbatim at this point.
Follow-up to [1078/tests], [29916], [30784], [30785], [33253].
See #56793.
Built from https://develop.svn.wordpress.org/trunk@54757
git-svn-id: http://core.svn.wordpress.org/trunk@54309 1a063a9b-81f0-0310-95a4-ce76da25c4cd
According to the docs in developer.wordpress.org/reference/classes/wp_term_query/query WP_Term_Query:->query( string|array $query ) returns WP_Term[]|int[]|string[]|string, and we were using an inexistent object property terms making it always empty and look like the taxonomy did not exist.
Props mamaduka, mikachan, ockham, franz00.
See #56902.
Built from https://develop.svn.wordpress.org/trunk@54751
git-svn-id: http://core.svn.wordpress.org/trunk@54303 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Includes:
* Fixing a few typos.
* Using the correct format for multi-line comments.
* Removing some comments that duplicate the assertion messages without providing any additional context.
Follow-up to [54478].
See #56792.
Built from https://develop.svn.wordpress.org/trunk@54741
git-svn-id: http://core.svn.wordpress.org/trunk@54293 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When uploading artifacts during GitHub Action workflows, all files uploaded to an artifact name are zipped. When a ZIP file is uploaded, the result is a horrifying state of ZIP-ception.
This changes the workflow to upload all of the needed theme files to the artifact instead of a singular ZIP file created prior to uploading.
This also fixes a bug where ZIP files generated have the desired theme nested within `src/wp-content/themes` instead of just containing the theme files.
Props ndiego, wildworks, desrosj, bgardner, colorful-tones.
Fixes#56898.
Built from https://develop.svn.wordpress.org/trunk@54740
git-svn-id: http://core.svn.wordpress.org/trunk@54292 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset removes `role="img"` attribute from two decorative images: despite being hidden to assistive technologies using `aria-hidden="true"`, automated tools still understand them as images and expect alternative texts.
Props viralsampat, sabernhardt, audrasjb, ryokuhi, elifvish.
Fixes#56824.
Built from https://develop.svn.wordpress.org/trunk@54739
git-svn-id: http://core.svn.wordpress.org/trunk@54291 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When using `'%%%s%%'` pattern with `$wpdb->prepare()`, it works on 6.0.3 but does not on 6.1-RC. Why? The inserted value is wrapped in quotes on 6.1-RC5 whereas it is not on <= 6.0.3.
With 6.1 final release tomorrow, more time is needed to further investigate and test. Reverting this changeset to restore the previous behavior.
This commit also adds a dataset for testing the `'%%%s%%'` pattern.
Props SergeyBiryukov, hellofromTonya, bernhard-reiter, desrosj, davidbaumwald, jorbin.
Fixes#56933.
See #52506.
Built from https://develop.svn.wordpress.org/trunk@54733
git-svn-id: http://core.svn.wordpress.org/trunk@54285 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Link the image and text to the new 6.1 release video on youtube. The video is currently private, but will be made public during the release party.
Props admwgn, critterverse, joen, annezazu, jpantani, laurlittle, cbringmann, kellychoffman, pablohoney, EidolonNight.
See #56357.
Built from https://develop.svn.wordpress.org/trunk@54729
git-svn-id: http://core.svn.wordpress.org/trunk@54281 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset replaces a link to the outdated W3C specs on Custom Elements with a link to the corresponding WhatWG specification.
Previously committed in [53205], this appears to be accidentally reverted in [53562].
Follow-up to [53204], [53205], [53562].
Props audrasjb.
See #56792.
Built from https://develop.svn.wordpress.org/trunk@54727
git-svn-id: http://core.svn.wordpress.org/trunk@54279 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In the tests for updating a theme via Ajax, `wp_installing( true )` is called to prevent `wp_update_themes()` from running.
This worked as expected in `test_update_theme()`, however, it was missed in `test_uppercase_theme_slug()`, which was accidentally relying on the `wp_installing()` status not being properly restored in the previous test.
Now that the `wp_installing()` status was corrected in [54723], the latter test started throwing an error on PHP 8.2:
{{{
1) Tests_Ajax_wpAjaxUpdateTheme::test_uppercase_theme_slug
http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated
/var/www/src/wp-includes/Requests/Transport/cURL.php:345
/var/www/src/wp-includes/Requests/Transport/cURL.php:135
/var/www/src/wp-includes/class-requests.php:381
/var/www/src/wp-includes/class-wp-http.php:395
/var/www/src/wp-includes/class-wp-http.php:615
/var/www/src/wp-includes/http.php:179
/var/www/src/wp-includes/update.php:719
/var/www/src/wp-admin/includes/ajax-actions.php:4292
/var/www/src/wp-includes/class-wp-hook.php:308
/var/www/src/wp-includes/class-wp-hook.php:332
/var/www/src/wp-includes/plugin.php:517
/var/www/tests/phpunit/includes/testcase-ajax.php:265
/var/www/tests/phpunit/tests/ajax/wpAjaxUpdateTheme.php:157
}}}
Replicating the `wp_installing()` status changes in this test too resolves the error.
Follow-up to [38168], [38710], [54722], [54723].
See #56793.
Built from https://develop.svn.wordpress.org/trunk@54725
git-svn-id: http://core.svn.wordpress.org/trunk@54277 1a063a9b-81f0-0310-95a4-ce76da25c4cd
A recent change to how WOFF files are processed in PHP 8.2 RC3 has caused a new test failure.
The tests was previously skipped on PHP 8.2, however, apparently after a `fileinfo` extension update, it started failing on PHP 8.1 too.
This commit adjusts the skipping condition to include PHP 8.1.
Follow-up to [54508], [54509].
See #56817.
Built from https://develop.svn.wordpress.org/trunk@54724
git-svn-id: http://core.svn.wordpress.org/trunk@54276 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In the tests for updating a plugin or theme via Ajax, `wp_installing( true )` was called to prevent `wp_update_plugins()` or `wp_update_themes()` from running.
Since the subsequent `wp_installing( false )` call was in the same `try { ... }` block, it could not be executed if an exception was thrown, affecting other tests.
In this case, after rearranging the Ajax tests in [54722], this started affecting the `get_site_option()` calls in the tests for `wp_ajax_wp_compression_test()`.
By moving both `wp_installing()` calls out of the `try`/`catch` block, we can ensure the status is correctly restored.
Follow-up to [734/tests], [37150], [38168], [38710], [54722].
See #56793.
Built from https://develop.svn.wordpress.org/trunk@54723
git-svn-id: http://core.svn.wordpress.org/trunk@54275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This was previously used to delete the users created during `wpSetUpBeforeClass()`, however that now happens automatically in `WP_UnitTestCase_Base::tear_down_after_class()` via `_delete_all_data()`.
Follow-up to [35311], [37404], [38398].
See #56793.
Built from https://develop.svn.wordpress.org/trunk@54720
git-svn-id: http://core.svn.wordpress.org/trunk@54272 1a063a9b-81f0-0310-95a4-ce76da25c4cd
As the tests belong to either the `ms-excluded` or the `ms-required` group, the skipping should not be necessary.
While these methods were initially intended to be used in conjunction with the respective group, the PHPUnit configuration files for single site and multisite exclude these groups as appropriate, so calling these methods explicitly is no longer required.
Follow-up to [40520], [40543], [40564], [43005], [46683], [53011].
See #56793.
Built from https://develop.svn.wordpress.org/trunk@54719
git-svn-id: http://core.svn.wordpress.org/trunk@54271 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This was previously removed in [51870] and appears to be accidentally readded in [53561].
As the test belongs to the `ms-excluded` group, the skipping is unnecessary and does not affect anything in practice.
Follow-up to [46693], [49835], [51870], [53561].
See #56793.
Built from https://develop.svn.wordpress.org/trunk@54718
git-svn-id: http://core.svn.wordpress.org/trunk@54270 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This aims to bring some consistency to the location of category function tests, as well as to make the tests more discoverable and easier to expand.
Follow-up to [28438], [28566], [31006], [31025], [37464], [28438], [31299], [36988], [42364], [42367], [42368], [46413], [53684].
See #56793.
Built from https://develop.svn.wordpress.org/trunk@54717
git-svn-id: http://core.svn.wordpress.org/trunk@54269 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This aims to bring some consistency to the location of pluggable function tests.
Includes:
* Renaming the test class to better reflect the intention of the tests.
* Adding a `@coversNothing` tag to the class DocBlock.
Follow-up to [34126], [53478], [54702].
Props pbearne, SergeyBiryukov.
See #56793, #56782.
Built from https://develop.svn.wordpress.org/trunk@54716
git-svn-id: http://core.svn.wordpress.org/trunk@54268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Based on feedback from network storage configurations there was a noticed slowdown due to the usage of the `path_join()` function. This needs more time to find a workaround.
Follow-up to [53934].
Props mreishus, SergeyBiryukov, desrosj, mikeschroder.
Reverts [53934].
See #56924.
Built from https://develop.svn.wordpress.org/trunk@54712
git-svn-id: http://core.svn.wordpress.org/trunk@54264 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This change removes caching of global styles for logged in users, allowing "wp_global_styles" custom post type to be imported completely, regardless of any previously cached data. This change now relies on the lower-level native `WP_Query` cache invalidation methods for the global styles post type.
Follow-up to [52275], [54186].
Props anariel-design, bernhard-reiter, andrewserong, spacedmonkey, andraganescu, peterwilsoncc, oandregal, hellofromTonya.
Fixes#56901.
Built from https://develop.svn.wordpress.org/trunk@54706
git-svn-id: http://core.svn.wordpress.org/trunk@54258 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This change ensures custom styles for all third-party blocks are rendered on the front end if assets are set to be loaded on a per-block basis. Additionally, this change includes new unit tests to help prevent a similar bug in the future.
Props scruffian, aristath, poena, wildworks, ajlende, andraganescu, ndiego, gigitux, cbravobernal, ramonopoly, andrewserong, oandregal, hellofromTonya, bernhard-reiter.
Fixes#56915.
Built from https://develop.svn.wordpress.org/trunk@54703
git-svn-id: http://core.svn.wordpress.org/trunk@54255 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This introduces a GitHub Action workflow that performs the following steps for default themes:
- Test installing npm dependencies and running the build script (for relevant themes).
- Create ZIP files for the .org Theme directory and uploads them as workflow artifacts.
The workflow will only run on limited occasions, one of those being when Twenty Nineteen, Twenty Twenty, or Twenty Twenty-One is edited. These are the themes with build scripts that need to be tested for issues.
It can also be manually run through the GitHub Actions UI for occasions when the ZIP files are needed for a release.
Props peterwilsoncc, desrosj
Fixes#56898.
Built from https://develop.svn.wordpress.org/trunk@54699
git-svn-id: http://core.svn.wordpress.org/trunk@54251 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This aims to clarify that "Site Address (URL)" is a required field that should not be left blank, whether or not the site home page is intended to be different from the WordPress installation directory.
Follow-up to [1203], [3058], [5093], [5141], [13750], [41986].
Props digical, sabernhardt.
Fixes#50629.
Built from https://develop.svn.wordpress.org/trunk@54689
git-svn-id: http://core.svn.wordpress.org/trunk@54241 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In [54358], styling for Button blocks that had been removed from classic themes was reintroduced. However, it was added with a global scope, whereas editor styles are usually added with a `.editor-styles-wrapper` selector, which makes them more specific.
This change modifies the way that classic theme styles are added so that they also get wrapped in an `.editor-styles-wrapper` selector to match specificity.
Furthermore, adjust specificity for some Button block related styling in the editor for the Twenty Twelve and Twenty Twenty themes.
Merges [https://github.com/WordPress/gutenberg/pull/44731 Gutenberg PR 44731] into trunk.
Follow-up to [54358].
Props scruffian, cbravobernal, sabernhardt, audrasjb.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54687
git-svn-id: http://core.svn.wordpress.org/trunk@54239 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Introduce `WP_Query::generate_cache_key()` for generating the cache key used by the main database query.
This removes the need for a filter to test that cache keys do not include the WPDB placeholder causing unreachable cache keys. The tests now call `WP_Query::generate_cache_key()` directly.
The filter `wp_query_cache_key` is removed as a hard deprecation. The filter was not included in a stable release.
Follow up to [54634].
Props spacedmonkey, jorbin, azaozz, hellofromtonya, mukesh27, peterwilsoncc, desrosj, audrasjb, adamsilverstein, flixos90, davidbaumwald, joedolson, sergeybiryukov.
Fixes#56802.
Built from https://develop.svn.wordpress.org/trunk@54685
git-svn-id: http://core.svn.wordpress.org/trunk@54237 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When a ruleset error is encountered during a PHPCodeSniffer scan, an XML report is not generated and `cs2pr` will exit with a `0`.
In this situation, a workflow run will be marked as passing (even though a failure has occurred) due to the presence of `continue-on-error`.
This adjusts the logic in the Coding Standards and PHP Compatibility workflows to remove the need for the `continue-on-error` option and ensures all failures are accurately reflected within the GitHub Actions UI.
Follow up to [54371].
Props jrf, TobiasBg.
See #55652.
Built from https://develop.svn.wordpress.org/trunk@54678
git-svn-id: http://core.svn.wordpress.org/trunk@54230 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This resolves a bug in Featured Image blocks where `object-fit` was being removed during the `render_callback`.
Props raduiason, pbiron, kebbet, SergeyBiryukov, bernhard-reiter, ironprogrammer, xknown, audrasjb, ckanderson22, ivanjeronimo, seriouslysenpai.
Fixes#56855.
Built from https://develop.svn.wordpress.org/trunk@54675
git-svn-id: http://core.svn.wordpress.org/trunk@54227 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This removes the dynamic aspect of the `createWorkflowDispatch()` call that dispatches a Failed Workflow run when another workflow encounters an issue.
By hardcoding `trunk` as the `ref`, the version of the workflow used will always be the latest, most up to date. This ensures older branches receive the bug fixes and improvements made in `trunk` without having to backport them.
See #55652.
Built from https://develop.svn.wordpress.org/trunk@54674
git-svn-id: http://core.svn.wordpress.org/trunk@54226 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When using the `CUSTOM_TAGS` constant, these global variables should be set to arrays:
* `$allowedposttags`
* `$allowedtags`
* `$allowedentitynames`
* `$allowedxmlentitynames`
This commit aims to improve developer experience by displaying a more helpful message to explain a PHP fatal error further in the code if any of these globals are either not set or not an array.
Note Using `CUSTOM_TAGS` is not recommended and should be considered deprecated. The `wp_kses_allowed_html` filter is more powerful and supplies context.
Follow-up to [832], [834], [2896], [13358], [21796], [28845], [43016], [48072].
Props doctorlai, pento, KnowingArt_com, bosconiandynamics, TJNowell, ironprogrammer, audrasjb, mukesh27, SergeyBiryukov.
Fixes#47357.
Built from https://develop.svn.wordpress.org/trunk@54672
git-svn-id: http://core.svn.wordpress.org/trunk@54224 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In `register_block_type`, continue to allow passing arrays as the `editor_script`, `script`, `view_script`, `editor_style`, and `style` arguments. Note that those fields were soft-deprecated in favor of their `_handles` counterparts in [54155], which would allow specifying multiple items. At the same time, the deprecated fields were limited to `string` or `null`.
However, this broke existing code that passed an array as one of those arguments. For backwards compatibility, this change thus restores the previous behavior. It is implemented in `WP_Block_Type` as a pair of `__get()` and `__set()` methods that wrap around the corresponding `_handles` members, which are arrays of strings.
It also affects the REST API endpoint for block types. The latter’s schema has never allowed for anything other than `string` or `null` for any of those fields. For this reason, it now returns the first element of the array stored in the corresponding `_handles` member in `WP_Block_Type`.
Follow-up [54155].
Props nendeb55, costdev, gziolo, spacedmonkey, mukesh27, sergeybiryukov, audrasjb.
Fixes#56707.
Built from https://develop.svn.wordpress.org/trunk@54670
git-svn-id: http://core.svn.wordpress.org/trunk@54222 1a063a9b-81f0-0310-95a4-ce76da25c4cd
`WP_Textdomain_Registry` was introduced in [53874] to store text domains and their language directory paths, addressing issues with just-in-time loading of textdomains when using locale switching and when using`load_*_textdomain()` functions.
Said change has inadvertently caused a performance regression exactly when using`load_*_textdomain()`, which still often is the case, where the cached information was not further used or even overridden.
This change addresses that issue by storing the default languages paths in a separate way, while at the same time making `WP_Textdomain_Registry` easier to maintain and adding new tests to catch future regressions.
Props flixos90, spacedmonkey, ocean90, SergeyBiryukov, costdev.
Fixes#39210.
Built from https://develop.svn.wordpress.org/trunk@54669
git-svn-id: http://core.svn.wordpress.org/trunk@54221 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When used inline, the SVG needs the `aria-hidden`, `focusable`, and `viewBox` properties for accessibility. Additionally, this optimizes the SVG by using `cirlce` elements in place of `path`, and removing `clipPath`. There is no visible change, but the file is now one-third the size.
Props sabernhardt.
See #56703, #56357.
Built from https://develop.svn.wordpress.org/trunk@54662
git-svn-id: http://core.svn.wordpress.org/trunk@54214 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This updates the third-party action used to post a welcome message to pull requests opened by first time contributors.
This release updates the action to use Node.js version 16 instead of 12, the latter of which support has been deprecated for in GitHub Action runners.
The action has also changed from `bukboo/welcome-action` to `wow-action/welcome`.
See #56793.
Built from https://develop.svn.wordpress.org/trunk@54651
git-svn-id: http://core.svn.wordpress.org/trunk@54203 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `save-state` and `set-output` commands have been deprecated in GitHub Actions. This removes all occurrences of the command within workflow steps.
This will not remove all deprecated notices from workflow summaries (some third-party actions still contain instances of these commands and need to be fixed upstream), but it will fix the notices caused by custom workflow code.
See #56820.
Built from https://develop.svn.wordpress.org/trunk@54649
git-svn-id: http://core.svn.wordpress.org/trunk@54201 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit:
* Adds default minimum font size limits so that min font size, where provided, does not become smaller than `14px`/`0.875rem`/`0.875em`.
* For font sizes of `< 14px` that have no defined minimum sizes, uses the font size to set the floor of the `clamp()` value.
This bugfix prevents converting existing small font sizes to clamp values that will reduce their font size even further in narrow widths. It therefore improves backward compatibility and accessibility.
Original PR from Gutenberg repository:
* [https://github.com/WordPress/gutenberg/pull/44993#44993 Fluid typography: add font size constraints]
Follow-up to [54260], [54360], [54497], [54500].
Props ramonopoly, andrewserong, isabel_brison, Joen, bernhard-reiter.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54646
git-svn-id: http://core.svn.wordpress.org/trunk@54198 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The [https://make.wordpress.org/core/2021/02/19/feature-plugin-rollback-update-failure/ Rollback Update Failure feature project] creates a temporary backup of plugins and themes before updating. This aims to make the update process more reliable and ensure that if a plugin or theme update fails, the previous version can be safely restored.
If the [https://wordpress.org/plugins/rollback-update-failure/ Rollback Update Failure plugin] is installed, `WP_Upgrader::install_package()` will use the `move_dir()` function from there for better performance. Instead of copying a directory from one location to another, it uses the `rename()` PHP function to speed up the process, which is instrumental in creating a temporary backup without a delay. If the renaming failed, it falls back to `copy_dir()` WP function.
This conditional aims to facilitate broader testing of the feature. It is temporary, until the plugin is merged into core.
Follow-up to [53578], [54484].
Props afragen, pbiron, costdev, davidbaumwald, audrasjb, jrf, SergeyBiryukov.
See #56057.
Built from https://develop.svn.wordpress.org/trunk@54643
git-svn-id: http://core.svn.wordpress.org/trunk@54195 1a063a9b-81f0-0310-95a4-ce76da25c4cd
[54080] refactored the logic in `get_network_option()`, `update_network_option()` and `delete_network_option()` to use the metadata API. However, this change resulted in issues with large multisite installs that utilize memcached having network options > 1MB in size.
This change reverts [54080] and all related follow-up changes.
Reverts [54080], [54081], and [54082]. Partially reverts [54267] and [54402].
Props pavelschoffer, rebasaurus, johnbillion, spacedmonkey, desrosj, rinatkhaziev.
Fixes#56845.
See #37181.
Built from https://develop.svn.wordpress.org/trunk@54637
git-svn-id: http://core.svn.wordpress.org/trunk@54189 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The logic for sending the `X-Pingback` header for single posts that allow pings was recently moved from `WP::handle_404()` to a more appropriate place in `WP::send_headers()`.
To check whether pings are open for a particular post, that logic relies on the `$wp_query` global, which is declared in `WP::handle_404()`, but not in `WP::send_headers()`
This commit ensures that `$wp_query` is globalized in `WP::send_headers()` too, so that the check works as expected.
Follow-up to [54250].
Props strategio, sabernhardt, dlh, davidbaumwald, SergeyBiryukov.
Fixes#56840.
Built from https://develop.svn.wordpress.org/trunk@54636
git-svn-id: http://core.svn.wordpress.org/trunk@54188 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Add in missing links and fix incorrect copy. Remove the "header & footer patterns" section. Fix the icons in the feature grid. Add images using temporary links for now. Update the header artwork for About, Credits, Freedoms, and Privacy.
See #56357.
Reviewed by audrasjb.
Props courane01, bph, webcommsat, audrasjb, dansoschin, richtabor.
Built from https://develop.svn.wordpress.org/trunk@54635
git-svn-id: http://core.svn.wordpress.org/trunk@54187 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Remove escape placeholder from query cache key, as placeholders are a based on a unique id on every request. This means that it is impossible for a cache to be reused, making queries that use escape placeholders such as `LIKE` searches, unable to be cached.
Props dhl, spacedmonkey, peterwilsoncc, desrosj, chaion07, davidbaumwald, mukesh27.
Fixes#56802.
Built from https://develop.svn.wordpress.org/trunk@54634
git-svn-id: http://core.svn.wordpress.org/trunk@54186 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit adds a unit test to check that `WP_Theme_JSON_Resolver::get_theme_data()` returns a `WP_Theme_JSON` object, and that an `add_theme_support()` call overrides the settings from `theme.json`.
Follow-up to [54443], [54493].
Props cbravobernal.
Fixes#56835.
Built from https://develop.svn.wordpress.org/trunk@54630
git-svn-id: http://core.svn.wordpress.org/trunk@54182 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This applies to:
* `$block_name` in `strip_core_block_namespace()`
* `$allowed_html` in `filter_block_content()`
* `$pagination_type` in `get_comments_pagination_arrow()`
Follow-up to [46896], [48794], [53138], [54181].
Props rakibwordpress, ironprogrammer, sabernhardt, SergeyBiryukov.
Fixes#56596.
Built from https://develop.svn.wordpress.org/trunk@54520
git-svn-id: http://core.svn.wordpress.org/trunk@54075 1a063a9b-81f0-0310-95a4-ce76da25c4cd
After running `phpunit --filter test_import_theme_starter_content`, the following files were generated and left in place in the version-controlled `DIR_TESTDATA` directory, resulting in a dirty working copy of the project:
{{{
tests/phpunit/data/images/canola-150x150.jpg
tests/phpunit/data/images/canola-300x225.jpg
}}}
In the test, `canola.jpg` is mocked as an **existing attachment**. When the test invokes `WP_Customize_Manager::import_theme_starter_content()`, existing attachments are passed directly to `wp_generate_attachment_metadata()`, which does not make a copy of the file, and `wp_create_image_subsizes()` creates the above referenced files in the original image's location.
By contrast, `waffles.jpg`, also used in the test, is **not** set as an existing attachment, and in `import_theme_starter_content()` is passed to `media_handle_sideload()`, which makes a **copy** of the file in the `wp-content/uploads/` directory, and then calls `wp_create_image_subsizes()` against the new file. The resulting sub-sizes are generated in that location, and are cleaned up during `tear_down()`.
The test's `tear_down()` uses `remove_added_uploads()`, which only clears items created in `wp-content/uploads/` (i.e. `waffles*.jpg`), but not the files in the `DIR_TESTDATA` directory (`canola-*.jpg`).
This commit addresses the issue by creating a copy of the file in uploads. This better matches the intention of the test, as existing attachments will most likely be located in uploads and not in an arbitrary path like the test data directory.
Follow-up to [39276], [39346], [39411], [40142], [54424], [54425].
Props ironprogrammer, audrasjb, boniu91, dariak, SergeyBiryukov.
Fixes#56807.
Built from https://develop.svn.wordpress.org/trunk@54519
git-svn-id: http://core.svn.wordpress.org/trunk@54074 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The previous implementation of checking whether the `args` parameter is an array of arrays used `array_filter()`, which would always loop the full array, even though we are only interested in finding one (the first) non-array to display a `_doing_it_wrong()` message.
This commit aims to improve readability and performance of this check by using a `foreach` loop instead, leaving it as soon as the first non-array argument is found.
Follow-up to [54339].
Props TobiasBg, audrasjb, costdev, SergeyBiryukov.
Fixes#56804.
Built from https://develop.svn.wordpress.org/trunk@54518
git-svn-id: http://core.svn.wordpress.org/trunk@54073 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In the WordPress 6.1 cycle, WP_Theme_JSON_Resolver::get_merged_data method has become a hot path that is called many times. By improving small things that are repeated multiple times, we get more performance wins.
This commit reduces the number of calls of the low-level WP_Theme_JSON->merge method, with the corresponding performance improvements.
Props oandregal, aristath, mukeshpanchal27.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54517
git-svn-id: http://core.svn.wordpress.org/trunk@54072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
A recent change to how WOFF files are processed in PHP 8.2 RC3 has caused a new test failure.
This temporarily marks the `test_wp_check_filetype_and_ext_with_filtered_woff()` test skipped until a deeper analysis can be performed.
Props SergeyBiryukov, jrf, desrosj, oandregal.
See #56817.
Built from https://develop.svn.wordpress.org/trunk@54508
git-svn-id: http://core.svn.wordpress.org/trunk@54067 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The newly introduced filters are renamed to use the `wp_theme_json_data{$context}` structure:
* `theme_json_default` renamed to `wp_theme_json_data_default`
* `theme_json_theme` renamed to `wp_theme_json_data_theme`
* `theme_json_blocks` renamed to `wp_theme_json_data_blocks`
* `theme_json_user` renamed to `wp_theme_json_data_user`
The following new filter gets the `wp_` prefix added:
* `theme_json_get_style_nodes` renamed to `wp_theme_json_get_style_nodes`
Follow-up to [56467], [54183], [54118].
Props kebbet, desrosj, mukesh27, ocean90, sergeybiryukov, davidbaumwald, hellofromTonya.
Fixes#56796.
Built from https://develop.svn.wordpress.org/trunk@54501
git-svn-id: http://core.svn.wordpress.org/trunk@54060 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This is the start of the WordPress 6.1 about page, introducing new content and a first pass of the new style.
Props adampickering, joen, iamarinoh, dansoschin, desrosj, ryelle, cbringmann, annezazu, priethor, laurlittle, eidolonnight, jeffpaul, sabernhardt, ndiego, richtabor, spacedmonkey, marybaum, abhanonstopnewsuk, courane01, tweetythierry, adamsilverstein, flixos90, ironprogrammer.
See #56357.
Built from https://develop.svn.wordpress.org/trunk@54499
git-svn-id: http://core.svn.wordpress.org/trunk@54058 1a063a9b-81f0-0310-95a4-ce76da25c4cd
A check is added to verify if the block's `'attrs'` key exists before accessing it. If no, it defaults to an empty array.
How was this found?
WP 6.1 removed the attributes from the `core/page-list` block. When this block is being processed by `WP_Block_Supports::apply_block_supports()`, the key `'attrs'` does not exist in `self::$block_to_render`.
This commit includes a tiny micro-optimization by moving this line of code after the existing guard clause. Why? If the guard clause is triggered, the method bails out early, meaning the attributes code is not used. By moving it after the guard clause, it saves a tiny bit of memory and processing if this happens.
Follow-up to [49310], [54399].
Props petitphp, spacedmonkey, hellofromTonya.
Fixes#56799.
Built from https://develop.svn.wordpress.org/trunk@54498
git-svn-id: http://core.svn.wordpress.org/trunk@54057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
`WP_Query` methods assume that `get_queried_object()` would return a non-null value, which is not always the case.
This commit resolves various warnings in `WP_Query` along the lines of:
{{{
Attempt to read property "post_type" on null in wp-includes/class-wp-query.php on line 4338
}}}
Follow-up to [1728], [3639], [8807], [49119].
Props dd32, yellyc, boonebgorges, darkskipper, Howdy_McGee, swissspidy, nacin, mikeschroder, mikejolley, sterlo, datainterlock, utsavmadaan823, kanlukasz, woji29911, hellofromTonya, zikubd, deksar, bwbama, noplanman, nouarah, SergeyBiryukov.
Fixes#29660.
Built from https://develop.svn.wordpress.org/trunk@54496
git-svn-id: http://core.svn.wordpress.org/trunk@54055 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This replaces calls to the deprecated jQuery `.bind()` method with `.on()` in Plupload's `handlers.js`.
Reference: [https://api.jquery.com/bind/ jQuery API Documentation: .bind()]
Follow-up to [18482], [19266], [50001], [50270], [50367], [50383], [50410], [50420], [50429], [50627], [51947], [52429].
Props eclev91, ipajen, sarahricker.
See #51812.
Built from https://develop.svn.wordpress.org/trunk@54495
git-svn-id: http://core.svn.wordpress.org/trunk@54054 1a063a9b-81f0-0310-95a4-ce76da25c4cd
[54445] updated the new dynamic template name functions used by the site editor in 6.1 to use `WP_Query` and `WP_Term_Query` instances in place of `get_posts` and `get_terms` respectively. However, the latter functions return an array of results whereas `WP_Query` instances store their found results in a class property. This change updates the code to reference either `$posts_query->posts` or `$terms_query->terms` where necessary.
Follow-up to [54280], [54333], [54370], [54388], and [54445].
Props bernhard-reiter, spacedmonkey, davidbaumwald.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54494
git-svn-id: http://core.svn.wordpress.org/trunk@54053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
A significant performance regression was added late in WP 6.1 beta cycle when some of the existing caching for `theme.json` processing was removed. The rationale for removing the caching was this code was now used before all the blocks are registered (aka get template data, etc.) and resulted in stale cache that created issues (see [https://github.com/WordPress/gutenberg/issues/44434 Gutenberg Issue 44434] and [https://github.com/WordPress/gutenberg/issues/44619 Gutenberg Issue 44619]). The changes were limited to only reads from the file system. However, it introduced a big impact in performance.
This commit adds caching and checks for blocks with different origins. How? It add caching for the calculated data for core, theme, and user based on the blocks that are registered. If the blocks haven't changed since the last time they were calculated for the origin, the cached data is returned. Otherwise, the data is recalculated and cached.
Essentially, this brings back the previous cache, but refreshing it when the blocks change.
It partially adds unit tests for these changes. Additional tests will be added.
References:
* [https://github.com/WordPress/gutenberg/issues/44772 Performance regression in WP 6.1 for theme.json processing]
Follow-up to [54251], [54399].
Props aristath, oandregal, bernhard-reiter, spacedmonkey, hellofromTonya.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54493
git-svn-id: http://core.svn.wordpress.org/trunk@54052 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In coordination with the release of 6.1, a new version of each bundled theme will also be released. This bumps the version of each theme to the following:
- Twenty Ten: 3.7
- Twenty Eleven: 4.2
- Twenty Twelve: 3.8
- Twenty Thirteen: 3.7
- Twenty Fourteen: 3.5
- Twenty Fifteen: 3.3
- Twenty Sixteen: 2.8
- Twenty Seventeen: 3.1
- Twenty Nineteen: 2.4
- Twenty Twenty: 2.1
- Twenty Twenty-One: 1.7
- Twenty Twenty-Two: 1.3
Additionally, this audits all `$version` parameters for `wp_(enqueue|register)_(script|style)` calls, ensuring accurate last edited or theme version values for proper caching and cache busting.
Props robinwpdeveloper, desrosj, mukesh27.
Fixes#56450.
Built from https://develop.svn.wordpress.org/trunk@54492
git-svn-id: http://core.svn.wordpress.org/trunk@54051 1a063a9b-81f0-0310-95a4-ce76da25c4cd
For backward compatibility, the `user_id` parameter of `wp_new_comment()` can be spelled as `user_ID`, and plugins utilizing the `preprocess_comment` filter or the `comment_post` action should be able to receive both variations.
Follow-up to [12267], [12300], [28915], [36038], [53729].
Props peterwilsoncc, SergeyBiryukov.
Fixes#56244.
Built from https://develop.svn.wordpress.org/trunk@54489
git-svn-id: http://core.svn.wordpress.org/trunk@54048 1a063a9b-81f0-0310-95a4-ce76da25c4cd
If an invalid post ID is passed to the function, `comments_open()` should return `false`, and no comment form be displayed. This commit restores the previous behavior that was unintentionally changed when standardizing on the `$post` parameter name.
Follow-up to [53715].
Props peterwilsoncc.
Fixes#56243.
Built from https://develop.svn.wordpress.org/trunk@54488
git-svn-id: http://core.svn.wordpress.org/trunk@54047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In [54182], the configuration for the old preference persistence system was removed. This system is still used for block usage data (to show the most frequently used blocks in the inserter). Furthermore some plugins may use this persistence system.
This changeset reinstates the previous persistence system used by the "Most used blocks" feature in the block inserter.
Follow-up to [54182].
Props talldanwp.
Fixes#56778.
Built from https://develop.svn.wordpress.org/trunk@54485
git-svn-id: http://core.svn.wordpress.org/trunk@54044 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset fixes a potential fatal error, for example when "Max upload file size" setting is set to an empty value. It also adds unit tests for `upload_size_limit_filter`.
Props mjkhajeh, bhrugesh12, SergeyBiryukov, kebbet, audrasjb, felipeelia.
Fixes#55926.
Built from https://develop.svn.wordpress.org/trunk@54482
git-svn-id: http://core.svn.wordpress.org/trunk@54041 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is a follow-up to [54133] for new classes introduced in WordPress 6.1 since the previous commit.
Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0.
There are a number of ways to mitigate this:
* If it is an accidental typo for a declared property: fix the typo.
* For known properties: declare them on the class.
* For unknown properties: add the magic `__get()`, `__set()`, et al. methods to the class or let the class extend `stdClass` which has highly optimized versions of these magic methods built in.
* For unknown ''use'' of dynamic properties, the `#[AllowDynamicProperties]` attribute can be added to the class. The attribute will automatically be inherited by child classes.
Trac ticket #56034 is open to investigate and handle the third and fourth type of situations, however it has become clear this will need more time and will not be ready in time for WP 6.1.
To reduce “noise” in the meantime, both in the error logs of WP users moving onto PHP 8.2, in the test run logs of WP itself, in test runs of plugins and themes, as well as to prevent duplicate tickets from being opened for the same issue, the `#[AllowDynamicProperties]` attribute has been added to all “parent” classes in WP.
Reference: [https://wiki.php.net/rfc/deprecate_dynamic_properties PHP RFC: Deprecate dynamic properties].
Follow-up to [53922], [54133].
Props jrf.
See #56513, #56034.
Built from https://develop.svn.wordpress.org/trunk@54481
git-svn-id: http://core.svn.wordpress.org/trunk@54040 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit moves the tests for recommended versions of dependencies referenced in `readme.html` to a new location for better context. Also updates test class name for clarity, and `@covers` annotations to `@coversNothing`.
Follow-up to [26166], [33946], [35172], [52418], [52424].
Props ironprogrammer, bbobnis, antonvlasenko, azaozz, chaion07, priyomukul.
Fixes#45867.
Built from https://develop.svn.wordpress.org/trunk@54479
git-svn-id: http://core.svn.wordpress.org/trunk@54038 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset prevents `wp_nav_menu` last level menu items from having the `.menu-item-has-children` class when the `$depth` argument is used. It adds a loop in `wp_nav_menu()` to calculate the depth of each menu item with children to make sure the class is added only when applicable.
Props slobodanmanic, kucrut, iCaspar, mdgl, petitphp, audrasjb, costdev.
Fixes#28620.
Built from https://develop.svn.wordpress.org/trunk@54478
git-svn-id: http://core.svn.wordpress.org/trunk@54037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This ensures that sending a password reset link works as expected if the user's login and email were initially the same, but the email address was subsequently updated and no longer matches the login, which is still set to the old address.
Follow-up to [6643], [18513], [19056], [37474], [50129], [50140].
Props donmhico, pbearne, azouamauriac, boblindner, daxelrod, audrasjb, SergeyBiryukov.
Fixes#53634.
Built from https://develop.svn.wordpress.org/trunk@54477
git-svn-id: http://core.svn.wordpress.org/trunk@54036 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset fixes a warning where `strip_tags()` expected its first parameter to be a string rather than an array. It contains the following changes:
- Removal of sanitize_callback to allow the REST API to handle the validation natively, this also causes the proper error to be output for `?slug[0][1]=2` that it's an invalid value.
- Ensure that `wp_parse_list()` only returns a single-dimensioned array, even if passed a multi-dimension array, which fits the functions expected use case and resolves warnings in code that expects the function to return a single-dimensioned array.
Props dd32, TimothyBlynJacobs.
Fixes#55838.
Built from https://develop.svn.wordpress.org/trunk@54476
git-svn-id: http://core.svn.wordpress.org/trunk@54035 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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