44871 Commits

Author SHA1 Message Date
Robert Anderson
53bd78fd92 Restore block PHP to canonical version in @wordpress/block-library
r52272 erroneously modified `src/wp-includes/blocks/navigation.php`. This file
is copied from `@wordpress/block-library` and so must be updated via npm. This
commit restores the file by running `grunt build --dev`.

Follows [52272].
See #54506.


git-svn-id: https://develop.svn.wordpress.org/trunk@52273 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-29 23:29:52 +00:00
Jonny Harris
a9e66f4bcb Editor: Remove Navigation Areas
Navigation area were merged as part of full site editing and the new navigation block. This functionality is experimental and not currently used in WordPress core, so should be removed.

Props noisysocks, spacedmonkey, get_dave, zieladam.
Fixes #54506.



git-svn-id: https://develop.svn.wordpress.org/trunk@52272 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-29 22:04:48 +00:00
Jb Audras
ccf7ca5a6f Twenty Twenty: Restore Editor post title styles after Gutenberg 11.4.0 updates.
This change restores the Editor post title alignement and font styles in Twenty Twenty after Gutenberg 11.4.0 updates on the editor markup.

Props shireling, mai21, hilayt24, desrosj, sabernhardt.
Fixes #54056.


git-svn-id: https://develop.svn.wordpress.org/trunk@52271 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-29 22:02:32 +00:00
Tonya Mork
cc17d8c4cb Media: Replace tests/phpunit/data/images/sugar-mountain.jpg test image.
The test image included in [52269] was invalid at 0 bytes. This commit adds the correct test image.

Follow-up [52269].

See #54385.

git-svn-id: https://develop.svn.wordpress.org/trunk@52270 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-29 20:16:32 +00:00
Tonya Mork
8aa625b795 Media: Fix TypeError and improve wp_exif_frac2dec() to only return int or float.
For certain images, `wp_exif_frac2dec()` unexpectedly returned a string instead of `int` or `float`. This can occur when an image is missing meta and calls the function with `'0/0'`. For those images, a fatal error was thrown on PHP 8.0+:

{{{
TypeError: round(): Argument #1 ($num) must be of type int|float, string given
}}}

Upon deeper review, inconsistent and unexpected results were returned from different types of input values passed to the function.

Changes are:

* Maintains backwards-compatibility for valid input values.
* Fixes handling of invalid input values by bailing out to return the documented type of `int|float` by returning `0`.
* Improves the fractional conditional check.
* Improves the calculated fraction handling to ensure (a) the numerator and denominator are both numeric and (b) the denominator is not equal to zero.
* Safeguards the behavior via tests for all possible ways code could flow through the function.
* Safeguards the backwards-compatibility of the `wp_read_image_metadata()` by adding some defensive coding around the calls to the `wp_exif_frac2dec()` function.

These changes fix the fatal error and make the function more secure, stable, and predictable while maintaining backwards-compatibility for valid input values.

Follow-up to [6313], [9119], [22319], [28367], [45611], [47287].

Props adamsilverstein, jrf, peterwilsoncc, praem90, stevegs, tobiasbg.
Fixes #54385.

git-svn-id: https://develop.svn.wordpress.org/trunk@52269 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-29 19:34:51 +00:00
Jonny Harris
4ff41edf97 REST API: Ensure that the rest_after_insert_ action is executed in the templates controller.
Fire the that dynamic action `rest_after_insert_{$this->post_type}` in templates controller, as this action is fired in other post based REST API controllers. 

Props spacedmonkey, peterwilsoncc, zieladam.
Fixes #54520.

git-svn-id: https://develop.svn.wordpress.org/trunk@52268 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-29 11:41:50 +00:00
Jb Audras
64b7eb383a Feeds: Remove reference to wp-atom.php in Atom feeds xml:base attribute.
This change removes the optional `xml:base` attribute for Atom based feeds as `wp-atom.php` file was removed in [18540] (WordPress 3.3).

