Commit Graph

22695 Commits

Author SHA1 Message Date
joedolson
fb3ce8ed15 Toolbar: Add adminbar link for new sites in network installs.
Add a link that allows network administrators to go to the new site page from the "New" menu in the adminbar. 

Props johnjamesjacoby, sabernhardt, joedolson, rajinsharwar, huzaifaalmesbah.
Fixes #41104.
Built from https://develop.svn.wordpress.org/trunk@57600


git-svn-id: http://core.svn.wordpress.org/trunk@57101 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-12 20:53:12 +00:00
Sergey Biryukov
811de39c6f Twenty Nineteen: Correct line height for Button block.
This commit moves `line-height` to the Buttons container and removes the duplicate `outline` property.

Props sabernhardt, nidhidhandhukiya, monzuralam, shailu25, hrrarya, karmatosed, harshgajipara, nicolefurlan, fnpen, oglekler, poena, huzaifaalmesbah, audrasjb.
Fixes #58443.
Built from https://develop.svn.wordpress.org/trunk@57599


git-svn-id: http://core.svn.wordpress.org/trunk@57100 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-12 18:52:07 +00:00
davidbaumwald
3fae0d4fe5 Upgrade/Install: Remove unnecessary individual subfiles from $_old_files array.
On upgrade, the `$_old_files` array is used to cleanup any files that exist in a previous version of core but are no longer present in the current version.  Sometimes, an entire directory should be removed.  In the past, when a parent directory was included in the array, subfiles were also included for good measure.  

However, the code that removes the old files uses `$wp_filesystem->delete()` with the `$recursive` parameter set to `true`.  With this setup, individual subfiles are not required to be individually listed when their parent directory is already included in the `$_old_files` array.

This commit removes all individual subfiles from the `$_old_files` array when their parent directory is already included.

Props SergeyBiryukov, mhshohel, pbiron, oglekler.
Fixes #58995.
Built from https://develop.svn.wordpress.org/trunk@57598


git-svn-id: http://core.svn.wordpress.org/trunk@57099 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-12 16:53:13 +00:00
Pascal Birchler
10b96420a5 Shortcodes: Always return an array in shortcode_parse_atts().
Previously, `shortcode_parse_atts()` would return the input (an empty string) if a shortcode had no attributes, even though the documentation said otherwise.

Always returning an (empty) array reduces confusion and improves developer experience as the return value does not have to be manually checked in the shortcode itself.

Props: nicolefurlan, swissspidy, johnbillion, bedas.
Fixes #59249.
Built from https://develop.svn.wordpress.org/trunk@57597


git-svn-id: http://core.svn.wordpress.org/trunk@57098 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-12 16:08:10 +00:00
audrasjb
64b5e4c51a Networks and Sites: Improve switch_to_blog() docblock.
Follow-up to [41373].

Props sabernhardt, jeremyfelt, audrasjb.
Fixes #60332.
See #41815.




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


git-svn-id: http://core.svn.wordpress.org/trunk@57097 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-12 15:38:09 +00:00
audrasjb
d3d9374e06 Canonical: Introduce admin_canonical_url filter.
This changeset introduces the new `admin_canonical_url` hook to help developers and extenders to modify the admin canonical url value.

Props prionkor, audrasjb.
Fixes #59545.




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


git-svn-id: http://core.svn.wordpress.org/trunk@57096 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-12 15:26:10 +00:00
Bernhard Reiter
c193c9936b Block Hooks: Inject hooked blocks into modified templates and parts.
Using the new technique introduced in [57157] of using a `metadata.ignoredHookedBlocks` attribute in the anchor block to store information about whether or not a hooked block should be considered for injection, extend said injection to encompass ''modified'' templates and parts.

Fixes #59646.
Props gziolo, matveb.
Built from https://develop.svn.wordpress.org/trunk@57594


git-svn-id: http://core.svn.wordpress.org/trunk@57095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-12 13:15:09 +00:00
gziolo
b0e171fe16 Script Modules API: Add deregister module function
It was impossible to deregister a script module. It is changing to avoid problems for extenders that want to override any Core script module.

Fixes #60463.
Props cbravobernal, gziolo, mukesh27, youknowriad.


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


git-svn-id: http://core.svn.wordpress.org/trunk@57094 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-12 13:00:10 +00:00
costdev
c04996591b Upgrade/Install: Avoid update_option() calls during bootstrap.
[57545] introduced the Plugin Dependencies feature, which contains a new `plugin_data` option.

Previously, the `plugin_data` option was being updated during bootstrap and in `get_plugins()`, causing an error when using the install script as the options database table does not yet exist, and also risked an "out of sync" issue between the database and the cache on websites with heavy traffic.

This removes the calls to `update_option()` during Core's bootstrap, and guards the call in `get_plugins()` to ensure that it doesn't run when WordPress is installing.

Follow-up to [57545].

Props desrosj, swisspidy, huzaifaalmesbah, afragen, dd32, azaozz, costdev.
Fixes #60461. See #60457, #60491.
Built from https://develop.svn.wordpress.org/trunk@57592


git-svn-id: http://core.svn.wordpress.org/trunk@57093 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-12 12:33:10 +00:00
costdev
c309be74be Filesystem API: Fix typo in ftp_base::restore().
The `ftp_base::restore()` method contained a typo internally: "resore" should be "restore".

Follow-up to [7126].

Props benniledl, hellofromTonya, audrasjb.
Fixes #60497.
Built from https://develop.svn.wordpress.org/trunk@57591


