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