Follow-up to [18540].

Props tw2113, audrasjb, mukesh27.
Fixes #47955.


git-svn-id: https://develop.svn.wordpress.org/trunk@52267 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-29 09:50:13 +00:00
Sergey Biryukov
94421fc210 Tests: Replace assertEquals() with assertSame() in block template tests.
This ensures that not only the return values match the expected results, but also that their type is the same.

Going forward, stricter type checking by using `assertSame()`, `assertSameSets()`, or `assertSameSetsWithIndex()` should generally be preferred, to make the tests more reliable.

Follow-up to [51003], [51079], [52062], [52265].

See #53364, #53363, #54335.

git-svn-id: https://develop.svn.wordpress.org/trunk@52266 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-29 08:45:31 +00:00
Sergey Biryukov
10cec96f8c Tests: Rename classes in block template tests per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [51003], as a continuation of the previous changes in ​[47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969], [51491], [51492], [51493], [51623], [51639], [51646], [51650], [51651], [51860], [52264].

See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@52265 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-29 03:21:26 +00:00
Sergey Biryukov
e5882f4c20 Tests: Rename classes in phpunit/tests/block-supports/ per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [52069], as a continuation of the previous changes in ​[47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969], [51491], [51492], [51493], [51623], [51639], [51646], [51650], [51651], [51860].

See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@52264 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-29 03:10:55 +00:00
Jb Audras
72e36d0b86 Media: Ensure media preview is fully viewable in the "Add Media" modal.
This change ensures the media preview is not cut off in the "Add Media" modal box, when using the "Insert from URL" feature.

Props siliconforks, sabernhardt, mukesh27, ankit-k-gupta.
Fixes #53636.


git-svn-id: https://develop.svn.wordpress.org/trunk@52263 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-28 23:09:16 +00:00
Jb Audras
9f56ce822e Script Loader: Enqueue block stylesheet only when the corresponding block is used.
Before this change, block stylesheets were enqueued although the corresponding blocks were not used in the current post, even if the `should_load_separate_core_block_assets` filter was set to `true`.

Props shimotomoki, devutpol, audrasjb.
Fixes #54457.


git-svn-id: https://develop.svn.wordpress.org/trunk@52262 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-28 21:10:08 +00:00
Jb Audras
5fb4b61339 Editor: Ensure block style name does not contain spaces before creating the class.
This change adds a check to ensure there is no spaces in block style variation names before generating the class. Returns `false` and a `_doing_it_wrong()` message if a space is detected.

Props amustaque97, costdev, hellofromtonya, pbiron, SergeyBiryukov, afragen.
Fixes #54296.


git-svn-id: https://develop.svn.wordpress.org/trunk@52261 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-28 13:51:23 +00:00
Sergey Biryukov
8de99e840f Tests: Temporarily disable the check that the current recommended PHP version is actively supported.
As PHP 7.4 moved from active support to security support until 28 Nov 2022, and no discussions or decisions have been made yet on bumping the recommended version to PHP 8.0, this commit disables the failing assertion for now.

This should be revisited once WordPress achieves PHP 8.0 compatibility and the recommended PHP version in `readme.html` can be bumped, or another decision is made about this.

Follow-up to [26166], [33937], [33944], [33946], [35172], [39582], [39583], [40241], [46682], [46996], [46998].

Props costdev, audrasjb.
Fixes #54528.

git-svn-id: https://develop.svn.wordpress.org/trunk@52260 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-28 10:34:18 +00:00
Sergey Biryukov
ca2b4936b3 Tests: Use a simpler approach to test the output in some tests.
Instead of ignoring the output and catching it later with `getActualOutput()`, we can use `expectOutputRegex()` directly, which evaluates the output after the rest of the test code has run, if no unexpected errors were encountered.

Follow-up to [52173], [52253].