git-svn-id: http://core.svn.wordpress.org/trunk@57092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-12 12:07:10 +00:00
gziolo
48da229fa5 Blocks: Allow reading the script handle from asset files
In the [documentation for WPDefinedAsset definition](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#wpdefinedasset) for block metadata there is a note about the handle. That was missing in WordPress core.

Props gziolo, jsnajdr, youknowriad.
Fixes #60485.



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


git-svn-id: http://core.svn.wordpress.org/trunk@57091 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-12 11:42:11 +00:00
audrasjb
59f2266979 Twenty Twenty: Scope .privacy-policy styles to the footer only.
This changeset fixes an issue where the `.privacy-policy` styles were applied to other locations than the footer only, like the `privacy-policy` page itself.

Props mnydigital, sabernhardt, huzaifaalmesbah, shailu25, poena.
Fixes #60469.




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


git-svn-id: http://core.svn.wordpress.org/trunk@57090 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-12 11:33:05 +00:00
audrasjb
ddd8354888 Twenty Twenty-Four: Add missing translation functions to text strings.
This changeset updates some text labels in `footer.php` to make them translatable.

Props wildworks, sabernhardt, poena, onemaggie, luminuu, mukesh27.
Fixes #60298.




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


git-svn-id: http://core.svn.wordpress.org/trunk@57089 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-12 11:09:08 +00:00
audrasjb
db98f7f8b2 Twenty Twenty: Fix Table block default and custom border colors.
On the front end, this changeset restores the theme's default border color when (and only when) the block's text color is the default.
In the editor, these styles repurpose the user-selected color for the border, to match the front.

Props nidhidhandhukiya, sabernhardt, pooja1210, pouicpouic, poena, shailu25, ugyensupport, wasiur195, rajinsharwar, wasiur195, jivygraphics, huzaifaalmesbah, harshgajipara, nicolefurlan, sumitbagthariya16.
Fixes #58022.




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


git-svn-id: http://core.svn.wordpress.org/trunk@57088 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-12 10:48:12 +00:00
Pascal Birchler
cb4b56dfda Plugins: Store plugin deletion results in temporary option.
Storing the data in a non-autoloaded rather than a transient ensures it cannot be accidentally removed due to a cache flush.

Props: kkmuffme, mukesh27.
Fixes #59433.
Built from https://develop.svn.wordpress.org/trunk@57586


git-svn-id: http://core.svn.wordpress.org/trunk@57087 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-12 09:37:08 +00:00
youknowriad
42abc00010 Editor: Update pattern overrides attribute format.
Updates the pattern block's overrides attribute data structure and renames it to content.
This new format should prove more flexible for the future.

Props talldanwp, gziolo.
Fixes #60456.
Built from https://develop.svn.wordpress.org/trunk@57585


git-svn-id: http://core.svn.wordpress.org/trunk@57086 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-12 08:49:12 +00:00
joedolson
9a3c2cc58b General: Remove ableist language from code comments.
Remove a handful of occurrences of ableist terms in code comments; omits external libraries.

Props dartiss, upadalavipul, SergeyBiryukov, shailu25, jorbin, dmsnell, joedolson, manfcarlo.
Fixes #60247.
Built from https://develop.svn.wordpress.org/trunk@57584


git-svn-id: http://core.svn.wordpress.org/trunk@57085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-11 19:14:19 +00:00
Sergey Biryukov
23d24eefc2 Tests: Adjust the meta key time in wp_scheduled_delete() tests.
Occasionally, the tests verifying that old trashed posts or comments are not deleted if not old enough can take longer than expected, leading to false positives when comparing the timestamp in `wp_scheduled_delete()`, and resulting in subsequent test failures.

This commit aims to resolve the race condition.

Follow-up to [57224], [57237].

See #59938.
Built from https://develop.svn.wordpress.org/trunk@57583


git-svn-id: http://core.svn.wordpress.org/trunk@57084 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-11 17:04:22 +00:00
dmsnell
fd1cbd8980 HTML API: Add subclassed has_bookmark() and fix seek()
The WP_HTML_Processor::has_bookmark() method has not correctly reported bookmarks
which have been set, because it wraps the given bookmark names when setting them.
Additionally, WP_HTML_Processor::seek() does not seek to correct location if HTML
has been updated because it wasn't flushing enqueued updates to the document.

In this patch both problems are resolved and added tests guard these behaviors
against future regressions.

Developed in https://github.com/WordPress/wordpress-develop/pull/6039
Discussed in https://core.trac.wordpress.org/ticket/60474

Follow-up to [56274].
Props dmsnell, jonsurrell.
Fixes #60474.


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


git-svn-id: http://core.svn.wordpress.org/trunk@57083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-10 22:54:13 +00:00
Sergey Biryukov
82b97a677f Twenty Fifteen: Add top margin to the File block button styles.
This ensures that there is some spacing between the Cover and File blocks.

Props mukesh27, mayur8991, panchalhimani711, sabernhardt, itpathsolutions, thakordarshil, ankit-k-gupta, ugyensupport, pooja1210, shailu25, harshgajipara, darshitrajyaguru97, poena.
Fixes #58498.
Built from https://develop.svn.wordpress.org/trunk@57581


git-svn-id: http://core.svn.wordpress.org/trunk@57082 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-10 17:18:14 +00:00
joedolson
5940784180 Quick/Bulk Edit: Pre-fill category fields with their status.
Pre-fill category fields in the Quick/Bulk Edit form with their current status.

When bulk editing, if only some of the selected items are in a given category, the category's checkbox will display a line to indicate an indeterminate status.

Originally committed in [56172], but reverted due to a bug that removed all categories. Updated commit fixes the bug, adds unit tests, and improves the accessibility of the indeterminate state checkboxes.

Props pavelevap, scribu, chasedsiedu, helen, joshcanhelp, ubernaut, Cyberchicken, laumindproductscomau, SergeyBiryukov, Marcoevich, tomybyte, thinkluke, virtality-marketing-solutions, Michalooki, dmsnell, itecrs, pannelars, WHSajid, samba45, Mte90, johnbillion, tomluckies, soulseekah, francina, oglekler, ajmcfadyen, mukesh27, costdev, hellofromTonya, peterwilsoncc, joedolson, pbiron, oglekler, webcommsat, jorbin, ajmcfadyen, huzaifaalmesbah.
Fixes #11302.
Built from https://develop.svn.wordpress.org/trunk@57580


git-svn-id: http://core.svn.wordpress.org/trunk@57081 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-09 19:50:14 +00:00
Sergey Biryukov
ae0b8ee134 Twenty Nineteen: Add border-radius to avatar images in the editor.
This ensures that avatars design in the Post Author or Avatar blocks in the editor matches the front end.

Props pitamdey, shailu25, poena, sabernhardt, balub, sarath.ar, nicolefurlan, harshgajipara, pooja1210.
Fixes #59285.
Built from https://develop.svn.wordpress.org/trunk@57579


git-svn-id: http://core.svn.wordpress.org/trunk@57080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-09 18:25:04 +00:00
youknowriad
f7c63b630c Editor: Update the WordPress packages to Gutenberg 17.7RC1.
This brings the latest and greatest from Gutenberg.
The full changelog is available here 
https://github.com/WordPress/gutenberg/releases/tag/v17.7.0-rc.1

Props youknowriad, get_dave.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57578


git-svn-id: http://core.svn.wordpress.org/trunk@57079 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-09 18:22:22 +00:00
Sergey Biryukov
336be7695c Twenty Sixteen: Add border-radius to avatar images in the editor.
This ensures that avatars design in the Post Author or Avatar blocks in the editor matches the front end.

Props pitamdey, sabernhardt, poena, shailu25.
Fixes #59253.
Built from https://develop.svn.wordpress.org/trunk@57577


git-svn-id: http://core.svn.wordpress.org/trunk@57078 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-09 17:57:13 +00:00
youknowriad
21e68fe56e Editor: Expand Block Bindings for button block.
Add block bindings support for the linkTarget and rel button block attributes.
This allows using custom fiends or pattern overrides for these attributes.

Props glendaviesnz.
Fixes #60481.
Built from https://develop.svn.wordpress.org/trunk@57576


git-svn-id: http://core.svn.wordpress.org/trunk@57077 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-09 15:10:13 +00:00
gziolo
66badc5b0d Editor: Add wakeup magic method to the block bindings registry
See #60282.
Follow-up [57373].
Props dmsnell, mukesh27, gziolo.


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


git-svn-id: http://core.svn.wordpress.org/trunk@57076 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-09 10:54:11 +00:00
gziolo
9cd17860ba Editor: Refactor block binding processing and attribute computation
Refactors the processing of block bindings into steps:
- Gets the value for each "bound" attribute from the respective source.
- Returns the computer attributes with values from the sources.
- The computed attributes get injected into block's content.
- The `render_callback` gets the updated list of attributes and processeded block content.

Fixes #60282.
Props czapla, gziolo, andraganescu, santosguillamot.


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


git-svn-id: http://core.svn.wordpress.org/trunk@57075 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-09 10:40:15 +00:00
isabel_brison
1739bae7a8 Themes: update add_theme_support docblock.
Adds missing features to the list for the `$feature` parameter in `add_theme_support()`.

Props up1512001, mukesh27, swissspidy, isabel_brison.
Fixes #60221.


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


git-svn-id: http://core.svn.wordpress.org/trunk@57074 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-09 04:17:13 +00:00
joedolson
962f2a1508 Users: Replace table tags for color palettes in profiles.
Replace the `table` element used to present color palette selection in the user profile screen with generic elements. The extra semantics of a table are at best unhelpful and have some potential to great extraneous verbosity for screen readers.

Props sabernhardt, desrosj.
Fixes #53157.
Built from https://develop.svn.wordpress.org/trunk@57572


git-svn-id: http://core.svn.wordpress.org/trunk@57073 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-08 23:31:16 +00:00
Aaron Jorbin
27ba6d5b6b I18N: Add Translator comments for Planet URLs.
Props oglekler, zodiac1978, audrasjb, jorbin.
Fixes #58010.


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


git-svn-id: http://core.svn.wordpress.org/trunk@57072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-08 20:36:14 +00:00
desrosj
fd9c831f38 Build/Test Tools: Generate a human-readable HTML coverage report.
This updates the test coverage GitHub Actions workflow to generate a human-readable HTML report in addition to the current machine readable one submitted to Codecov.

Props jorbin.
Fixes #60476.
Built from https://develop.svn.wordpress.org/trunk@57570


git-svn-id: http://core.svn.wordpress.org/trunk@57071 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-08 19:33:25 +00:00
Sergey Biryukov
0ed990c294 Twenty Twenty-Two: Prefix the pages block pattern category name.
If a plugin also registers the category name `pages` in an `init` hook that runs after the theme's, it can override the label and description unintentionally.

With a prefix, extenders can still override it, but it would be intentional.

Props poena, swissspidy, shailu25.
Fixes #59839.
Built from https://develop.svn.wordpress.org/trunk@57569


git-svn-id: http://core.svn.wordpress.org/trunk@57070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-08 19:32:15 +00:00
desrosj
c9522a53b6 Build/Test Tools: Fix bug pulling local environment containers on Apple silicone.
The MySQL Docker containers for versions 5.7 and below do not support recent Apple silicone chips. Previously this was fixed by including `amd64/` as a prefix to the image name in the `docker-compose.yml` file (see [54096]). However, this stopped working after recent updates to Docker Desktop.

This changeset removes the `amd64/` prefix for the image used as the database container and raises the default version of MySQL in the local development environment to the current LTS version (8.0). Because this version is still maintained, there are `arm64` containers available to use.

This also documents a new workaround for contributors looking to run the local Docker environment using MySQL 5.7 or earlier, which entails creating a small `docker-compose.override.yml`.

Props bernhard-reiter, johnbillion, afragen, huzaifaalmesbah.
Fixes #59930.
Built from https://develop.svn.wordpress.org/trunk@57568


git-svn-id: http://core.svn.wordpress.org/trunk@57069 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-08 19:12:14 +00:00
hellofromTonya
f098e2525f Coding Standards: Replace alias join() in WP_Font_Utils.
Replaces the alias `join()` with its canonical `implode()`.

Using the canonical function name for PHP functions is strongly recommended, as aliases may be deprecated or removed without (much) warning.

Follow-up to [57539], [49193].

Props davidbinda.
Fixes #60473.
Built from https://develop.svn.wordpress.org/trunk@57567


git-svn-id: http://core.svn.wordpress.org/trunk@57068 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-08 16:02:14 +00:00
desrosj
17f02c1c02 Build/Test Tools: Unpin PHP 7.4 from the test coverage workflow.
Since being introduced, the GitHub Actions workflow responsible for generating and submitting a test coverage report has used PHP 7.4. At the time, there were some issues with running the test suite on PHP 8.0+ which could have resulted in inaccurate reporting.

The test suite and WordPress in general are much more stable on 8.x now. The test coverage report should now be generated using the Docker container tagged `latest` (currently 8.2).

This will result in a very small decrease in the percentage of lines covered by test (-0.05%), but a slight increase in the percentage of functions and methods covered (+0.08%).

Props johnbillion.
See #59647.
Built from https://develop.svn.wordpress.org/trunk@57566


git-svn-id: http://core.svn.wordpress.org/trunk@57067 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-08 15:37:13 +00:00
gziolo
f31040bcdb Editor: Add viewScriptModule handling to block.json metadata
Syncing changes from the Gutenberg plugin: https://github.com/WordPress/gutenberg/pull/57437.

Scripts and styles can be registered for blocks via `block.json` metadata. There is now a Modules API, but was no way to register or associate module assets with blocks via `block.json`.

Fixes #60233.
Props jonsurrell, gziolo, cbravobernal, luisherranz, youknowriad.


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


git-svn-id: http://core.svn.wordpress.org/trunk@57066 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-08 10:41:13 +00:00
gziolo
f3db86148e Interactivity API: Remove empty file
Missed that when applying patch from GitHub.

Follow-up [57563].
See #60356.
Props: swissspidy.


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


git-svn-id: http://core.svn.wordpress.org/trunk@57065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-08 09:26:11 +00:00
gziolo
802c251971 Interactivity API: Integrate Server Directive Processing
The Interactivity API enables WordPress developers to create dynamic and interactive web experiences with ease using a set of special HTML attributes called directives. Please refer to the [Interactivity API proposal](https://make.wordpress.org/core/2023/03/30/proposal-the-interactivity-api-a-better-developer-experience-in-building-interactive-blocks/) for further details. 

It syncs the changes from the Gutenberg plugin: https://github.com/WordPress/gutenberg/pull/58066.

Fixes #60356.
Props luisherranz, jonsurrell, swissspidy, westonruter, gziolo.


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


git-svn-id: http://core.svn.wordpress.org/trunk@57064 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-08 09:13:09 +00:00
gziolo
b19e148a07 Editor: Introduce WP_Block_Bindings_Source class
Abstracts the block bindings source array into a well-defined object.

Fixes #60447.
See #60282.
Follow-up [57373].
Props czapla, santosguillamot, gziolo.


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


git-svn-id: http://core.svn.wordpress.org/trunk@57063 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-08 08:57:07 +00:00
gziolo
b89d86bde8 Editor: Avoid double escaping on value passed for attribute in HTML tag processor
Fix for the Block Bindings processing.
See https://github.com/WordPress/wordpress-develop/pull/5888#discussion_r1476793062.

Props: czapla, dmsnell, gziolo.


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


git-svn-id: http://core.svn.wordpress.org/trunk@57062 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-08 08:42:07 +00:00
gziolo
0d374ffc6b Editor: Improve code documentation for block bindings
Follow-up [57514].
See #60282.
Props czapla, gziolo, retrofox.


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


git-svn-id: http://core.svn.wordpress.org/trunk@57061 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-08 08:37:09 +00:00
gziolo
3791772c2d Editor: Make asset file optional for block scripts
It is no longer a hard requirement that a *.asset.php file is present to register a script for block. 

Fixes #57234.
Props joefusco, gziolo, spacedmonkey, colorful-tones. 


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


git-svn-id: http://core.svn.wordpress.org/trunk@57060 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-08 08:18:10 +00:00
youknowriad
58b0d3f71f Editor: Register the Google Font collection.
By default, users will see a tab in the editor indicating the possibility
to active Google Fonts and install Fonts from there.

Props youknowriad, get_dave, mcsf.
Fixes #59166.
Built from https://develop.svn.wordpress.org/trunk@57558


git-svn-id: http://core.svn.wordpress.org/trunk@57059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-08 07:38:19 +00:00
youknowriad
812c9ad3da Script Loader: Improve translators comments for wp.date.setSettings in compat file.
Fixing a few translators comments that have incorrect placeholders reference or unnecessary ones.

Props get_dave, mukesh27, afercia.
Fixes #60412.
Built from https://develop.svn.wordpress.org/trunk@57557


git-svn-id: http://core.svn.wordpress.org/trunk@57058 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-08 07:11:08 +00:00
youknowriad
cd2716ff72 Script Loader: Add a timezone offset display value to wp.date.setSettings.
Fixes a bug in the editor where the offset values are displayed as decimals rather than minutes.

Props afercia, get_dave.
Fixes #60105.
Built from https://develop.svn.wordpress.org/trunk@57556


git-svn-id: http://core.svn.wordpress.org/trunk@57057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-08 07:08:13 +00:00
Sergey Biryukov
15ab0f672f Twenty Twenty-Four: Prefix the block pattern category name.
If a plugin also registers the category name `page` in an `init` hook that runs after the theme's, it can override the label and description unintentionally.

With a prefix, extenders can still override it, but it would be intentional.

Props shailu25, poena, acosmin, harshgajipara, swissspidy.
See #59839.
Built from https://develop.svn.wordpress.org/trunk@57555


git-svn-id: http://core.svn.wordpress.org/trunk@57056 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-07 19:45:12 +00:00
joedolson
f3dd3c787c Bundled Theme: Improve focus outline in Twenty Twenty-Four.
Set a global focus outline for block elements in Twenty Twenty-Four to enhance accessibility. Replace the 1px dotted outline previously assigned on the button block.

Props alh0319, poena, beafialho, shailu25.
Fixes #60334.
Built from https://develop.svn.wordpress.org/trunk@57554


git-svn-id: http://core.svn.wordpress.org/trunk@57055 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-07 17:27:10 +00:00
joedolson
7464bdc47a Administration: Improve contrast and consistency of focus styles.
Apply new focus styles from WordPress 5.3 more broadly. An updated focus style for form inputs, buttons, and link styled as buttons was added in WordPress 5.3; this commit makes other focus styles consistent with those changes so they meet accessibility standards for color contrast.

Props johnbillion, kebbet, joedolson, afercia.
Fixes #51870.
Built from https://develop.svn.wordpress.org/trunk@57553


git-svn-id: http://core.svn.wordpress.org/trunk@57054 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-07 16:56:13 +00:00
desrosj
24ea4aaafb Build/Test Tools: Revert [57551].
Problematic changes to the test reporter were merged upstream. This specific SHA also did not fix the issue.

Props javiercasares.
See #59647.
Built from https://develop.svn.wordpress.org/trunk@57552


git-svn-id: http://core.svn.wordpress.org/trunk@57053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-07 13:57:13 +00:00
desrosj
7a65ab4e29 Build/Test Tools: Pin a specific commit for Hosting Test Reporter.
An upstream change in the Hosting Test Reporter is causing failures in the PHPUnit workflow. This temporarily pins an older hash to the step that checks the reporter out.

Props youknowriad.
See #59647.
Built from https://develop.svn.wordpress.org/trunk@57551


git-svn-id: http://core.svn.wordpress.org/trunk@57052 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-07 11:31:11 +00:00
youknowriad
f82169f0bb Editor: Update PHPDoc for block bindings's context arg.
The context argument passed to the hooked_block_types filter can also be a Post object
in the case of the navigation block.
This adapts the PHPDoc accordingly.

Props bernhard-reiter, gziolo.
See #59743.
Built from https://develop.svn.wordpress.org/trunk@57550


git-svn-id: http://core.svn.wordpress.org/trunk@57051 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-07 10:56:08 +00:00
youknowriad
74e189122b Editor: Fix typo in FontUtils doc block.
Initially introduced in [57539]

Props kebbet.
See #59166.
Built from https://develop.svn.wordpress.org/trunk@57549


git-svn-id: http://core.svn.wordpress.org/trunk@57050 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-07 10:36:11 +00:00
youknowriad
b7725a50d3 REST API: Introduce the necessary endpoints for the font library.
This commits add three endpoints to retrieve and manipulate fonts in WordPress.
This commit also means that we now have a fully functional Font Library in the site editor.

Props get_dave, youknowriad, mmaattiiaass, grantmkin, swissspidy, mcsf, jorbin, ocean90.
See #59166.
Built from https://develop.svn.wordpress.org/trunk@57548


git-svn-id: http://core.svn.wordpress.org/trunk@57049 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-07 09:20:08 +00:00
youknowriad
8f1ccc91ae Editor: Fix block style variation selector generation.
These changes fix the generation of selectors for block style variations. Previously, an incorrect CSS selector could be generated if the block's base selector used an element tag etc.

Props aaronrobertshaw, youknowriad, mukesh27.
Fixes #60453.
Built from https://develop.svn.wordpress.org/trunk@57547


git-svn-id: http://core.svn.wordpress.org/trunk@57048 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-07 08:53:13 +00:00
isabel_brison
e692b93540 Script Loader: always output core block global styles after base global styles.
Changes the output of core block global styles when `should_load_separate_core_block_assets` is true so they are appended to base global styles instead of block-library styles.

Props isabel_brison, oandregal, azaozz, ajlende.
Fixes #60280.

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


git-svn-id: http://core.svn.wordpress.org/trunk@57047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-07 04:37:15 +00:00
costdev
c60fc98b33 Upgrade/Install: Introduce Plugin Dependencies.
Introduces a new "Requires Plugins" plugin header so that plugin developers can list the slugs of the plugins theirs depends on.

This will inform users of the requirements, and provide links to the WordPress.org Plugins Repository that they can click to install and activate the dependencies first.

Plugins whose requirements are not met cannot be installed or activated, and they will be deactivated automatically if their requirements become unmet.
Plugins that others rely on cannot be deactivated or deleted until their dependent plugins are deactivated or deleted.

In memory of Alex Mills and Alex King.
WordPress Remembers.

Props ahoereth, afragen, alanfuller, alexkingorg, amykamala, anonymized_10690803, apeatling, ashfame, atimmer, audrasjb, aristath, azaozz, batmoo, beaulebens, blobaugh, bobbingwide, boonebgorges, brianhenryie, chanthaboune, chrisdavidmiles, coolmann, costdev, courane01, danielbachhuber, davidperez, dd32, Denis-de-Bernardy, dingo_d, DJPaul, dougal, DrewAPicture, ethitter, filosofo, georgestephanis, giuseppemazzapica-1, goldenapples, griffinjt, hellofromTonya, husobj, ideag, jarednova, jbobich, jbrinley, jltallon, joedolson, johnciacia, johnjamesjacoby, joppuyo, jsmoriss, karmatosed, kebbet, knutsp, kraftbj, kraftner, kurtpayne, lkraav, logikal16, luisherranz, man4toman, markjaquith, matt, mbijon, megphillips91, mikeschinkel, mordauk, morehawes, mrwweb, mte90, mukesh27, mzaweb, nacin, norcross, nvwd, nwjames, obliviousharmony, ocean90, oglekler, paaljoachim, pauldewouters, pbaylies, pbiron, peterwilsoncc, Philipp15b, poena, pogidude, retlehs, rmccue, ryan, sabreuse, sc0ttkclark, scribu, sereedmedia, SergeyBiryukov, ShaneF, shidouhikari, soean, spacedmonkey, stephenh1988, swissspidy, taylorde, tazotodua, threadi, TimothyBlynJacobs, TJNowell, tollmanz, toscho, tropicalista, Viper007Bond, westi, whiteshadow, williamsba1, wpsmith, ZaneMatthew.
Fixes #22316.
Built from https://develop.svn.wordpress.org/trunk@57545


git-svn-id: http://core.svn.wordpress.org/trunk@57046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-06 23:46:14 +00:00
Aaron Jorbin
15007f8b47 Build/Test Tools: Make the props bot message shorter.
The new default is a git flavored version, while Core wants the SVN flavor. This update is required after https://github.com/WordPress/props-bot-action/pull/61

Props desrosj, jorbin, noisysocks, gziolo.
See #60417.

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


git-svn-id: http://core.svn.wordpress.org/trunk@57045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-06 21:13:13 +00:00
youknowriad
cb6c706152 Editor: Show the patterns page for classic themes.
Block themes and classic themes with template parts support 
can already access the patterns list within the site editor.
This adds a "Patterns" menu item under Appearance for classic themes
without template parts support.

Props wildworks, kevin940726, aaronrobertshaw, fabiankaegy, swissspidy, get_dave, kebbet.
Fixes #58827.
Built from https://develop.svn.wordpress.org/trunk@57543


git-svn-id: http://core.svn.wordpress.org/trunk@57044 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-06 19:42:13 +00:00
dmsnell
b342d5c7b8 HTML API: Join text nodes on invalid-tag-name boundaries.
A fix was introduced to the Tag Processor to ensure that contiguous text
in an HTML document emerges as a single text node spanning the full
sequence. Unfortunately, that patch was marginally over-zealous in
checking if a "<" started a syntax token or not. It used the following:

{{{
<?php
if ( 'A' <= $c && 'z' >= $c ) { ... }
}}}

This was based on the assumption that the A-Z and a-z letters are
contiguous in the ASCII range; they aren't, and there's a gap of
several characters in between. The result of this is that in some
cases the parser created a text boundary when it didn't need to.
Text boundaries can be surprising and can be created when reaching
invalid syntax, HTML comments, and more hidden elements, so
semantically this wasn't a major bug, but it was an aesthetic
challenge.

In this patch the check is properly compared for both upper- and
lower-case variants that could potentially form tag names.

{{{
<?php
if ( ( 'A' <= $c && 'Z' >= $c ) || ( 'a' <= $c && 'z' >= $c ) ) { ... }
}}}

This solves the problem and ensures that contiguous text appears
as a single text node when scanning tokens.

Developed in https://github.com/WordPress/wordpress-develop/pull/6041
Discussed in https://core.trac.wordpress.org/ticket/60385

Follow-up to [57489]
Props dmsnell, jonsurrell
Fixes #60385


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


git-svn-id: http://core.svn.wordpress.org/trunk@57043 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-06 19:23:13 +00:00
Pascal Birchler
892d83f1eb Coding Standards: Fix array key alignment after [57539].
See #59166.
Built from https://develop.svn.wordpress.org/trunk@57541


git-svn-id: http://core.svn.wordpress.org/trunk@57042 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-06 10:58:13 +00:00
youknowriad
adeec9a08a Editor: Fix Font Library PHP unit tests.
These font assets files used in phpunit tests were missing in the original commit [57539].

Props mukesh27.
See #59166.
Built from https://develop.svn.wordpress.org/trunk@57540


git-svn-id: http://core.svn.wordpress.org/trunk@57041 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-06 09:24:09 +00:00
youknowriad
ea8080d8c8 Editor: Introduce the Font Library post types and low level APIs.
This is the first step towards adding the font library to WordPress.
This commit includes the font library and font face CPTs.
It also adds the necessary APIs and classes to register and manipulate font collections.

This PR backports the font library post types and low level APIs to Core. This is the first step to include the font library entirely into Core. Once this merged, we'll open a PR with the necessary REST API controllers.

Props youknowriad, get_dave, grantmkin, swissspidy, hellofromtonya, mukesh27, mcsf.
See #59166.
Built from https://develop.svn.wordpress.org/trunk@57539


git-svn-id: http://core.svn.wordpress.org/trunk@57040 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-06 08:42:12 +00:00
Sergey Biryukov
b769f2b0cd Coding Standards: Rename the $oSelf variable in WP_MatchesMapRegex::apply().
This resolves a WPCS warning:
{{{
Variable "$oSelf" is not in valid snake_case format, try "$o_self"
}}}

Follow-up to [11853], [38376].

See #59650.
Built from https://develop.svn.wordpress.org/trunk@57538


git-svn-id: http://core.svn.wordpress.org/trunk@57039 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-06 01:25:14 +00:00
Peter Wilson
6309a41a68 Upload: Fallback to PclZip to validate ZIP file uploads.
`ZipArchive` can fail to validate ZIP files correctly and report valid files as invalid. This introduces a fallback to `PclZip` to check validity of files if `ZipArchive` fails them.

This introduces the new function `wp_zip_file_is_valid()` to validate archives.

Follow up to [57388].

Props audunmb, azaozz, britner, cdevroe, colorful-tones, costdev, courane01, endymion00, feastdesignco, halounsbury, jeffpaul, johnbillion, jorbin, jsandtro, karinclimber, kevincoleman, koesper, maartenbelmans, mathewemoore, melcarthus, mujuonly, nerdpressteam, olegfuture, otto42, peterwilsoncc, room34, sayful, schutzsmith, stephencronin, svitlana41319, swissspidy, tnolte, tobiasbg, vikram6, welaunchio.
Fixes #60398.

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


git-svn-id: http://core.svn.wordpress.org/trunk@57038 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-05 22:23:06 +00:00
desrosj
3b3adbbdfd Build/Test Tools: Pass a token to the Codecov action.
Version 4 of the action now requires a token to be provided in order to upload coverage results.

Follow up to [57534].

Props swissspidy.
See #59658.
Built from https://develop.svn.wordpress.org/trunk@57536


git-svn-id: http://core.svn.wordpress.org/trunk@57037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-05 22:21:14 +00:00
Pascal Birchler
cfba421707 General: Add tests for array_is_list polyfill added in r57337.
Props costdev.
See #55105.
Built from https://develop.svn.wordpress.org/trunk@57535


git-svn-id: http://core.svn.wordpress.org/trunk@57036 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-05 21:59:13 +00:00
desrosj
b539238a65 Build/Test Tools: Update the codecov/codecov-action action.
This updates the `codecov/codecov-action` from version `3.1.5` to `4.0.1`.

Version 4 switches to using the Codecov CLI to upload test report date, and changes the version of Node.js used for the action to 20.x. This fixes the notices currently shown for the test coverage workflow.

Props: mukesh27.
See #59658.
Built from https://develop.svn.wordpress.org/trunk@57534


git-svn-id: http://core.svn.wordpress.org/trunk@57035 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-05 21:00:13 +00:00
Pascal Birchler
aed15fedb9 Script Loader: Remove unused WP_Scripts::get_unaliased_deps() method.
This private method was introduced in [56033] / #12009 but it's not actually used.
It was part of the inline script implementation which was later reverted before final merge.
The method can be safely removed because it’s private and cannot be used by extenders.

Props joemcgill.
Fixes #60438.
Built from https://develop.svn.wordpress.org/trunk@57533


git-svn-id: http://core.svn.wordpress.org/trunk@57034 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-05 09:43:12 +00:00
Sergey Biryukov
98b3a8d314 Coding Standards: Rename the $expires_offset variable in cache_javascript_headers().
This resolves a WPCS warning:
{{{
Variable "$expiresOffset" is not in valid snake_case format, try "$expires_offset"
}}}

Follow-up to [4109], [21996].

See #59650.
Built from https://develop.svn.wordpress.org/trunk@57532


git-svn-id: http://core.svn.wordpress.org/trunk@57033 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-05 03:42:11 +00:00
Peter Wilson
91b28e5a07 Build/Test Tools: Mock plugin API response in WP_REST_Plugins_Controller_Test.
Avoid false test failures due to network conditions in the `WP_REST_Plugins_Controller_Test` class. This mocks HTTP responses from the plugin information endpoint for the link-manager plugin.

Props: peterwilsoncc, costdev.
See #59647.


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


git-svn-id: http://core.svn.wordpress.org/trunk@57032 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-04 22:04:14 +00:00
Sergey Biryukov
8f3e5f1640 Coding Standards: Rename the $ID parameter to $post_id in trackback().
This resolves a few WPCS warnings:
{{{
Variable "$ID" is not in valid snake_case format, try "$i_d"
}}}

See #59650.
Built from https://develop.svn.wordpress.org/trunk@57530


git-svn-id: http://core.svn.wordpress.org/trunk@57031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-04 18:46:14 +00:00
Sergey Biryukov
0865d6ec9d Coding Standards: Use strict comparison in wp-admin/update-core.php.
Follow-up to [11273], [25784], [54654].

Props wpfy, mukesh27, azaozz, viralsampat.
Fixes #58061, #60415.
Built from https://develop.svn.wordpress.org/trunk@57529


git-svn-id: http://core.svn.wordpress.org/trunk@57030 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-03 14:24:15 +00:00
dmsnell
9fb7267542 HTML API: Fix typo setting the wrong self-closing flag.
The HTML Processor tracks whether a token was found with the self-closing flag.
Depending on the context, this flag may or may not indicate that the element is
self closing. Unfortunately it's been tracking the wrong flag: it's been tracking
the end-tag flag, which indicates that a token is an end tag.

In this patch the right flag is set in the HTML Processor. This hasn't been an
issue because the HTML Processor doesn't yet read that stored flag, but it's an
important fix to make before adding support for foreign content (SVG and MathML)
since that behavior depends on reading the correct flag.

Follow-up to [56274].

Props dmsnell.


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


git-svn-id: http://core.svn.wordpress.org/trunk@57029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-02 23:27:14 +00:00
dmsnell
22b4a0870d HTML API: Reset parser state after seeking to bookmark.
When parser states were introduced, nothing in the `seek()` method reset the
parser state. This is problematic because it could leave the parser in the
wrong state.

In this patch the parser state is reset so that it's properly adjusted on
the successive call to `next_token()`.

Developed in https://github.com/WordPress/wordpress-develop/pull/6021
Discussed in https://core.trac.wordpress.org/ticket/60428

Follow-up to [57211]

Props dmsnell, kevin940726
Fixes #60428


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


git-svn-id: http://core.svn.wordpress.org/trunk@57028 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-02 22:57:18 +00:00
gziolo
742e8aae9c Editor: Refactor the way block bindings sources are handled
It fixes the coding style issues reported. It goes further and improves the code quality it other places where the logic for block bindings was added.

Follow-up for [57514].
Props: gziolo, mukesh27, youknowriad, santosguillamot.
See #60282.


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


git-svn-id: http://core.svn.wordpress.org/trunk@57027 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-02 20:24:12 +00:00
Adam Silverstein
62171b4d26 Media: fix AVIF tests.
Follow up to r57524. Properly add AVIF images for unit tests.

Fixes #51228.


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


git-svn-id: http://core.svn.wordpress.org/trunk@57026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-02 18:50:13 +00:00
Adam Silverstein
f94f194552 Media: enable AVIF support.
Add support for uploading, editing and saving AVIF images when supported by the server.

Add 'image/avif' to supported mime types. Correctly identify AVIF images and sizes even when PHP doesn't support AVIF. Resize uploaded AVIF files (when supported) and use for front end markup.

Props adamsilverstein, lukefiretoss, ayeshrajans, navjotjsingh, Tyrannous, jb510, gregbenz, nickpagz, JavierCasares, mukesh27, yguyon, swissspidy.
Fixes #51228.


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


git-svn-id: http://core.svn.wordpress.org/trunk@57025 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-02 17:48:15 +00:00
desrosj
0faeaecd5d Build/Test Tools: Some improvements to the Props Bot workflow.
This makes a few improvements made to the Props Bot workflow:

- The bot will no longer run on draft PRs.
- The bot will no longer run on closed PRs.
- The bot will no longer run when a comment is deleted (this should almost never happen).

Props mamaduka, gziolo.
See #60417.
Built from https://develop.svn.wordpress.org/trunk@57523


git-svn-id: http://core.svn.wordpress.org/trunk@57024 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-02 16:37:13 +00:00
Sergey Biryukov
6f6b383040 Coding Standards: Use strict comparison for functions lookup in plugin/theme editors.
Follow-up to [10607], [44617].

Props upadalavipul.
See #60415.
Built from https://develop.svn.wordpress.org/trunk@57522


git-svn-id: http://core.svn.wordpress.org/trunk@57023 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-02 15:30:12 +00:00
gziolo
86121f4f25 Editor: Add allowed_blocks field to block registration and REST API
There is a new block.json field called allowedBlocks, added in Gutenberg in https://github.com/WordPress/gutenberg/pull/58262. This adds support for this new field also on the server. 

Props: gziolo, jsnajdr.
Fixes #60403.



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


git-svn-id: http://core.svn.wordpress.org/trunk@57022 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-02 13:01:21 +00:00
Andrea Fercia
a9bb1bb5f7 Administration: Accessibility: Use the default cursor style for labels and disabled form controls.
The native cursor style for labels and form controls is `default`, which is the platform-dependent default cursor. Typically an arrow. Historically, WordPress always used the `pointer` style for all form controls and labels. While this isn't standard, there is some value in using the `pointer` style for form controls. However, labels should use the default style especially when the associated controls are disabled.
Additionally, makes sure the disabled styling works for form controls with an `aria-disabled="true"` attribute.

Props joedolson, afercia.
Fixes #59733.

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


git-svn-id: http://core.svn.wordpress.org/trunk@57021 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-02 09:55:14 +00:00
Pascal Birchler
4c37cdc1a4 I18N: Add type declaration to new method missed in [57518].
See #59656.
Built from https://develop.svn.wordpress.org/trunk@57519


git-svn-id: http://core.svn.wordpress.org/trunk@57020 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-02 09:07:14 +00:00
Pascal Birchler
953e148764 I18N: Fix plural forms parsing in WP_Translation_File.
Ensures the plural expression from the translation file header is correctly parsed.
Prevents silent failures in the attempt to create the plural form function.

Adds additional tests.

Props Chouby.
See #59656.
Built from https://develop.svn.wordpress.org/trunk@57518


git-svn-id: http://core.svn.wordpress.org/trunk@57019 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-01 20:59:14 +00:00
desrosj
18c47606f2 Build/Test Tools: Introduce Props Bot workflow.
Props Bot is a new GitHub Action that will compile a list of contributors for a given pull request. The bot will leave a comment with a list of contributors formatted for use in both Trac SVN and GitHub.

Props dharm1025, desrosj, jorbin, jeffpaul, dd32, pento, gziolo, swissspidy, talldanwp, noisysocks, youknowriad, peterwilsoncc, joemcgill, chrisdavidmiles, wpscholar, annezazu, chanthaboune, desrosjbot.
See #60417.
Built from https://develop.svn.wordpress.org/trunk@57517


git-svn-id: http://core.svn.wordpress.org/trunk@57018 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-01 19:28:19 +00:00
Pascal Birchler
5b1d220d1e I18N: Support loading .l10n.php translation files on their own.
Adjusts the translation file lookup in `WP_Textdomain_Registry` so that just-in-time translation loading
works even if there is only a `.l10n.php` translation file without a corresponding `.mo` file.

While language packs continue to contain both file types, this makes it easier to use translations in a project
without having to deal with `.mo` or `.po` files.

Props Chrystl.
See #59656.
Built from https://develop.svn.wordpress.org/trunk@57516


git-svn-id: http://core.svn.wordpress.org/trunk@57017 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-01 19:05:13 +00:00
joedolson
3664cc3698 Media: Prevent local edits during media upload.
Prevent `options.allowLocalEdits` from toggling to true during the upload cycle. Otherwise, media meta fields can be edited, but the data will be lost as soon as the upload process is completed.

Props codepo8, oglekler, nicolefurlan, antpb, syamraj24, joedolson.
Fixes #58783, #23374.
Built from https://develop.svn.wordpress.org/trunk@57515


git-svn-id: http://core.svn.wordpress.org/trunk@57016 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-01 16:28:15 +00:00
youknowriad
a2786a3785 Editor: Add the Block Bindings API.
This introduces the Block Bindings API for WordPress.

The API allows developers to connects block attributes to different sources. In this PR, two such sources are included: "post meta" and "pattern". Attributes connected to sources can have their HTML replaced by values coming from the source in a way defined by the binding.

Props czapla, lgladdy, gziolo, sc0ttkclark, swissspidy, artemiosans, kevin940726, fabiankaegy, santosguillamot, talldanwp, wildworks.
Fixes #60282.
Built from https://develop.svn.wordpress.org/trunk@57514


git-svn-id: http://core.svn.wordpress.org/trunk@57015 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-01 12:54:15 +00:00
Pascal Birchler
3af51954e0 I18N: Improve singular lookup of pluralized strings.
Ensures that string lookup in MO files only uses the singular string.

This matches expected behavior with gettext files and improves compatibility for cases where for example both `__( 'Product' )` and `_n( 'Product', 'Products’, num )` are used in a project, where both will use the same translation for the singular version. Maintains backward compatibility and feature parity with the pomo library and the PHP translation file format.

Replaces [57386], which was reverted in [57505], with a more accurate and performant solution.

See #59656.
Built from https://develop.svn.wordpress.org/trunk@57513


git-svn-id: http://core.svn.wordpress.org/trunk@57014 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-01 11:45:16 +00:00
Sergey Biryukov
7a7f7ec0d3 Twenty Fifteen: Fix typo in css/blocks.css.
Follow-up to [43798].

Props shailu25, harshgajipara.
Fixes #60383.
Built from https://develop.svn.wordpress.org/trunk@57512


git-svn-id: http://core.svn.wordpress.org/trunk@57013 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-01 11:33:17 +00:00
youknowriad
7d60c616d1 Editor: Add deprecated functions from interactivity core blocks.
In 6.5 we are removing a couple of functions in Core blocks that were enqueuing the files needed to add that interactivity. Interactivity is handled with modules, so those functions are not needed anymore and are deprecated.

Props swissspidy, cbravobernal.
Fixes #60380.
Built from https://develop.svn.wordpress.org/trunk@57511


git-svn-id: http://core.svn.wordpress.org/trunk@57012 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-01 09:31:12 +00:00
youknowriad
4624f178a3 Editor: Remove shadow support via direct attribute.
Shadow block support should always rely on the style attribute instead.

Props madhudollu.
Fixes #60377.
Built from https://develop.svn.wordpress.org/trunk@57510


git-svn-id: http://core.svn.wordpress.org/trunk@57011 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-01 09:26:15 +00:00
Pascal Birchler
a8616f8e33 Docs: Fix typo in do_robots() docblock.
This was introduced in [45928].

Props shailu25, mukesh27.
Fixes #60405.
Built from https://develop.svn.wordpress.org/trunk@57509


git-svn-id: http://core.svn.wordpress.org/trunk@57010 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-01 08:40:16 +00:00
dmsnell
8be95c6c7c HTML API: Test cleanup
Rename `$p` variable to `$processor` in tests for clarity.

Use static data providers. A mix of static and non-static data providers were
used in HTML API tests.  Data providers are required to be static in the next
PHPUnit version and there's no harm in using them consistently now.

Follow-up to [57507]

Props jonsurrell
See #59647


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


git-svn-id: http://core.svn.wordpress.org/trunk@57009 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-01 01:02:15 +00:00
dmsnell
0dc136bcb9 HTML API: Fix void tag nesting with next_token
When `next_token()` was introduced, it introduced a regression in the HTML
Processor whereby void tags remain on the stack of open elements when they
shouldn't. This led to invalid values returned from `get_breadcrumbs()`.

The reason was that calling `next_token()` works through a different code path
than the HTML Processor runs everything else. To solve this, its sub-classed
`next_token()` called `step( self::REPROCESS_CURRENT_TOKEN )` so that the proper
HTML accounting takes place.

Unfortunately that same reprocessing code path skipped the step whereby void
and self-closing elements are popped from the stack of open elements.

In this patch, that step is run with a third mode for `step()`, which is the
new `self::PROCESS_CURRENT_TOKEN`. This mode acts as if `self::PROCESS_NEXT_NODE`
were called, except it doesn't advance the parser.

Developed in https://github.com/WordPress/wordpress-develop/pull/5975
Discussed in https://core.trac.wordpress.org/ticket/60382

Follow-up to [57348]

Props dmsnell, jonsurrell
Fixes #60382


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


git-svn-id: http://core.svn.wordpress.org/trunk@57008 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-01 00:43:15 +00:00
dmsnell
4266e2daf5 HTML API: Fix CDATA lookalike matching invalid CDATA
When `next_token()` was introduced to the HTML Tag Processor, it started
classifying comments that look like they were intended to be CDATA sections.
In one of the changes made during development, however, a typo slipped
through code review that treated comments as CDATA even if they only
ended in `]>` and not the required `]]>`.

The consequences of this defect were minor because in all cases these are
treated as HTML comments from invalid syntax, but this patch adds the
missing check to ensure the proper reporting of CDATA-lookalikes.

Follow-up to [57348]

Props jonsurrell
Fixes #60406


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


git-svn-id: http://core.svn.wordpress.org/trunk@57007 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-01 00:12:14 +00:00
Pascal Birchler
ec68b4743e I18N: Revert [57386] pending further investigation.
Reverts the change for fallback string lookup due to a performance regression in the bad case scenario.

See #59656.
Built from https://develop.svn.wordpress.org/trunk@57505


git-svn-id: http://core.svn.wordpress.org/trunk@57006 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-31 21:51:14 +00:00
Pascal Birchler
e9b8c1cd49 I18N: Load new translation library in wp_load_translations_early().
Ensures localization continues to work as expected with the new library in case
translations need to be loaded early in the process.

See #59656.
Built from https://develop.svn.wordpress.org/trunk@57504


git-svn-id: http://core.svn.wordpress.org/trunk@57005 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-31 21:28:15 +00:00
Pascal Birchler
d8996a3c77 Script Loader: Use a global variable in wp_script_modules().
This brings the function more in line with its related `wp_scripts()` and `wp_styles()` functions and makes it easier to reset the class instance in tests.

Props westonruter, luisherranz.
See #56313.
Built from https://develop.svn.wordpress.org/trunk@57503


git-svn-id: http://core.svn.wordpress.org/trunk@57004 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-31 18:16:14 +00:00
Pascal Birchler
1550a2bf77 Twenty Twenty-Three: Rename Comments template part.
This renames the Comments template part to 'Comments Template Part', to reduce confusion with the 'Comments' block when viewing both in the inserter.

Props mikachan, mukesh27, poena.
Fixes #56999.
Built from https://develop.svn.wordpress.org/trunk@57502


git-svn-id: http://core.svn.wordpress.org/trunk@57003 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-31 13:05:53 +00:00
Pascal Birchler
1942f49fe6 HTTP API: Ensure cookie names are cast to strings.
Props nosilver4u, darssen, kraftbj, engahmeds3ed, barry.hughes, schlessera.
Fixes #58566.
Built from https://develop.svn.wordpress.org/trunk@57501


git-svn-id: http://core.svn.wordpress.org/trunk@57002 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-31 13:03:57 +00:00