Commit Graph

22254 Commits

Author SHA1 Message Date
hellofromTonya
afa66e5fa0 Build/Test Tools: Fix WP version in package-lock.json.
After [56966], CI jobs that check the `package-lock.json` failed on the "Ensure version-controlled files are not modified or deleted" task.

There are 2 version fields that need to be updated for the new WP version. This changeset updates the "packages" > "version" for 6.5.0.

Follow-up to [56966].

Props swissspidy, benharri.
Unprops hellofromTonya.
Fixes #59665.
Built from https://develop.svn.wordpress.org/trunk@56968


git-svn-id: http://core.svn.wordpress.org/trunk@56479 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-17 20:36:26 +00:00
hellofromTonya
da2e6dc4e3 Fix version number for 6.5-alpha.
Fixes the version number from [56966] to include its number in the version, as it is the commit that opened trunk for 6.5-alpha.

Follow-up to [56966].
Built from https://develop.svn.wordpress.org/trunk@56967


git-svn-id: http://core.svn.wordpress.org/trunk@56478 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-17 18:50:19 +00:00
hellofromTonya
891a9ecdaf Trunk is now 6.5 alpha.
Built from https://develop.svn.wordpress.org/trunk@56966


git-svn-id: http://core.svn.wordpress.org/trunk@56477 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-17 18:41:24 +00:00
hellofromTonya
bfe933241e Post WordPress 6.4 RC1 version bump.
Built from https://develop.svn.wordpress.org/trunk@56964


git-svn-id: http://core.svn.wordpress.org/trunk@56475 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-17 17:46:44 +00:00
hellofromTonya
77df68f144 WordPress 6.4 RC1 - capitalize RC in version.
Capitalize RC in the version, i.e. just in case the build requires it.

Unprops hellofromTonya.
Built from https://develop.svn.wordpress.org/trunk@56963


git-svn-id: http://core.svn.wordpress.org/trunk@56474 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-17 17:27:20 +00:00
hellofromTonya
fc3d3cf491 WordPress 6.4 RC1.
Built from https://develop.svn.wordpress.org/trunk@56962


git-svn-id: http://core.svn.wordpress.org/trunk@56473 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-17 17:19:23 +00:00
hellofromTonya
e395ce0cf6 Editor: Bugfixes npm packages updates for 6.4 RC1.
Updates for needed bugfixes in RC1:

* [https://github.com/WordPress/gutenberg/pull/55212 Image: Reimplement lightbox trigger as a minimal button in corner of image]

* [https://github.com/WordPress/gutenberg/pull/55403 [Edit Widgets] Only suppress admin notices when JS enabled.]

Follow-up to [56849], [56818], [56816].

Props artemiosans, jameskoster, SantosGuillamot, aristath, czapla, joen, afercia, richtabor, peterwilsoncc, andraganescu, hellofromTonya, siobhyb.
See #59411.
Built from https://develop.svn.wordpress.org/trunk@56961


git-svn-id: http://core.svn.wordpress.org/trunk@56472 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-17 16:08:23 +00:00
Bernhard Reiter
c054eef096 Patterns, Templates: Inject theme attr into Template Part blocks.
It was found that Template Part blocks were broken in the Site Editor, showing the `Template part has been deleted or is unavailable` message, due to a missing `theme` attribute.

This bug seems to have been introduced by [56896], whose goal was to only inject that attribute into the markup returned by the templates and patterns REST API endpoints but not on the frontend, in order to improve performance. It has been demonstrated locally that reverting that changeset fixes the bug.

Reverts [56896].
Props mmcalister, swisspidy, thelovelist, hellofromTonya, pbiron, Pauthake015, richtabor, nicolefurlan, huzaifaalmesbah, annezazu, kafleg, aegkr, sunitarai, shresthaaman, andraganescu, onemaggie, gziolo.
Fixes #59629.
Built from https://develop.svn.wordpress.org/trunk@56960


git-svn-id: http://core.svn.wordpress.org/trunk@56471 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-17 15:48:23 +00:00
hellofromTonya
3d5cf30808 Bundled Themes: Revert 56451.
Reverts [56451] to avoid the following issues:

* missing the default `font-size` for anyone who does not use the size control.
* unintentional reduction in citation's `line-height` down to the `--pullquote--line-height` value (1.3 instead of 1.6).

With 6.4 RC1 happening shortly, this revert is necessary to avoid shipping this issues in the release, while giving the time needed to resolve in the next cycle.

Follow-up to [56451].

Props sabernhardt, nicolefurlan.
See #57854.
Built from https://develop.svn.wordpress.org/trunk@56959


git-svn-id: http://core.svn.wordpress.org/trunk@56470 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-17 13:50:21 +00:00
zieladam
5dc3f83a07 Build/Test Tools: Store WordPress.zip for every GitHub Pull Request as a GitHub artifact.
Storing build files enables reusing them in WordPress Playground and ultimately implementing a Pull Request.

Props desrosj, bernhard-reiter
See #59416.


Built from https://develop.svn.wordpress.org/trunk@56958


git-svn-id: http://core.svn.wordpress.org/trunk@56469 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-17 13:42:19 +00:00
desrosj
ceb29562f3 Build/Test Tools: Update build related dependencies.
This updates the following development dependencies to their latest versions:
- `postcss`
- `qunit`
- `sass`
- `webpack`

Additionally, `npm audit fix` has been run.

Fixes #58863.
Built from https://develop.svn.wordpress.org/trunk@56957


git-svn-id: http://core.svn.wordpress.org/trunk@56468 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-17 13:34:27 +00:00
desrosj
4ce3b9978e Build/Test Tools: Update the caniuse-lite database.
This updates the data for the `caniuse-lite` package and runs `grunt precommit:css`.

Fixes #58869.
Built from https://develop.svn.wordpress.org/trunk@56956


git-svn-id: http://core.svn.wordpress.org/trunk@56467 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-17 13:20:23 +00:00
desrosj
ee64273620 Build/Test Tools: Add environment variable for current release.
This adds a global environment variable to the Test old branches workflow to make the supported version more clear and easier to update in the future. This will also make it easier to reference in more places as this workflow grows.

See #58867.
Built from https://develop.svn.wordpress.org/trunk@56955


git-svn-id: http://core.svn.wordpress.org/trunk@56466 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-17 12:44:25 +00:00
Pascal Birchler
9f39b4ea0f Build/Test Tools: Reinstate PUPPETEER_SKIP_DOWNLOAD for most CI workflows.
The `PUPPETEER_SKIP_DOWNLOAD` environment variable is used to prevent Puppeteer from automatically downloading browser binaries.
It was removed in [56926] due to the migration to Playwright. However, because of the QUnit tests, Puppeteer is actually still a dependency.

Until those tests change, we have to keep this environment variable to prevent unnecessary downloads on CI.

Props SergeyBiryukov.
Fixes #59517.
Built from https://develop.svn.wordpress.org/trunk@56954


git-svn-id: http://core.svn.wordpress.org/trunk@56465 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-17 11:29:27 +00:00
Sergey Biryukov
fe3efe9810 HTML API: Scan to end of tag when getting updated HTML output.
When applying updates to HTML, one step was left out in [56941] which updated the position of the end of the current tag. This made it possible to create bookmarks with null or earlier end positions than their start position. This in turn broke the Directive Processor in Gutenberg during the backport of changes from Core into Gutenberg.

In this commit, after applying updates, the HTML document is now scanned fully to the end of the current tag, updating the internal pointer to its end, so that nothing else will be broken or misaligned.

Follow-up to [56941].

Props dmsnell.
Fixes #59643.
Built from https://develop.svn.wordpress.org/trunk@56953


git-svn-id: http://core.svn.wordpress.org/trunk@56464 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-17 10:39:27 +00:00
Sergey Biryukov
41a5f69fde Twenty Nineteen: Correct the required WordPress version in theme headers.
The required version was previously set to two different values:
* 4.7 in the theme's `functions.php` file.
* 4.9.6 in theme headers, because of the `the_privacy_policy_link()` function usage in `footer.php`.

However, as `the_privacy_policy_link()` call is wrapped in a `function_exists()` check, it does not affect the requirements in practice.

This commit aims to correct the discrepancy by updating theme headers to match the actual required WP version.

Follow-up to [43808], [43892].

Props poena, kafleg, felipeelia, audrasjb, huzaifaalmesbah, shailu25, nicolefurlan, oglekler.
Fixes #59557.
Built from https://develop.svn.wordpress.org/trunk@56952


git-svn-id: http://core.svn.wordpress.org/trunk@56463 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-17 09:54:23 +00:00
hellofromTonya
244f676c59 Twenty Twenty-Four: Bugfixes for 6.4 RC1.
Resyncing changes for TT4 into Core.

Changes include:
* Reformatted all the patterns for readability.
* Bugfixes in the markup and improvements on the string translation functions.
* Renaming of some patterns, making them consistent with the content they show and whether they are simple patterns, full-page patterns or patterns meant to replace templates.

Follow-up to [56813], [56764], [56716].

Props richtabor, onemaggie, luminuu, shailu25, dunhakdis, shivashankerbhatta, dajeema, enodekciw, kafleg, viralsampat, glendaviesnz, beafialho, webmandesign, huzaifaalmesbah, gregfuller, benharri.
Fixes #59640.
Built from https://develop.svn.wordpress.org/trunk@56951


git-svn-id: http://core.svn.wordpress.org/trunk@56462 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-17 02:14:24 +00:00
Aaron Jorbin
223c80ef92 Help/About: Update the About page for 6.4.
Also includes updates to the contribute, credits, freedom and privacy pages.

Props luminuu, rmartinezduque, estelaris, jorbin, mukesh27, cbringmann, richtabor, annezazu, nudge, ohia, acirujano, elmastudio, cathibosco1, sereedmedia, markoserb, joen. (Also someone named Allison who I am going to guess is Taylor Alison Swift but has no avatar so I will never know)

Built from https://develop.svn.wordpress.org/trunk@56950


git-svn-id: http://core.svn.wordpress.org/trunk@56461 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-17 02:02:24 +00:00
Peter Wilson
6876d19129 Options, Meta APIs: Prevent saving of invalid timezones.
Prevent the saving of invalid timezone string in to the database on the options pages. If an invalid timezone is submitted it is ignored and the setting remains unchanged.

This prevents a warning or fatal (depending on the PHP version) from being thrown by an invalid timezone setting on the Settings > General page.

Props ankit-k-gupta, costdev, huzaifaalmesbah, mrinal013, nicolefurlan, oglekler.
Fixes #58814.

Built from https://develop.svn.wordpress.org/trunk@56949


git-svn-id: http://core.svn.wordpress.org/trunk@56460 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-16 23:51:24 +00:00
Aaron Jorbin
86be091aba CSS: Run grunt precommit:css to update CSS.
See: #58869.
Props peterwilsoncc.



Built from https://develop.svn.wordpress.org/trunk@56948


git-svn-id: http://core.svn.wordpress.org/trunk@56459 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-16 21:48:24 +00:00
Joe McGill
807517a992 Options, Meta APIs: Delete leftover unit tests.
This is a followup to [56946] to commit the deletion of a leftover PHP Unit file.

See #22192.

Built from https://develop.svn.wordpress.org/trunk@56947


git-svn-id: http://core.svn.wordpress.org/trunk@56458 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-16 20:41:19 +00:00
Joe McGill
9a810ff5bc Options, Meta APIs: Revert update_option changes.
This reverts changes from [56648], [56681], [56717], [56762], [56788], [56797], and [56814] to restore the behavior for `update_option()` and `update_network_option()` to their prior state as of 6.3.X due to the discovery of various backwards compatibility issues found late in the 6.4 release cycle.

Props mukesh27, costdev, flixos90, spacedmonkey, snicco, jrf, joemcgill.
See #22192, #59360.

Built from https://develop.svn.wordpress.org/trunk@56946


git-svn-id: http://core.svn.wordpress.org/trunk@56457 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-16 20:37:23 +00:00
Tammie Lister
8325d334f6 Update editor related npm packages for 6.4 RC1.
The npm packages needed a second part to the update for 6.4 RC1.

Props isabel_brison, andrewserong, jsnajdr, wildworks, joen, mciampini, tyxla, youknowriad, ramonopoly, spacedmonkey, dmsnell, mikachan, kishanjasani, czapla, siobhyb, darerodz, luisherranz

See #59411.

Built from https://develop.svn.wordpress.org/trunk@56945


git-svn-id: http://core.svn.wordpress.org/trunk@56456 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-16 19:17:19 +00:00
desrosj
aa29f65a28 Build/Test Tools: Downgrade grunt-contrib-qunit dependency.
`grunt-contrib-qunit` was upgraded from version `7.0.1` to `8.0.1` in [56647]. However, this update causes a strange failure when running the build script for the Gutenberg plugin when checked out within a `wordpress-develop` checkout.

This reverts the related change in [56647] and downgrades the dependency back to `7.0.1` until the exact reason for the failure is narrowed down.

Props afercia, kevin940726, antonvlasenko, desrosj.
See #59634, #58863.

Built from https://develop.svn.wordpress.org/trunk@56944


git-svn-id: http://core.svn.wordpress.org/trunk@56455 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-16 16:05:27 +00:00
Felix Arntz
41cf4f1521 General: Remove discouraged @return void annotations.
Such `@return void` annotations must not be used in WordPress core's PHP code, except bundled themes, third-party libraries, and PHP compatibility shims.

Props isabel_brison, swissspidy.
Fixes #59619.

Built from https://develop.svn.wordpress.org/trunk@56943


git-svn-id: http://core.svn.wordpress.org/trunk@56454 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-16 15:17:23 +00:00
Pascal Birchler
a69a0dfcb0 Build/Test Tools: Ensure the failed workflow tasks run last for e2e tests.
This is a follow-up to [56926], where this logic has been reintroduced after it was originally removed in [56198].

Props desrosj.
See #59517.
Built from https://develop.svn.wordpress.org/trunk@56942


git-svn-id: http://core.svn.wordpress.org/trunk@56453 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-16 14:34:21 +00:00
Sergey Biryukov
89a5bbb997 HTML API: Avoid calling subclass method while internally scanning in Tag Processor.
After modifying tags in the HTML API, the Tag Processor backs up to before the tag being modified and then re-parses its attributes. This saves on the code complexity involved in applying updates, which have already been transformed to “lexical updates” by the time they are applied.

In order to do that, `::get_updated_html()` called `::next_tag()` to reuse its logic. However, as a public method, subclasses may change the behavior of that method, and the HTML Processor does just this. It maintains an HTML stack of open elements and when the Tag Processor calls this method to re-scan a tag and its attributes, it leads to a broken stack.

This commit replaces the call to `::next_tag()` with a more appropriate reapplication of its internal parsing logic to rescan the tag name and its attributes. Given the limited nature of what's occurring in `::get_updated_html()`, this should bring with it certain guarantees that no HTML structure is being changed (that structure will only be changed by subclasses like the HTML Processor).

Follow-up to [56274], [56702].

Props dmsnell, zieladam, nicolefurlan.
Fixes #59607.
Built from https://develop.svn.wordpress.org/trunk@56941


git-svn-id: http://core.svn.wordpress.org/trunk@56452 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-16 14:01:27 +00:00
Peter Wilson
09554030d4 Twenty Thirteen, Twenty Sixteen: Use default display for summary element.
Within the details block, style the `summary` element using the default display, `list-item`, this ensures the toggle icon appears indicating the summary can be expanded or contracted.

Props ankit-k-gupta, nicolefurlan, poena, sabernhardt.
Fixes #58915.

Built from https://develop.svn.wordpress.org/trunk@56940


git-svn-id: http://core.svn.wordpress.org/trunk@56451 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-16 04:43:22 +00:00
costdev
13854cd7f5 Posts, Post Types: Don't force trailing slash in get_pagenum_link().
Previously, a trailing slash was appended to the link returned from `get_pagenum_link()`. If the permalink structure didn't contain a trailing slash, this link could fail.

This change removes trailing slashes and only appends one if the site is set for adding trailing slashes.

This adds a new test file for the accompanying tests, `tests/phpunit/tests/link/getPagenumLink.php`, and moves an existing test for `get_pagenum_link()` to the same file.

Props davemad-davenet, darkfate, Nazgul, scribu, nacin, obenland, chriscct7, jesin, matthewppelsheimer, audrasjb, petitphp, mukesh27, oglekler, mai21, webtechpooja, tejwanihemant, nicolefurlan, hellofromTonya, costdev.
Fixes #2877.
Built from https://develop.svn.wordpress.org/trunk@56939


git-svn-id: http://core.svn.wordpress.org/trunk@56450 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-16 00:07:26 +00:00
hellofromTonya
464868a475 Code Modernization: Declare dynamic properties on WP_Text_Diff_Renderer_Table.
Core uses 3 known, named, dynamic properties on the `WP_Text_Diff_Renderer_Table` class:

* `_title`
* `_title_left`
* `_title_right`

When reviewing revisions (within the admin UI), `wp_text_diff()` passes the arguments (without the leading `_`) to a new instance, which raised deprecation notices (see [56354]).

Note: the parent class adds the leading `_` to each of these properties (see [7747]).

The deprecation notices are resolved by declaring each of these known, named, dynamic properties on the class, per the #56034 mitigation strategy. These new properties are not initialized to retain their previous `null` behavior.

Follow-up to [56354], [23506], [7747].

Props wildworks, antonvlasenko, hellofromTonya, ironprogrammer, kafleg, mukesh27, nicolefurlan, presskopp, sabernhardt.
Fixes #59431.
See #58898, #56034.
Built from https://develop.svn.wordpress.org/trunk@56938


git-svn-id: http://core.svn.wordpress.org/trunk@56449 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-15 14:55:23 +00:00
hellofromTonya
23ac8fbfe6 Users: Show "Password reset link sent" message only when finished.
When an admin sends a password reset link to a user (from the Users UI screen), the "finished" UI message:

>Password reset link sent.

is displayed on "finished" and no longer displayed on error.

**What is the change?**

Previously, the conditional (for incrementing the reset counter) checked for a truthy return from `retrieve_password()`. But `retrieve_password()` always returns a truthy state: `true` (meaning "finished") or an instance of `WP_Error`. Thus, checking for a truthy meant the "finished" message was sent on both "finished" and error/failed.

This fix checks for `retrieve_password()` returning `true` to indicate "finished".

**What is displayed on error?**

If `retrieve_password()` returns an instance of `WP_Error`, the following UI message is shown:

>Password reset links sent to 0 users.

The UI messages were not modified by this changeset.

Follow-up to [50129].

Props letraceursnork, prashantbhivsane, audrasjb, costdev, dilipbheda, hareesh-pillai, hellofromTonya, ironprogrammer, huzaifaalmesbah, marybaum, nicolefurlan, oglekler, petitphp, SergeyBiryukov.
Fixes #58407.
Built from https://develop.svn.wordpress.org/trunk@56937


git-svn-id: http://core.svn.wordpress.org/trunk@56448 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-15 14:04:23 +00:00
Sergey Biryukov
d80a03fa4f Tests: Reset the current user before performing assertions in some comment tests.
This aims to avoid affecting other tests in case of failure.

Follow-up to [54527].

See #58955.
Built from https://develop.svn.wordpress.org/trunk@56936


git-svn-id: http://core.svn.wordpress.org/trunk@56447 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-15 08:09:27 +00:00
Sergey Biryukov
00cabf08ae Twenty Nineteen: Correctly display default color names in the color palette.
Instead of displaying the color names, two of the default colors displayed the color code, which was only intended to show when the user has enabled the custom color option in the Customizer.

The reason is that the default value for the option is `false`, and this value is changed to the string `'custom'` if the color option is enabled, and the string `'default'` if the custom color is enabled and then reset to default colors.

This commit adjusts the logic for displaying the color name, to make sure that the string value `'default'` is not compared with `false`, by adding the default value as a parameter to `get_theme_mod( 'primary_color' )`.

Follow-up to [45964].

Props poena, mukesh27, ugyensupport, shailu25, anveshika, harshgajipara, nicolefurlan, syamraj24, balub, vivekawsm.
Fixes #59566.
Built from https://develop.svn.wordpress.org/trunk@56935


git-svn-id: http://core.svn.wordpress.org/trunk@56446 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-14 12:22:27 +00:00
Pascal Birchler
7a3a97592d Build/Test Tools: Do not round percentages when comparing performance test results.
Props joemcgill.
See #59517.
Built from https://develop.svn.wordpress.org/trunk@56934


git-svn-id: http://core.svn.wordpress.org/trunk@56445 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-13 20:05:23 +00:00
Weston Ruter
793eaf7f19 Script Loader: Move delayed head script to footer when there is a blocking footer dependent.
This prevents a performance regression when a blocking script is enqueued in the footer which depends on a delayed script in the `head` (with `async` or `defer`). In order to preserve the execution order, a delayed dependency must fall back to blocking when there is a blocking dependent. But since it was originally delayed (and thus executes similarly to a footer script), it does not need to be in the head and can be moved to the footer. This prevents blocking the critical rendering path.

Props adamsilverstein, westonruter, flixos90.
Fixes #59599.
See #12009.

Built from https://develop.svn.wordpress.org/trunk@56933


git-svn-id: http://core.svn.wordpress.org/trunk@56444 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-13 18:46:21 +00:00
Weston Ruter
a17a3ca214 Script Loader: Enqueue inline style for block template skip link in head instead of footer.
* Introduce `wp_enqueue_block_template_skip_link()` to replace `the_block_template_skip_link()`. Add to `wp_enqueue_scripts` action instead of `wp_footer`.
* Keep inline script for skip link in footer.
* Restore original `the_block_template_skip_link()` from 6.3 and move to `deprecated.php`.
* Preserve back-compat for unhooking skip-link by removing `the_block_template_skip_link` from `wp_footer` action.

Follow-up to [56682] and [56687].

Props sabernhardt, plugindevs, westonruter, spacedmonkey.
Fixes #59505.
See #58775.
See #58664.

Built from https://develop.svn.wordpress.org/trunk@56932


git-svn-id: http://core.svn.wordpress.org/trunk@56443 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-13 17:21:22 +00:00
Felix Arntz
0ade48d1e2 Themes: Clear existing pattern cache when in theme development mode and prevent PHP warning due to missing file.
Follow up to [56765].

Props spacedmonkey, afercia, jrf, flixos90.
Fixes #59591.
See #59490.

Built from https://develop.svn.wordpress.org/trunk@56931


git-svn-id: http://core.svn.wordpress.org/trunk@56442 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-13 16:46:25 +00:00
Pascal Birchler
50694cec94 Build/Test Tools: Fix path check when comparing performance test results.
This is a follow-up to r56926, r56927, r56928.

See #59517.
Built from https://develop.svn.wordpress.org/trunk@56930


git-svn-id: http://core.svn.wordpress.org/trunk@56441 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-13 12:34:22 +00:00
Sergey Biryukov
163f5e566f Media: Consistently call the wp_create_file_in_uploads hook as a filter.
The filter was initially introduced for file replication purposes. Since the returned value is not always used directly, some instances were later converted to an action as part of removing unused variables, and the hook was documented as an action while still being called as a filter in other instances.

This commit aims to correct the discrepancy between the code and the documentation.

Follow-up to [4673], [4817], [4818], [6363], [6551], [13041], [25821], [33154], [33280].

Props Howdy_McGee, nicolefurlan, johnbillion, mhshujon, SergeyBiryukov.
Fixes #57775.
Built from https://develop.svn.wordpress.org/trunk@56929


git-svn-id: http://core.svn.wordpress.org/trunk@56440 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-13 12:20:20 +00:00
Pascal Birchler
7fb21f4110 Build/Test Tools: Fix file prefix handling in performance test results.
This is a follow-up to r56926.

See #59517.
Built from https://develop.svn.wordpress.org/trunk@56928


git-svn-id: http://core.svn.wordpress.org/trunk@56439 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-13 11:30:23 +00:00
Pascal Birchler
ed4ba3bf53 Build/Test Tools: Revert accidental change to Gruntfile.js
This is a follow-up to r56926.

See #59517.
Built from https://develop.svn.wordpress.org/trunk@56927


git-svn-id: http://core.svn.wordpress.org/trunk@56438 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-13 08:15:21 +00:00
Pascal Birchler
afec89634b Build/Test Tools: Migrate Puppeteer tests to Playwright.
As per the migration plan shared last year, this migrates all browser-based tests in WordPress core to use Playwright.
This includes end-to-end, performance, and visual regression tests.

Props swissspidy, mamaduka, kevin940726, bartkalisz, desrosj, adamsilverstein.
Fixes #59517.
Built from https://develop.svn.wordpress.org/trunk@56926


git-svn-id: http://core.svn.wordpress.org/trunk@56437 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-13 08:13:28 +00:00
Peter Wilson
4258f31a3b Query: Cache post parent IDs in posts group.
Move the cache of post parent IDs from the dedicated group `post_parents` to `posts`. This maintains backward compatibility for clearing all post object related data by calling `wp_cache_flush_group( 'posts' )`.

Post parent IDs are now cached with with the prefix `post_parent:` in the `posts` group.

Follow up to [56763].

Props spacedmonkey, joemcgill, peterwilsoncc.
See #59188.

Built from https://develop.svn.wordpress.org/trunk@56925


git-svn-id: http://core.svn.wordpress.org/trunk@56436 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-12 23:41:23 +00:00
Aaron Jorbin
929aa8b970 Post WordPress 6.4 Beta 4 version bump.
Built from https://develop.svn.wordpress.org/trunk@56923


git-svn-id: http://core.svn.wordpress.org/trunk@56434 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-12 20:49:22 +00:00
Aaron Jorbin
d5a5b22dc0 WordPress 6.4 Beta 4.
Built from https://develop.svn.wordpress.org/trunk@56922


git-svn-id: http://core.svn.wordpress.org/trunk@56433 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-12 20:27:25 +00:00
Bernhard Reiter
8a7d30c7f8 Patterns: Don't inject theme attribute on frontend.
Having the patterns registry inject the `theme` attribute into all Template Part blocks inside every pattern was found to negatively impact performance. It turns out that it's only required for the editor (i.e. in the REST API) but not on the frontend; there, it's instead possible to fall back to the currently active theme.

The latter change was made to the Pattern and Template Part blocks in https://github.com/WordPress/gutenberg/pull/55217, which was sync'ed to Core in [56849]. Consequently, this changeset removes `theme` attribute insertion from the frontend.

Props flixos90, gziolo, dmsnell, hellofromtonya.
Fixes #59583.
Built from https://develop.svn.wordpress.org/trunk@56896


git-svn-id: http://core.svn.wordpress.org/trunk@56407 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-12 18:44:45 +00:00
hellofromTonya
5ac76255a9 Editor: Update npm packages ahead of 6.4 RC1.
Updates the npm packages and code for:

* [https://github.com/WordPress/gutenberg/pull/55121 List: fix forward merging of nested list]

* [https://github.com/WordPress/gutenberg/pull/55182 Update consent string for using private APIs.]

* [https://github.com/WordPress/gutenberg/pull/55204 useBlockSettings: add missing useMemo dependencies]

* [https://github.com/WordPress/gutenberg/pull/55120 Remove the lightbox filter and view file when the lightbox setting is disabled.]

* [https://github.com/WordPress/gutenberg/pull/55245 Patterns: Remove the version enforcement for npm in engines field]

* [https://github.com/WordPress/gutenberg/pull/55237 Remove `@return void` from PHP function docs]

* [https://github.com/WordPress/gutenberg/pull/55141 Image: Disable lightbox editor UI for linked images]

* [https://github.com/WordPress/gutenberg/pull/55269 Image: Stop crashing with Lightbox on image blocks without an image]

* [https://github.com/WordPress/gutenberg/pull/55021 Update fullscreen icon]

* [https://github.com/WordPress/gutenberg/pull/55217 Template Part block: Fall back to current theme if no theme attribute is given.] This change is part of fix for a performance regression re-introduced by [56818].

References:
* [https://github.com/WordPress/gutenberg/pull/55298 Gutenberg PR 55298] Cherry-pick commits

Follow-up to [56818], [56816].

Props ellatrix, peterwilsoncc, jsnajdr, afercia, gziolo, isabel_brison, artemiosans, richtabor, bernhard-reiter, flixos90, mikachan, spacedmonkey, hellofromTonya.
See #59583, #59411.
Built from https://develop.svn.wordpress.org/trunk@56849


git-svn-id: http://core.svn.wordpress.org/trunk@56361 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-12 13:58:15 +00:00
desrosj
5a306cc56d Editor: Move footnotes block hooks to default-filters.php
Follow up to [56839].
Built from https://develop.svn.wordpress.org/trunk@56845


git-svn-id: http://core.svn.wordpress.org/trunk@56357 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-12 13:28:23 +00:00
Aaron Jorbin
9f7edd0413 Editor: Harden the display of footnotes.
Props: jorgefilipecosta, peterwilsoncc, costdev, xknown, jorbin.

Built from https://develop.svn.wordpress.org/trunk@56839


git-svn-id: http://core.svn.wordpress.org/trunk@56351 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-12 12:58:23 +00:00
audrasjb
f3ccbed586 Shortcodes: Restrict ajax handler for media shortcode.
Props tykoted, xknown, peterwilsoncc, antpb, jorbin.




Built from https://develop.svn.wordpress.org/trunk@56838


git-svn-id: http://core.svn.wordpress.org/trunk@56350 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-12 12:47:21 +00:00
Aaron Jorbin
bd5486577c Application Passwords: Prevent the use of some pseudo protocols in application passwords.
Props tykoted, xknown, peterwilsoncc, jorbin, timothyblynjacobs, martinkrcho, paulkevan, dd32, ehtis.

Built from https://develop.svn.wordpress.org/trunk@56837


git-svn-id: http://core.svn.wordpress.org/trunk@56349 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-12 12:41:18 +00:00
audrasjb
4f5be9b7de Comments: Prevent users who can not see a post from seeing comments on it.
Props peterwilsoncc, jorbin, audrasjb.




Built from https://develop.svn.wordpress.org/trunk@56836


git-svn-id: http://core.svn.wordpress.org/trunk@56348 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-12 12:38:21 +00:00
Aaron Jorbin
0b35c4e2bf Prevent unintended behavior when certain objects are unserialized.
Props ehtis, xknown.

Built from https://develop.svn.wordpress.org/trunk@56835


git-svn-id: http://core.svn.wordpress.org/trunk@56347 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-12 12:34:33 +00:00
Aaron Jorbin
3f1e6a6a50 REST API: Ensure no-cache headers are sent when methods are ovverriden.
Props tykoted, xknown, ehtis, timothyblynjacobs, peterwilsoncc, rmccue, jorbin.

Built from https://develop.svn.wordpress.org/trunk@56834


git-svn-id: http://core.svn.wordpress.org/trunk@56346 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-12 12:32:32 +00:00
audrasjb
4cfb52760f REST API: Limit search_columns for users without list_users.
Props Vortfu, jorbin, joehoyle, timothyblynjacobs, peterwilsoncc, ehtis.




Built from https://develop.svn.wordpress.org/trunk@56833


git-svn-id: http://core.svn.wordpress.org/trunk@56345 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-12 12:30:20 +00:00
Sergey Biryukov
598f1aeeb9 Twenty Nineteen: Add margins to editor iframe content.
At screen widths of at least 768px (tablet size), Twenty Nineteen should have a `max-width` and side margins for content in the post editor.

This commit applies that style to the new `.block-editor-iframe__body` class, resolving an issue where full-width blocks had a horizontal scrollbar in the editor iframe.

Props sabernhardt, smit08, nidhidhandhukiya, mukesh27, darshitrajyaguru97, oglekler, poena, shailu25, nicolefurlan.
Fixes #59449.
Built from https://develop.svn.wordpress.org/trunk@56832


git-svn-id: http://core.svn.wordpress.org/trunk@56344 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-12 10:17:27 +00:00
desrosj
b918d61236 Build/Test Tools: Remove hardcoded PHPUnit config files.
The configuration file passed to the callable workflow contains the correct one to use.

See #58955.
Built from https://develop.svn.wordpress.org/trunk@56831


git-svn-id: http://core.svn.wordpress.org/trunk@56343 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-11 18:09:24 +00:00
desrosj
3e66d7d2e4 Build/Test Tools: Increase the timeout for the failed workflow.
Following [56829], the previous `timeout-minutes` value of `5` is insufficient when approaching 10 retries.

See #58867.
Built from https://develop.svn.wordpress.org/trunk@56830


git-svn-id: http://core.svn.wordpress.org/trunk@56342 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-11 17:15:27 +00:00
desrosj
099146c20a Build/Test Tools: Increase the number of retries when restarting a workflow.
This increases the number of times to retry restarting a workflow from 2 to 10. Retries use exponential backoff to space out retries.

In most cases, only 2 retries was sufficient. However, there are occasionally scenarios where the original workflow is still running and cannot be restarted, resulting in an error. This typically happens during periods of ongoing service degradation, or workflows with a significant number of jobs (GitHub Actions is sometimes very slow to mark these as finished).

See #58867.
Built from https://develop.svn.wordpress.org/trunk@56829


git-svn-id: http://core.svn.wordpress.org/trunk@56341 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-11 15:56:24 +00:00
Felix Arntz
eae31174d2 Editor: Add further test coverage for wp_render_elements_support().
Props dmsnell, aaronrobertshaw.
Fixes #59578.

Built from https://develop.svn.wordpress.org/trunk@56828


git-svn-id: http://core.svn.wordpress.org/trunk@56340 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-11 15:15:30 +00:00
desrosj
6a66e05d41 Build/Test Tools: Don’t send Slack notification for workflow retries.
[56780] changed Slack failure notifications to not send a failure notification during the first run of a workflow. Because workflows automatically restart once, a failure during the first run can be ignored.

This adjusts the workflow to also not send a “fixed” notification when the second run of a workflow succeeds after a failure. Because the original failure is no longer reported, these notifications are unnecessary.

See #58867.
Built from https://develop.svn.wordpress.org/trunk@56827


git-svn-id: http://core.svn.wordpress.org/trunk@56339 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-11 12:17:24 +00:00
Sergey Biryukov
a6b095398c Help/About: Ensure that focus outline on the Credits screen is not cut off.
Props ivanzhuck, oglekler, wildworks, dhrumilk, audrasjb, tejadev, ankit-k-gupta, sumitbagthariya16, mukesh27, marybaum.
Fixes #59033.
Built from https://develop.svn.wordpress.org/trunk@56826


git-svn-id: http://core.svn.wordpress.org/trunk@56338 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-11 10:43:28 +00:00
costdev
ecd4a277b7 Docs: Use US spelling and correct a typing mistake.
This changes two inline comments and a docblock so that they use US spelling as advised by the Core Handbook's Best Practices. A typing mistake is also corrected.

Reference:
- [https://make.wordpress.org/core/handbook/best-practices/spelling/ Core Handbook - Best Practices - Spelling].

Follow-up to [18632], [38120], [44954].

Props kebbet, mukesh27.
See #58833.
Built from https://develop.svn.wordpress.org/trunk@56825


git-svn-id: http://core.svn.wordpress.org/trunk@56337 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-11 07:05:25 +00:00
costdev
b8b4a92895 Plugins: Fix broken sprintf() call in plugins list table.
In [56599], a `sprintf()` call was modified which resulted in an insufficient number of arguments.
This caused a Fatal Error when an incompatible plugin notice was displayed.

This fixes the `sprintf()` call.

Follow-up to [56599].

Props petitphp, TobiasBg, sabernhardt, mukesh27.
Fixes #59590. See #57791.
Built from https://develop.svn.wordpress.org/trunk@56824


git-svn-id: http://core.svn.wordpress.org/trunk@56336 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-11 04:33:32 +00:00
desrosj
f92fb81019 Build/Test Tools: Correct variable typo.
This was causing the version of WordPress being tested to be listed as `latest` even when that is not the case.

Props davidbaumwald.
See #58977.
Built from https://develop.svn.wordpress.org/trunk@56823


git-svn-id: http://core.svn.wordpress.org/trunk@56335 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-10 17:32:22 +00:00
Tammie Lister
21bb310d1a Post WordPress 6.4 Beta 3 version bump.
Built from https://develop.svn.wordpress.org/trunk@56822


git-svn-id: http://core.svn.wordpress.org/trunk@56334 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-10 16:36:22 +00:00
Tammie Lister
c90823fddb WordPress 6.4 Beta 3.
Built from https://develop.svn.wordpress.org/trunk@56821


git-svn-id: http://core.svn.wordpress.org/trunk@56333 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-10 16:14:22 +00:00
hellofromTonya
86dd8154df Update/Install: Deactivate Gutenberg plugin version older than 16.5.
This commit changes the Gutenberg minimum compatible version number from 14.1 (introduced in [54790]) to 16.5. For versions older than 16.5, the plugin will deactivate when upgrading WordPress to 6.4-beta3 or newer.

Changes are done within Core's `_upgrade_core_deactivate_incompatible_plugins()` which is invoked during WordPress' upgrade process.

Follow-up to [54790].

Props hellofromTonya, spacedmonkey.
Fixes #59584.
Built from https://develop.svn.wordpress.org/trunk@56820


git-svn-id: http://core.svn.wordpress.org/trunk@56332 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-10 15:07:24 +00:00
spacedmonkey
6e774df98c REST API: Fix issue with Template and Template Part Revision/Autosave REST API controllers.
The Template and Template Part REST API controllers have unique characteristics compared to other post type REST API controllers. They do not rely on integer IDs to reference objects; instead, they use a combination of the theme name and slug of the template, like 'twentytwentyfour//home.' Consequently, when the post types template and template part were introduced in [52062], it led to the registration of REST API endpoints for autosaves and revisions with invalid URL structures.

In this commit, we introduce new functionality to enable custom autosave and revisions endpoints to be registered at the post type level. Similar to the 'rest_controller_class' parameter, developers can now define 'revisions_rest_controller' and 'autosave_rest_controller.' This empowers developers to create custom controllers for these functionalities. Additionally, we introduce a 'late_route_registration' parameter, which proves helpful when dealing with custom URL patterns and regex pattern matching issues.
This commit registers new classes for template and template part autosave and revisions controllers, differentiating them from standard controllers in the following ways:
* The response shape now matches that of the template controller.
* Permission checks align with the template controller.
* A custom URL pattern is introduced to support slug-based identification of templates.

Furthermore, we've updated the utility function '_build_block_template_result_from_post' to support passing revision post objects. This enhancement ensures compatibility with the custom revisions controller.

Props spacedmonkey, revgeorge, andraganescu, hellofromTonya, antonvlasenko, kadamwhite, ironprogrammer, costdev, mukesh27, timothyblynjacobs, adamsilverstein. 
Fixes 56922.
Built from https://develop.svn.wordpress.org/trunk@56819


git-svn-id: http://core.svn.wordpress.org/trunk@56331 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-10 14:05:21 +00:00
Bernhard Reiter
b44637c00c Patterns: Inject theme attribute into Template Part blocks.
[56805] introduced a regression: The `theme` attribute was no longer injected into Template Part blocks inside of patterns. This caused errors on the frontend, where instead of a given template part, an error message such as `Template part has been deleted or is unavailable: header` was seen.

This changeset rectifies that problem, and adds unit test coverage to guard against future regressions.

Follow-up to [56805].
Props scruffian, gziolo.
Fixes #59583.
Built from https://develop.svn.wordpress.org/trunk@56818


git-svn-id: http://core.svn.wordpress.org/trunk@56330 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-10 13:21:22 +00:00
hellofromTonya
eb9aaa5f9e Options, Meta APIs: Check setting group exists before search in unregister_setting().
Checks if the given `$option_group` exists before searching for the `$option_name`. Sets the `$pos` to `false`, as `array_search()` returns `false` if the option name (needle) does not exist.

This changeset fixes 2 different PHP Warning|Notice scenarios:
1. When the global `$new_allowed_options` is `null`, fixes raising `Trying to access array offset on value of type null` PHP Notice (PHP 7.4) | Warning (on PHP 8).

2. When the global `$new_allowed_options` is an `array` and the setting group key does not exist, fixes raising "Undefined index: unknown_setting_group" PHP Notice (PHP 7) | Warning (on PHP 8).

For both scenarios, the `array_search()` is skipped and the `$pos` is set to a default of `false`, i.e. which is the value returned when `array_search()` is unsuccessful.

Props xknown, hellofromTonya, nicolefurlan, oglekler, SergeyBiryukov, shailu25.
Fixes #57674.
Built from https://develop.svn.wordpress.org/trunk@56817


git-svn-id: http://core.svn.wordpress.org/trunk@56329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-10 12:52:25 +00:00
Tammie Lister
6468f40e61 Update editor related npm packages for beta 3 second part.
The npm packages needed a second part to the update for beta 3 in preparation for 6.4.

Props talldan, ellatrix, santosguillamot, ramonopoly, andrewserong, artemiosans, isabel_brison, mikachan.

See #59411.

Built from https://develop.svn.wordpress.org/trunk@56816


git-svn-id: http://core.svn.wordpress.org/trunk@56328 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-10 11:30:19 +00:00
Sergey Biryukov
330f070340 Query: Ensure that the page parameter is scalar in WP_Query::get_posts().
The `page` query var only accepts a scalar value and passes the value through functions that assume a scalar value.

Adding an extra guard condition does not affect its functionality but does avoid a PHP fatal error for `trim()` when a non-scalar value such as an array is passed.

Follow-up to [2535], [53891].

Props brookedot, rlmc, mukesh27, SergeyBiryukov.
Fixes #56558.
Built from https://develop.svn.wordpress.org/trunk@56815


git-svn-id: http://core.svn.wordpress.org/trunk@56327 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-10 11:22:24 +00:00
spacedmonkey
57ecd6c091 Options, Meta APIs: Prevent unnecessary database updates caused by strict comparisons in update_network_option.
Previously, in the update_network_option function, strict comparisons between old and new values could erroneously trigger updates in cases where there was no actual change in values. Building upon the groundwork laid in #22192, this commit introduces the use of the _is_equal_database_value function to accurately compare values before initiating any database updates. This change ensures consistency between the behaviors of `update_option` and `update_network_option`.

Furthermore, we have incorporated similar workarounds that were previously implemented in [56717]. These changes ensure that the raw version of network option values is considered in the comparisons, enhancing the overall reliability of the update process.

Props mukesh27, flixos90, joemcgill, costdev, spacedmonkey.
Fixes #59360.
Built from https://develop.svn.wordpress.org/trunk@56814


git-svn-id: http://core.svn.wordpress.org/trunk@56326 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-10 09:37:22 +00:00
Tammie Lister
e34caad13c Changes to TT4 for beta 3.
Updates TT4 with additional changes ready for beta 3.

Props jessplease, pbwebd, poena, afercia, luminuu, beafialho, onemaggie, mhkuu,  richtabor,  benoitchantre.

Close #59575.

Built from https://develop.svn.wordpress.org/trunk@56813


git-svn-id: http://core.svn.wordpress.org/trunk@56325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-10 09:03:25 +00:00
isabel_brison
5951111cba Editor: fix incorrect block custom CSS output.
Fixes output of block custom CSS when multiple rules require a descendant selector.

Props wildworks, mikachan.
Fixes #59499.

Built from https://develop.svn.wordpress.org/trunk@56812


git-svn-id: http://core.svn.wordpress.org/trunk@56324 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-10 03:43:22 +00:00
Peter Wilson
61658a27a3 Query: Rename _prime_post_parents_caches() for clarity.
Change the name of `_prime_post_parents_caches()` to `_prime_post_parent_id_caches()` to make it clearer only the parent post ID is cached rather than the entire post parent object.

Follow up to [56763].

Props spacedmonkey, joemcgill, peterwilsoncc.
See #59188.

Built from https://develop.svn.wordpress.org/trunk@56811


git-svn-id: http://core.svn.wordpress.org/trunk@56323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-09 23:04:16 +00:00
joedolson
203ae545d2 Administration: Fix unusable mobile admin menu in Safari.
Replace the `focusout` event handler added in [55326] with a combination of `blur` and `keyup` handler. This change handles Safari not setting focus on clicked elements.

Props afercia, joedolson, travel_girl, oglekler, rajinsharwar, marybaum, rcorrales, binsaifullah, shubhamsedani, ashikur698.
Fixes #58912.
Built from https://develop.svn.wordpress.org/trunk@56810


git-svn-id: http://core.svn.wordpress.org/trunk@56322 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-09 23:02:26 +00:00
Weston Ruter
2869e3a186 Administration: Remove deprecated unload event handlers and use pagehide (and pageshow) when appropriate.
Use `pagehide` event instead of `unload` in the following cases:

* For classic editor to release the post lock.
* In Text widget to rebuild editor after dragging widget to new location in classic widgets interface.
* To clear out the `window.name` when navigating away from a post preview.
* To suspend heartbeat, while also using `pageshow` event to resume as if it had been a focused tab in case page restored from bfcache. 

Also:

* Remove obsolete mobile cleanup code in `js/_enqueues/lib/gallery.js` (introduced in [9894]). Do same for `src/js/_enqueues/wp/media/models.js` (introduced in [22872]). See #22552.
* Remove obsolete Firefox-specific workaround in `js/_enqueues/wp/mce-view.js` from [39282]. See #38511.

Fixes #55491.
Props spenserhale, westonruter, adamsilverstein, azaozz, shawfactor, peterwilsoncc, swissspidy.
Built from https://develop.svn.wordpress.org/trunk@56809


git-svn-id: http://core.svn.wordpress.org/trunk@56321 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-09 21:31:27 +00:00
Tammie Lister
d605f96c0f Update npm packages to latest versions for 6.4 beta 3.
The npm packages needed a further update for beta 3 in preparation for 6.4.

Props @richtabor, @mmaattiiaass, @tellthemachines, @mamaduka, @swissspidy, @scruffian, @andraganescu, @andrewserong, @mujuonly, @get_dave, @ntsekouras, @carlosgprim, @ramonopoly, @jameskoster, @wildworks, @aaronrobertshaw, @czapla, @santosguillamot, @artemiosans, @afercia, @glendaviesnz, @kevin940726, @mikachan, @siobhyb.

See #59411.

Built from https://develop.svn.wordpress.org/trunk@56808


git-svn-id: http://core.svn.wordpress.org/trunk@56320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-09 17:24:24 +00:00
Felix Arntz
d783a65dd9 Editor: Improve performance of wp_render_elements_support().
By skipping iterations in block supports when not necessary, this changeset improves performance of the function notably.

The performance enhancement leads to even a notable improvement for overall page load time: For example, the Twenty Twenty-Four home page loads ~2% faster with this changeset.

Props dmsnell, spacedmonkey, costdev, hellofromTonya, aaronrobertshaw.
Fixes #59544.

Built from https://develop.svn.wordpress.org/trunk@56807


git-svn-id: http://core.svn.wordpress.org/trunk@56319 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-09 17:07:22 +00:00
Felix Arntz
5ba13b5683 Editor: Add additional unit tests for elements block support.
Props aaronrobertshaw, costdev.
Fixes #59555.
See #59544.

Built from https://develop.svn.wordpress.org/trunk@56806


git-svn-id: http://core.svn.wordpress.org/trunk@56318 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-09 16:41:44 +00:00
Bernhard Reiter
fc229aa436 Blocks: Call get_hooked_blocks only once per template/part/pattern.
Prior to this changeset, `get_hooked_blocks` was called four times ''for every parsed block'' in each template, template part, and pattern. With this changeset applied, `get_hooked_blocks` is called only once per template, template part, or pattern.

Additionally, `get_hooked_blocks` is called only once when returning the list of all registered patterns. (The latter modification brings the implementation closer to its state prior to Block Hooks.)

Finally, when there are no registered hooked blocks or `hooked_block_types` filters, parsing, hooked block insertion, and re-serializing is skipped altogether.

Props gziolo, flixos90, joemcgill, dmsnell, spacedmonkey, hellofromtonya.
Fixes #59383.
Built from https://develop.svn.wordpress.org/trunk@56805


git-svn-id: http://core.svn.wordpress.org/trunk@56317 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-09 16:40:24 +00:00
K. Adam White
e0596b5835 REST API: Correct parsing of password from Authorization header when processing Application Password credentials.
Exit early when parsing Application Password credentials if Authorization header value does not contain at least one colon. The `Authorization` Basic header must use a colon to separate the username and password components per RFC 7617, so a username-only string is malformed and should not be processed.

Split `Authorization` header only on the first colon, properly handling passwords containing colons.

Resolves PHP 8.0 warning when `list()` was called on an exploded credentials array containing only one element.

Props kalpeshh, shooper, sc0ttkclark, jrf, mukesh27, oglekler, nicolefurlan.
Fixes #57512.


Built from https://develop.svn.wordpress.org/trunk@56804


git-svn-id: http://core.svn.wordpress.org/trunk@56316 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-09 14:49:26 +00:00
Sergey Biryukov
d1b13a270a Code Modernization: Update parameter names in the WP_Block_List class.
This makes the parameter names consistent with the `ArrayAccess` interface.

Reference: [https://www.php.net/manual/en/class.arrayaccess.php PHP Manual: The ArrayAccess interface].

Follow-up to [48159].

Props rahmohn.
See #58976.
Built from https://develop.svn.wordpress.org/trunk@56803


git-svn-id: http://core.svn.wordpress.org/trunk@56315 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-09 11:23:28 +00:00
joedolson
074d2adb95 Quick/Bulk Edit: Fix inability to quick edit draft post date.
Follow up to [56022] to fix inability to set a date/time in quick editing. Allow a user to set a quick/edit date while preventing accidental date assignments per the original intent.

Props tristanleboss, ivanzhuck, tibbsa, sabernhardt, sergeybiryukov, oandregal, khokansardar, joedolson, shailu25.
Fixes #59125. See #19907.
Built from https://develop.svn.wordpress.org/trunk@56802


git-svn-id: http://core.svn.wordpress.org/trunk@56314 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-08 20:10:25 +00:00
joedolson
f99b282ca2 Upload: Fix misalignment of 'Copied' message.
Add `display: flex` to `.copy-to-clipboard-container` to fix alignment of elements within the container.

Props sujichandran14, oglekler, sarathar, huzaifaalmesbah, nicolefurlan, joemcgill, dkotter.
Fixes #58829.
Built from https://develop.svn.wordpress.org/trunk@56801


git-svn-id: http://core.svn.wordpress.org/trunk@56313 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-08 18:21:23 +00:00
joedolson
eb4db82558 Administration: Add missing space in theme activation notices.
Restore missing space in two admin notices during theme activation.

Props shailu25, sergeybiryukov, mukesh27, hellofromtonya.
Fixes #59501. See #57791.
Built from https://develop.svn.wordpress.org/trunk@56800


git-svn-id: http://core.svn.wordpress.org/trunk@56312 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-08 17:56:24 +00:00
Sergey Biryukov
bc26809c97 Coding Standards: Upgrade WPCS to version 3.0.1.
In WordPressCS 3.0.0, the functionality of the `WordPress.Security.EscapeOutput` sniff was updated to report unescaped message parameters passed to exceptions created in `throw` statements. This specific violation now has a separate error code: `ExceptionNotEscaped`. This will allow users to ignore or exclude that specific error code.

The error code(s) for other escaping issues flagged by the sniff remain unchanged.

References:
* [https://github.com/WordPress/WordPress-Coding-Standards/releases/tag/3.0.1 WPCS 3.0.1 release notes]
* [https://github.com/WordPress/WordPress-Coding-Standards/compare/3.0.0...3.0.1 Full list of changes in WPCS 3.0.1]

Follow-up to [56695].

Props jrf, bjorsch, dawidurbanski.
See #59161.
Built from https://develop.svn.wordpress.org/trunk@56799


git-svn-id: http://core.svn.wordpress.org/trunk@56311 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-08 13:09:25 +00:00
Sergey Biryukov
6d0770e8df Coding Standards: Correct alignment in wp-admin/user-edit.php.
This resolves a WPCS warning:
{{{
Array double arrow not aligned correctly;
expected 1 space(s) between "'type'" and double arrow, but found 15.
}}}

Follow-up to [56570], [56680].

Props jrf.
See #59161, #58831.
Built from https://develop.svn.wordpress.org/trunk@56798


git-svn-id: http://core.svn.wordpress.org/trunk@56310 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-07 13:55:30 +00:00
Felix Arntz
e855a6f289 Options, Meta APIs: Add test coverage for update_network_option() comparison of new and existing value.
Having those tests in `trunk` already will help ensure potential future fixes to this logic maintain backward compatibility.

Props mukesh27, spacedmonkey.
See #59360.

Built from https://develop.svn.wordpress.org/trunk@56797


git-svn-id: http://core.svn.wordpress.org/trunk@56309 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-06 17:03:18 +00:00
Felix Arntz
cfbd76d97c Options, Meta APIs: Fix bug with update_option() updating the wrong cache, leading to potentially stale values being returned.
When using the `$autoload` parameter of `update_option()` alongside an option value update, prior to this changeset the function would update the incorrect cache, not respecting the new autoload value. This could have severe implications such as returning a stale option value when the option in fact had already been deleted.

This changeset fixes the bug alongside test coverage that failed with `trunk` but now passes.

Props kkmuffme, pentatonicfunk, SergeyBiryukov, oglekler, azaozz, spacedmonkey, nicolefurlan, joemcgill, flixos90.
Fixes #51352.

Built from https://develop.svn.wordpress.org/trunk@56796


git-svn-id: http://core.svn.wordpress.org/trunk@56308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-06 16:33:25 +00:00
Sergey Biryukov
5c4f902c20 Editor: Move wp_navigation schema updating to WP_Navigation_Fallback class.
This aims to better align the navigation fallback implementation with core architecture and best practices.

The function that updates the `wp_navigation` post response schema is now a public method of the `WP_Navigation_Fallback` class, so an extra file previously used for that specific function is no longer necessary.

Follow-up to [56052].

Props ramonopoly, scruffian, isabel_brison, mukesh27, swissspidy, rajinsharwar, afercia, audrasjb, mikeschroder, JeffPaul, johnjamesjacoby, TimothyBlynJacobs, oglekler, SergeyBiryukov.
Fixes #58910.
Built from https://develop.svn.wordpress.org/trunk@56793


git-svn-id: http://core.svn.wordpress.org/trunk@56305 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-06 14:06:22 +00:00
desrosj
67c2237b52 Build/Test Tools: Check for zero-byte files in themes.
Because the contents of binary files are not included in patches by default, occasionally empty versions of these files are committed on accident. This is the most commonly happens within default themes because they usually contain image and font files.

This adds a job to the theme related GitHub Action workflow that checks for the presence of zero-byte files so that these instances are caught more easily.

Props costdev, hellofromTonya, luminuu, onemaggie.
Fixes #59527.
Built from https://develop.svn.wordpress.org/trunk@56792


git-svn-id: http://core.svn.wordpress.org/trunk@56304 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-06 12:47:25 +00:00
audrasjb
8f66e7884b Twenty Twenty-Three: Add missing font licenses in readme.txt file.
Props benimub.
Fixes #59483.




Built from https://develop.svn.wordpress.org/trunk@56791


git-svn-id: http://core.svn.wordpress.org/trunk@56303 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-05 22:46:18 +00:00
Sergey Biryukov
4fd39c6620 HTML API: Rename WP_HTML_Processor::createFragment() to follow WPCS.
`WP_HTML_Processor::create_fragment()` is the correct method name as per the WordPress PHP coding standards.

Follow-up to [56274].

Props dmsnell, jrf, hellofromTonya, SergeyBiryukov.
Fixes #59547.
Built from https://develop.svn.wordpress.org/trunk@56790


git-svn-id: http://core.svn.wordpress.org/trunk@56302 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-05 22:42:26 +00:00
Felix Arntz
bef632d0cc Options, Meta APIs: Fix minor compatibility issue with update_option() change.
When calling `update_option()` with value `false` on a non-existent option, prior to [56681] the function would have returned `false` and not stored the value in the database, since the given value was the same as the default.

The aforementioned changeset broke that promise with good intention, however this particular change was a backward compatibility break and therefore is resolved here.

Props mukesh27, costdev.
Fixes #22192.

Built from https://develop.svn.wordpress.org/trunk@56788


git-svn-id: http://core.svn.wordpress.org/trunk@56300 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-05 16:15:27 +00:00
Joe McGill
7291a4dfa0 Themes: Fix core block style paths on Windows.
This is a follow-up to [56528], which normalizes the `BLOCKS_PATH` for Windows prior to making paths relative for caches during the registration process. Prior to this change, incorrect file paths would lead to broken styles for core blocks on Windows.

Props wildworks, pbiron, flixos90, joemcgill.
Fixes #59489. See #59111.

Built from https://develop.svn.wordpress.org/trunk@56785


git-svn-id: http://core.svn.wordpress.org/trunk@56297 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-04 22:23:27 +00:00
audrasjb
a0d3ee6717 Twenty Twenty: Fix style issues within iframed editor.
This changeset:
- Replaces `body` with `html` for the first CSS selector that makes text white against a dark background
- Moves `twentytwenty_block_editor_styles()` from the `enqueue_block_editor_assets` action to `enqueue_block_assets` for WordPress 6.3 and later
- Removes the obsolete `twentytwenty-block-editor-script` from the styles function to avoid an error in the iframe

Props floydwilde, poena, huzaifaalmesbah, greenshady, sabernhardt, audrasjb, pooja1210, shailu25, joemcgill.
Fixes #59086.




Built from https://develop.svn.wordpress.org/trunk@56783


git-svn-id: http://core.svn.wordpress.org/trunk@56295 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-04 20:56:24 +00:00
desrosj
3751961f50 Build/Test Tools: Don’t send a Slack notice for a workflow’s first failure.
After [53947], all workflows will automatically be restarted once in an attempt to rule out reasons for failures, such as timeouts or network hiccups.

Second attempt at [56404], which was previously reverted in [56407].
See #58867.
Built from https://develop.svn.wordpress.org/trunk@56780


git-svn-id: http://core.svn.wordpress.org/trunk@56292 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-04 19:14:21 +00:00