Props jrf.
See #53635, #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@52259 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-27 16:16:15 +00:00
Jb Audras
164a61aeb6 Taxonomy: Check $term object before using it in get_term_feed_link().
This change performs the type safety check on `$term` before it is used to retrieve the taxonomy in `get_term_feed_link()`. It also updates the related DocBlock after [52255].

Follow up to [52255].

Props dlh.
Fixes #50225.


git-svn-id: https://develop.svn.wordpress.org/trunk@52258 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-27 15:22:17 +00:00
Sergey Biryukov
90ed1d3397 Docs: Remove inaccurate part of the screen_settings filter description.
The filter is called for all admin screens, not just the Widgets screen.

Follow-up to [27256].

Props Starbuck.
Fixes #54524.

git-svn-id: https://develop.svn.wordpress.org/trunk@52257 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-27 02:05:25 +00:00
Jb Audras
a9e8641a2b Media: Allow setting custom image alt text in custom header image.
This change applies the alternative text assigned to the custom header image, if available. Otherwise, it leaves it empty. It fixes an issue where the alternative text was always the site title, which is not relevant in most use cases.

Props webmandesign, mukesh27, afercia, anevins, mikeschroder, nrqsnchz, audrasjb, sabernhardt, joedolson, Boniu91.
Fixes #46124.


git-svn-id: https://develop.svn.wordpress.org/trunk@52256 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-26 22:54:10 +00:00
Jb Audras
7b9e33a1e7 Taxonomy: Use WP_Term object to retrieve the taxonomy in get_term_feed_link().
This change fixes a backward compatibility issue introduced in [52180] where `get_term_feed_link()` did not honor the `$taxonomy` parameter anymore. Rather than using the default `category` taxonomy when passing a term ID in `get_term_feed_link()`, use the `WP_Term` object to get the taxonomy.

Follow-up to [52180].

Props hugod.
Fixes #50225.


git-svn-id: https://develop.svn.wordpress.org/trunk@52255 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-26 11:41:24 +00:00
Sergey Biryukov
2bf2496342 External Libraries: Update getID3 to version 1.9.21.
The latest version includes preliminary PHP 8.1 support, as well as a variety of bug fixes.

Release notes: https://github.com/JamesHeinrich/getID3/releases/tag/v1.9.21

A full list of changes in this update can be found on GitHub:
https://github.com/JamesHeinrich/getID3/compare/v1.9.20...v1.9.21

This commit also includes:
* Setting the `$options_audiovideo_quicktime_ReturnAtomData` property (now `false` by default) to `true` in `wp_read_video_metadata()` and `wp_read_audio_metadata()` in order to get the `created_timestamp` value.
* PHPCS adjustments previously made for a passing PHP Compatibility scan.

Follow-up to [47601], [47737], [47902], [48278], [49621], [50714].

Props jrf, SergeyBiryukov.
Fixes #54162.

git-svn-id: https://develop.svn.wordpress.org/trunk@52254 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-26 03:04:10 +00:00
Sergey Biryukov
6717df2b48 Tests: Remove unexpected output in wp_dashboard_recent_drafts() tests on PHP 8.1.
This follows the approach used in other tests to let PHPUnit manage the output catching and effectively ignore the output until retrieving it later via `getActualOutput()`.

Follow-up to [45505], [51968], [52173].

See #53635, #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@52253 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-26 01:27:42 +00:00
Sergey Biryukov
f38f9b9971 External Libraries: Upgrade PHPMailer to version 6.5.3.
The latest release includes official PHP 8.1 support, as well as some small bug fixes, including one for PHP 5.6 cross-version support.

Release notes:
* https://github.com/PHPMailer/PHPMailer/releases/tag/v6.5.2
* https://github.com/PHPMailer/PHPMailer/releases/tag/v6.5.3

For a full list of changes in this update, see the PHPMailer GitHub:
https://github.com/PHPMailer/PHPMailer/compare/v6.5.1...v6.5.3

Follow-up to [50628], [50799], [51169], [51634], [51635].

Props jrf, Synchro.
Fixes #54514.

