This avoids an `Undefined array key 0` PHP warning for `current_user_can()` capability checks that require a specific object to check against but an object ID was not passed.
A `_doing_it_wrong()` notice is also added, so that developers and site administrators are aware that the capability mapping is failing in the absence of the required object ID.
The list of mapped capabilities that require an object ID:
* `delete_post` / `delete_page`
* `edit_post` / `edit_page`
* `read_post` / `read_page`
* `publish_post`
* `edit_(post|comment|term|user)_meta` / `delete_*_meta` / `add_*_meta`
* `edit_comment`
* `edit_term` / `delete_term` / `assign_term`
Follow-up to [34091], [34113], [47178].
Props jeherve, peterwilsoncc, henry.wright, johnbillion, mattheweppelsheimer, hellofromTonya, JeffPaul, azouamauriac, Ninos Ego, TobiasBg, wpsmith, GaryJ, nacin, johnstonphilip, azaozz, SergeyBiryukov.
Fixes#44591.
git-svn-id: https://develop.svn.wordpress.org/trunk@53408 602fd350-edb4-49c9-b593-d223f7449a82
Reverts changes from [53155] to ensure backward compatibility.
Companion to Gutenberg changes https://github.com/WordPress/gutenberg/pull/40818. That makes sure that patterns registered with `admin_init` or `current_screen` hooks are not lost.
Props jsnajdr, zieladam, peterwilsoncc, johnstonphilip.
See #55567.
git-svn-id: https://develop.svn.wordpress.org/trunk@53404 602fd350-edb4-49c9-b593-d223f7449a82
Included cherry-picked commits from the Gutenberg plugin that fix bugs discovered after WordPress 6.0 RC 2.
Props zieladam, ndiego.
See #55567.
git-svn-id: https://develop.svn.wordpress.org/trunk@53403 602fd350-edb4-49c9-b593-d223f7449a82
This fixes an issue where the password hide/show button was misaligned when creating a new user on small screens.
Props kebbet.
Fixes#55558.
git-svn-id: https://develop.svn.wordpress.org/trunk@53401 602fd350-edb4-49c9-b593-d223f7449a82
When called too early, conditional query tags should throw a `_doing_it_wrong()` notice and return `false`. This commit verifies that behavior not only for `is_main_query()`, but for all the other conditional tags too.
Follow-up to [16947], [17068], [17083], [18699], [37985], [53395].
See #55104.
git-svn-id: https://develop.svn.wordpress.org/trunk@53396 602fd350-edb4-49c9-b593-d223f7449a82
This avoids a PHP fatal error and triggers a `_doing_it_wrong()` notice if `is_main_query()` is called too early, bringing consistency with all the other `is_*()` conditionals: `is_single()`, `is_home()`, etc.
Follow-up to [16947], [17068], [17083], [18699], [37985].
Props vdankbaar, nhadsall, johnbillion, costdev, thijsoo, teunvgisteren, timkersten655, SergeyBiryukov.
Fixes#55104.
git-svn-id: https://develop.svn.wordpress.org/trunk@53395 602fd350-edb4-49c9-b593-d223f7449a82
This replaces the references to “MySQL” with “your host’s database server” on the “Error establishing a database connection” page when Multisite could not be loaded. The generic “database server” term can refer to MySQL or MariaDB. Additionally, this brings some consistency with a similar error message in `wpdb::db_connect()`.
Follow-up to [52367], [52423].
Props tj692, hansjovisyoast, tobifjellner.
Fixes#55701.
git-svn-id: https://develop.svn.wordpress.org/trunk@53394 602fd350-edb4-49c9-b593-d223f7449a82
This change removes the default `title` attribute of category links returned by `wp_list_categories()`, for better accessibility.
Props just0nequestion, joyously, andrija, audrasjb, sabernhardt.
Fixes#55530.
See #24766.
git-svn-id: https://develop.svn.wordpress.org/trunk@53392 602fd350-edb4-49c9-b593-d223f7449a82
This makes the spelling more consistent with other instances of the word in core.
Follow-up to [23844], [27676].
Props NekoJonez, mukesh27, SergeyBiryukov.
Fixes#55661.
git-svn-id: https://develop.svn.wordpress.org/trunk@53391 602fd350-edb4-49c9-b593-d223f7449a82
Backport of the remaining Comment Template block tests from Gutenberg:
* `assertEquals()` replaced with `assertSameSetsWithIndex()`.
* assertion's argument order changed to ensure expected and then actual.
Follow-up to [53353], [53298], [53172], [53138].
Props bernhard-reiter.
Fixes#55708.
git-svn-id: https://develop.svn.wordpress.org/trunk@53388 602fd350-edb4-49c9-b593-d223f7449a82
This updates the panel to match the 6.0 About page styles, with the 6.0 graphic changing color based on the selected admin color scheme.
Props fcoveram, critterverse, joedolson, SergeyBiryukov.
Fixes#55532.
git-svn-id: https://develop.svn.wordpress.org/trunk@53383 602fd350-edb4-49c9-b593-d223f7449a82
Switch the images to use the s.w.org CDN. Update the font style and spacing on the About page. Update the header images for Credits, Freedoms, and Privacy.
Props fcoveram, peterwilsoncc, SergeyBiryukov.
Fixes#55434.
git-svn-id: https://develop.svn.wordpress.org/trunk@53382 602fd350-edb4-49c9-b593-d223f7449a82
Includes cherry-picked commit from the Gutenberg plugin that fix a bug discovere just before WordPress 6.0 RC 2.
Props hellofromtonya, zieladam, kebbet.
See #55567.
git-svn-id: https://develop.svn.wordpress.org/trunk@53378 602fd350-edb4-49c9-b593-d223f7449a82
Included cherry-picked commits from the Gutenberg plugin that fix bugs discovere after WordPress 6.0 RC 1.
Props zieladam, ndiego, hellofromtonya.
See #55567.
git-svn-id: https://develop.svn.wordpress.org/trunk@53377 602fd350-edb4-49c9-b593-d223f7449a82
This is a defensive coding measure that aims to reduce confusion. With this change, `$pieces` is explicitly used for the names, and `$clauses` for the values of the clauses.
Follow-up to [52974], [53175], [53370], [53375].
Props peterwilsoncc.
See #55699.
git-svn-id: https://develop.svn.wordpress.org/trunk@53376 602fd350-edb4-49c9-b593-d223f7449a82
This is a defensive coding measure that aims to reduce confusion. With this change, `$pieces` is explicitly used for the names, and `$clauses` for the values of the clauses.
Follow-up to [52974], [53175], [53370].
Props peterwilsoncc.
See #55699.
git-svn-id: https://develop.svn.wordpress.org/trunk@53375 602fd350-edb4-49c9-b593-d223f7449a82
Replace error suppressing in `wp_filesize()` with a `file_exists()` check before calling the native PHP `filesize()` function.
Follow up to [52837].
Props Cybr, johnbillion, spacedmonkey, antpb, azouamauriac, ironprogrammer, mukesh27, costdev, audrasjb, dlh.
Fixes#55678.
See #49412.
git-svn-id: https://develop.svn.wordpress.org/trunk@53372 602fd350-edb4-49c9-b593-d223f7449a82
Since this is an admin template function and the tests check for specific output with certain taxonomy parameters, placing the tests along with other tests for the functions in the same file should make them easier to find and extend than when placed between general taxonomy registration tests.
Follow-up to [52841], [53368].
See #55652.
git-svn-id: https://develop.svn.wordpress.org/trunk@53371 602fd350-edb4-49c9-b593-d223f7449a82
This addresses a backward compatibility break where `posts_join_request` and other filters were applied, but their results were subsequently discarded and earlier values were used instead.
Follow-up to [52974], [53175].
Props 5um17, johnbillion, SergeyBiryukov.
Fixes#55699.
git-svn-id: https://develop.svn.wordpress.org/trunk@53370 602fd350-edb4-49c9-b593-d223f7449a82
Additional tests to ensure taxonomies show in the quick/bulk edit froms based on the `show_in_quick_edit` setting rather than the the `show_ui` setting.
Follow up to [52841,31307].
Props figureone, costdev, audrasjb.
Fixes#49701.
git-svn-id: https://develop.svn.wordpress.org/trunk@53368 602fd350-edb4-49c9-b593-d223f7449a82
Add inline comment to `WP_Scripts::do_item()` explaining why the definition of a text domain prevents concatenation.
Follow up to [53360].
Fixes#55628.
Props SergeyBiryukov.
git-svn-id: https://develop.svn.wordpress.org/trunk@53366 602fd350-edb4-49c9-b593-d223f7449a82
This ensures that parameter names for PHP polyfills in WordPress core 100% match the native PHP parameter names. Otherwise using named parameters with those functions could cause fatal errors for installs where the polyfills kick in.
This commit:
* Renames the `$string` parameter to `$message` in `_()` polyfill.
* Renames the `$str` parameter to `$string` in `mb_substr()` and `mb_strlen()` polyfills.
* Renames the `$raw_output` parameter to `$binary` in `hash_hmac()` polyfill.
* Renames the `$a` and `$b` parameters to `$known_string` and `$user_string` in `hash_equals()` polyfill.
* Renames the `$var` parameter to `$value` in `is_countable()` and `is_iterable()` polyfills.
* Renames the `$arr` parameter to `$array` in `array_key_first()` and `array_key_last()` polyfills.
Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270], [53271], [53272], [53273], [53274], [53275], [53276], [53277], [53281], [53283], [53284], [53285], [53287], [53364].
Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55650.
git-svn-id: https://develop.svn.wordpress.org/trunk@53365 602fd350-edb4-49c9-b593-d223f7449a82
While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.
This commit renames the `$parent` parameter to `$parent_page` in `parent_dropdown()`.
Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270], [53271], [53272], [53273], [53274], [53275], [53276], [53277], [53281], [53283], [53284], [53285], [53287].
Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55650.
git-svn-id: https://develop.svn.wordpress.org/trunk@53364 602fd350-edb4-49c9-b593-d223f7449a82
Restore behaviour of `fields` parameter in `WP_User_Query` to allow developers to specify any database field to be returned either individually or as part of a subset. Add these fields to the documentation.
When a subset of `fields` includes the `id` paramater, include it in the results in both upper and lowercase to maintain backward compatibility.
Follow up to [53327].
Props dd32, pbearne, kraftbj, peterwilsoncc.
Fixes#53177.
git-svn-id: https://develop.svn.wordpress.org/trunk@53362 602fd350-edb4-49c9-b593-d223f7449a82
Prevent concatenation of scripts if the text domain is defined to ensure the dependency order is respected.
This accounts for an edge case in which replacing a core script via a plugin and a lack of translations (eg, for a US English site) could cause the JavaScript files to be ordered incorrectly.
Follow up to [52937].
Props audrasjb, boniu91, chaion07, costdev, hellofromtonya, jsnajdr, mukesh27, ndiego, ugyensupport.
Fixes#55628.
git-svn-id: https://develop.svn.wordpress.org/trunk@53360 602fd350-edb4-49c9-b593-d223f7449a82
The `amd64/mysql` and `amd64/mariadb` official images from Docker are compatible with x86 running on the ARM64v8 architecture of M1 machines.
Props afragen, justinahinon, desrosj, talldanwp, antonvlasenko, gziolo, aristath, johnbillion
Fixes#52356
git-svn-id: https://develop.svn.wordpress.org/trunk@53358 602fd350-edb4-49c9-b593-d223f7449a82
This avoids a test failure if the list of supported WordPress versions is updated before the trunk version is bumped for a new major release.
Follow-up to [47403], [53347].
Fixes#55667.
git-svn-id: https://develop.svn.wordpress.org/trunk@53357 602fd350-edb4-49c9-b593-d223f7449a82
Backport of 2 tests from Gutenberg for the Comment Template block:
* test line and paragraph breaks are converted into HTML tags.
* test rendering of unapproved comment preview.
Follow-up to [53298], [53172], [53138].
Props bernhard-reiter, darerodz, gziolo, peterwilsoncc, hellofromTonya.
Fixes#55643.
See #55634.
git-svn-id: https://develop.svn.wordpress.org/trunk@53353 602fd350-edb4-49c9-b593-d223f7449a82
Rename `#inline-edit-legend` to avoid duplicate HTML IDs. These have been renamed `#quick-edit-legend` and `#bulk-edit-legend` for the quick and bulk editors respectively.
This HTML ID is not required by the quick editor duplicated via JavaScript so is removed as part of the duplication process.
Follow up to [53096].
Props azaozz, costdev, greglone, hellofromtonya, ironprogrammer, joedolson, sabernhardt.
Fixes#55575.
See #35483.
git-svn-id: https://develop.svn.wordpress.org/trunk@53352 602fd350-edb4-49c9-b593-d223f7449a82
This ensures that `WP_UnitTestCase::skipOnAutomatedBranches()` has access to the `GITHUB_REF` and `GITHUB_EVENT_NAME` variables, so that some tests can be skipped when appropriate.
Additionally, account for renaming the `master` branch to `trunk` in November 2021.
Follow-up to [40241], [46999], [49264], [49267], [51868].
Fixes#55668.
git-svn-id: https://develop.svn.wordpress.org/trunk@53349 602fd350-edb4-49c9-b593-d223f7449a82
After subtracing `0.1` from a `X.1` current version, the result was a single digit without the `.0` decimal. Using `number_format()` ensures each current version has a decimal before appending the `.x` before the test.
This commit also reverts [55346] which was a temporary workaround.
Follow-up to [55346], [47403].
Fixes#55667.
git-svn-id: https://develop.svn.wordpress.org/trunk@53347 602fd350-edb4-49c9-b593-d223f7449a82
This is the start of the WordPress 6.0 about page, introducing new content and a first pass of the new style.
Props fcoveram, estelaris, JeffPaul, critterverse, chanthaboune, dansoschin, webcommsat, annezazu, marybaum, cbringmann, eidolonnight, laurlittle, sergeybiryukov.
See #55434.
git-svn-id: https://develop.svn.wordpress.org/trunk@53339 602fd350-edb4-49c9-b593-d223f7449a82
Included cherry-picked commits from the Gutenberg plugin that fix bugs discovered after WordPress 6.0 Beta 4.
Props gziolo, zieladam, ndiego.
See #55567.
git-svn-id: https://develop.svn.wordpress.org/trunk@53338 602fd350-edb4-49c9-b593-d223f7449a82