git-svn-id: https://develop.svn.wordpress.org/trunk@52252 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-26 00:41:54 +00:00
Sergey Biryukov
45d52ca3be Docs: Improve consistency of some DocBlocks in wp-admin/includes/post.php.
Follow-up to [52249].

See #53399.

git-svn-id: https://develop.svn.wordpress.org/trunk@52251 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-26 00:26:17 +00:00
Jb Audras
d939ada7a9 Twenty Twenty One: Remove Image block placeholder alignment override in editor styles.
This changes excludes the Image block placeholder from the default image centering in Twenty Twenty-One editor styles.

Props multidots1896, sabernhardt, Boniu91, justinahinon.
Fixes #54254.


git-svn-id: https://develop.svn.wordpress.org/trunk@52250 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-25 22:29:49 +00:00
Jb Audras
1ef4bafe1a Docs: Miscellaneous DocBlock corrections in wp-admin/includes/post.php.
See #53399.


git-svn-id: https://develop.svn.wordpress.org/trunk@52249 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-25 20:37:34 +00:00
John Blackbourn
21a7515fdb Build/Test Tools: Correct the order and naming of expected and actual values in various tests.
This corrects the order of the parameters when used in assertions so if/when they fail the failure message is correct.

See #53363


git-svn-id: https://develop.svn.wordpress.org/trunk@52248 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-25 19:39:31 +00:00
Riad Benguella
b90fc1b6dd Themes: Update the base folders for templates and template parts in block themes.
Block Themes should now use the following folders:

 - templates instead of block-templates
 - parts instead of block-template-parts

Existing themes and folders will continue to work without impact.

Props bernhard-reiter.
Fixes #54493.


git-svn-id: https://develop.svn.wordpress.org/trunk@52247 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-25 10:57:19 +00:00
Riad Benguella
90cdaabd2f Themes: Add block template resolution algorithm unit tests.
Backports the unit tests for block templates
and hybrid themes template resolution from the Gutenberg plugin.

Props bernhard-reiter, jorgefilipecosta.
Fixes #54478. 


git-svn-id: https://develop.svn.wordpress.org/trunk@52246 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-25 09:20:03 +00:00
Jb Audras
388b59319e Media: Replace some array keys with their numeric equivalent.
This change replaces `['0']` with `[0]` which brings better consistency, readability and performance.

Props chintan1896, adamsilverstein, costdev.
Fixes #53540.


git-svn-id: https://develop.svn.wordpress.org/trunk@52245 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-25 08:34:01 +00:00
Sergey Biryukov
53d604365e External Libraries: Update the Requests library to version 2.0.0.
This is a major release and contains breaking changes.

Most important changes to be aware of for this release:
* All code is now namespaced. Though there is a full backward compatibility layer available and the old class names are still supported, using them will generate a deprecation notice (which can be silenced by plugins if they'd need to support multiple WP versions). See the [https://requests.ryanmccue.info/docs/upgrading.html upgrade guide] for more details.
* A lot of classes have been marked `final`. This should generally not affect userland code as care has been taken to not apply the `final` keyword to classes which are known to be extended in userland code.
* Extensive input validation has been added to Requests. When Requests is used as documented though, this will be unnoticable.
* A new `WpOrg\Requests\Requests::has_capabilities()` method has been introduced which can be used to address #37708.
* A new `WpOrg\Requests\Response::decode_body()` method has been introduced which may be usable to simplify some of the WP native wrapper code.
* Remaining PHP 8.0 compatibility fixed (support for named parameters).
* PHP 8.1 compatibility.

Release notes: https://github.com/WordPress/Requests/releases/tag/v2.0.0

For a full list of changes in this update, see the Requests GitHub:
https://github.com/WordPress/Requests/compare/v1.8.1...v2.0.0

Follow-up to [50842], [51078].

Props jrf, schlessera, datagutten, wojsmol, dd32, dustinrue, soulseekah, costdev, szepeviktor.
Fixes #54504.

git-svn-id: https://develop.svn.wordpress.org/trunk@52244 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-25 01:10:30 +00:00
Robert Anderson
5349ecdc99 Themes: Move the skip link to outside the canvas in block themes
Fix Twenty Twenty-one having an erroneous margin above the Header template part
by moving the skip link outside of the wp-site-blocks canvas.

This is a backport of https://github.com/WordPress/gutenberg/pull/34986.

Props youknowriad.
Fixes #54491.





git-svn-id: https://develop.svn.wordpress.org/trunk@52243 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-25 01:05:30 +00:00
Sergey Biryukov
37abb3a470 Docs: Miscellaneous DocBlock corrections.
See #53399.

git-svn-id: https://develop.svn.wordpress.org/trunk@52242 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-24 23:58:20 +00:00
Jonathan Desrosiers
cb67c52be2 Build/Test Tools: Configure Dependabot scanning for GitHub Actions.
This eliminates the need to manually check all GitHub Actions used within workflow files for updates.

Fixes #54503.

git-svn-id: https://develop.svn.wordpress.org/trunk@52241 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-24 14:49:24 +00:00
Jonathan Desrosiers
e7c8bf8fa7 Build/Test Tools: Specify NodeJS version 14.x in the .nvmrc file.
As of 2021-10-26, the LTS version of NodeJS is now `16.x`.

This pins the `14.x` version in the `.nvmrc` file to ensure contributors are able to contribute without issue until compatibility with version `16.x` can be confirmed in both `trunk` and the Gutenberg repository on GitHub.

Fixes #54502.

git-svn-id: https://develop.svn.wordpress.org/trunk@52240 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-24 14:05:31 +00:00
Jb Audras
9e64321e41 Docs: Document the globals used in some Privacy API methods.
See #53399.


git-svn-id: https://develop.svn.wordpress.org/trunk@52239 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-24 11:39:14 +00:00
Peter Wilson
03d2275051 Twenty Twenty-One: Combine duplicate CSS rules.
Use the postcss-merge-rules package when building TT1 stylesheets to reduce duplicate code in production CSS.

Props SergeyBiryukov, ryelle, Shaharyar10, shital-patel, mukesh27, poena.
Fixes #53605.



git-svn-id: https://develop.svn.wordpress.org/trunk@52238 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-24 03:33:02 +00:00
Jb Audras
5252489c0c Twenty Twenty-One: Style adjustments for list-based widgets in the widget editor.
This change brings style consistency between front-end and widget editor for list-based widgets.

Props circlecube, Rahmohn.
Fixes #53629.


git-svn-id: https://develop.svn.wordpress.org/trunk@52237 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-23 23:23:38 +00:00
John Blackbourn
7723214065 Docs: Various docblock corrections and improvements.
See #53399


git-svn-id: https://develop.svn.wordpress.org/trunk@52236 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-23 21:35:57 +00:00
Tonya Mork
0725caf9a0 Build/Test Tools: Fix warnings from stdClass::__invoke() callback mocks in REST API tests.
When running core tests on PHPUnit 8.x and 9.x, four non-blocking warnings were displayed for the REST API tests:

{{{
There were 4 warnings:

1) Tests_REST_Request::test_route_level_validate_callback
createPartialMock called with method(s) __invoke that do not exist in stdClass. This will not be allowed in future versions of PHPUnit.

2) Tests_REST_Request::test_route_level_validate_callback_no_parameter_callbacks
createPartialMock called with method(s) __invoke that do not exist in stdClass. This will not be allowed in future versions of PHPUnit.

3) Tests_REST_Request::test_route_level_validate_callback_is_not_executed_if_parameter_validation_fails
createPartialMock called with method(s) __invoke that do not exist in stdClass. This will not be allowed in future versions of PHPUnit.

4) Tests_REST_Server::test_callbacks_are_not_executed_if_request_validation_fails
createPartialMock called with method(s) __invoke that do not exist in stdClass. This will not be allowed in future versions of PHPUnit.
}}}

These warnings are due to the PHP native `stdClass` not having a `__invoke()` method declared.

This commit adds a `Mock_Invokable` reusable class and replaces the `stdClass` with this new class.

Follow-up to [48945], [48947].

Props sourovroy, jrf.
Fixes #53844.

git-svn-id: https://develop.svn.wordpress.org/trunk@52235 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-23 18:55:23 +00:00
Sergey Biryukov
c16bc1228c Docs: Add a @since note and description to wp_kses_attr() for new attribute-related KSES options:
* Support for an array of allowed values for attributes.
* Support for required attributes.

Follow-up to [51963].

See #54261.

git-svn-id: https://develop.svn.wordpress.org/trunk@52234 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-23 18:37:03 +00:00
John Blackbourn
7a70bc55dc Build/Test Tools: Lower the timeout for GitHub Actions jobs so runaway or stalled processes don't risk running for the default timeout duration of six hours.
See #53363


git-svn-id: https://develop.svn.wordpress.org/trunk@52233 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-23 17:40:00 +00:00
Robert Anderson
a86125d5c1 Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- FSE: Add welcome guide
- Update theme styles for the code block
- Add feature flag to toggle the new site editor sidebar
- Add templates list page for site editor
- Cover Block: Fix default background dim
- E2E: Add more Cover block tests
- Cover Block: Fix regressions
- Post Comments Form: ensure typography styles are applied to child elements
- Navigation: Fix space-between
- Fix background colours in nested submenus.
- Fix duplicate custom classnames in navigation submenu block
- Fix colour rendering in Navigation overlay
- Fix: Add ability to opt out of Core color palette V2
- Change @package to WordPress in block-library
- Make the core color palette opt-in for themes with not theme.json
- Remove textdomain from calendar block
- Page List block: fix space before href attribute
- Try: Let Featured Image block inherit dimensions, look like a placeholder
- [Global Styles]: Add block icon next to blocks list
- Page List: Use core entities instead of direct apiFetch
- Site Editor: Stabilize export endpoint
- Fix mobile horizontal scrollbar.
- Multi-entity save: Only set site entity to pending if really saving
- Add page list to navigation direct insert conditions
- Implement "Add New" for templates list in Site Editor
- Post Featured Image: Remove withNotices HOC
- Fix page list missing button styles when set to open on click.
- Make appender fixed position to avoid jumps in the UI
- Color UI component: reorder palettes and update names (core by defaults, user by custom)
- Remove the Styles link in Site Editor
- GlobalStyles sidebar: do not show default palette if theme opts-out
- Only render the site editor canvas when the global styles are ready.
- Global Styles: rename core origin key to default for presets
- Clarify i18n context for PostTemplateActions's "New" label
- Revert erroneous native editor package version bumps
- Try: Hide the columns inserter in pattern previews.
- Fix site editor region navigation
- Update navigation sidebar responsiveness
- Add _wp_array_set and _wp_to_kebab_case to 5.8 compat
- Make user able to change all color palette origins
- Site Editor: Update hrefs to not specifically refer to themes.php?page=gutenberg-edit-site
- Site Editor: Validate the postType query argument
- Navigation: Scale submenu icon.
- Move the theme editor under tools for FSE themes
- Deprecate navigation areas

See #54487.


git-svn-id: https://develop.svn.wordpress.org/trunk@52232 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-23 05:38:45 +00:00
Sergey Biryukov
4dea8f5945 Editor: Check the correct post type support property for initial_edits.
The property to check should be `editor` instead of `content`, as posts don't have a `content` support property.

This addresses an e2e test failure in Gutenberg.

Follow-up to [52230].

Props talldanwp.
See #53813.

git-svn-id: https://develop.svn.wordpress.org/trunk@52231 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-22 08:40:26 +00:00
Jb Audras
c7b330801d Editor: Do not provide initial_edits for properties that are not supported by the current post type.
Previously, the block editor initialization always provided "title", "content" and "excerpt" initial edits in the `initializeEditor` call even though these properties might not be supported by the current post type being edited. This leads to a bug in the post editor where as soon as one would open a "new post", the editor considers the content "dirty", meaning changes are applied and it is not possible to leave the editor without encountering an "unsaved changes" notice.

This change updates the `$initial_edits` variable declaration to only provide the properties that are supported by the current post type.

Props youknowriad, h71.
Fixes #53813.


git-svn-id: https://develop.svn.wordpress.org/trunk@52230 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-21 19:26:08 +00:00
Sergey Biryukov
fcbf4617f9 KSES: Use correct global in wp_kses_xml_named_entities().
This fixes a discrepancy where the the global name used in the function did not match the one declared at the beginning of `kses.php`, and ensures that the function gets the correct array of allowed XML entity names.

Includes unit tests.

Follow-up to [48072].

Props ovidiul, costdev, peterwilsoncc, SergeyBiryukov.
Fixes #54060.

git-svn-id: https://develop.svn.wordpress.org/trunk@52229 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-21 17:15:26 +00:00
Sergey Biryukov
d55cf2b71e Coding Standards: Wrap some long lines in js/_enqueues/admin/post.js per the JS coding standards for better readability.
See #53359.

git-svn-id: https://develop.svn.wordpress.org/trunk@52228 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-20 02:48:08 +00:00
Sergey Biryukov
956e81c605 Docs: Update documentation for the $plugin_data parameter of various hooks:
* Document the structure of the `$plugin_data` array passed to the `plugin_row_meta` filter.
* Document some missing values returned by `get_plugin_data()`:
 * `PluginURI`
 * `AuthorName`
* Link to `get_plugin_data()` and the `plugin_row_meta` filter as the canonical sources in other various filters and actions which receive the `$plugin_data` parameter:
 * `network_admin_plugin_action_links`
 * `network_admin_plugin_action_links_{$plugin_file}`
 * `plugin_action_links`
 * `plugin_action_links_{$plugin_file}`
 * `plugin_auto_update_setting_html`
 * `manage_plugins_custom_column`
 * `after_plugin_row`
 * `after_plugin_row_{$plugin_file}`
 * `in_plugin_update_message-{$file}`
* Update documentation for the `$response` parameter of the `in_plugin_update_message-{$file}` filter:
 * Correct type for the `id` value. It contains a string like `w.org/plugins/[plugin-name]`, not a numeric ID.
 * Update `$icons`, `$banners`, and `$banners_rtl` values to use typed array notation.

Follow-up to [8367], [8402], [12976], [16758], [26540], [30544], [34818], [51733], [52212], [52224].

See #53399.

git-svn-id: https://develop.svn.wordpress.org/trunk@52227 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-20 02:21:15 +00:00
John Blackbourn
83e5057151 Query: Correct and standardise the meta query documentation.
Also improves the formatting of some surrounding documentation.

Props audrasjb, johnbillion

Fixes #53467


git-svn-id: https://develop.svn.wordpress.org/trunk@52226 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-20 00:06:06 +00:00
Jb Audras
194e456aa4 Editor: Add missing label to new-post-slug input on Classic Editor.
Previously, the input for changing the permalink of a post does not have a label in the Classic Editor. This change adds a visually hidden label. It also makes sure browsers do not run spellcheck on the input field.

Props sabernhardt.
Fixes #53725.


git-svn-id: https://develop.svn.wordpress.org/trunk@52225 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-19 22:54:34 +00:00
Sergey Biryukov
afc50ca20d Docs: Restore [51733], accidentally reverted in [52212].
Document some more `$response` values in the `in_plugin_update_message-{$file}` filter:
* `banners_rtl`
* `requires_php`

Follow-up to [51733], [52212].

Fixes #40006.

git-svn-id: https://develop.svn.wordpress.org/trunk@52224 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-19 22:15:26 +00:00