44987 Commits

Author SHA1 Message Date
John Blackbourn
029bea45b0 Build/Test Tools: Reduce the use of unnecessary randomness in tests.
This increases the overall reliability of the tests.

Props johnillo

Fixes #37371


git-svn-id: https://develop.svn.wordpress.org/trunk@52389 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-19 13:42:37 +00:00
Sergey Biryukov
77757441a4 Tests: Fix typo in a data provider name.
Follow-up to [52261], [52387].

See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@52388 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-18 21:44:57 +00:00
Sergey Biryukov
a3fd024eba Tests: Fix typo in a test method name.
Follow-up to [52261].

See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@52387 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-18 21:16:37 +00:00
SergeyBiryukov
b932a57806 Tests: Move the tests for theme features that block themes should support by default to a more appropriate place.
As these tests are intended for the `_add_default_theme_supports()` function rather than `WP_Theme` class methods, the `tests/theme.php` file is a more logical place for them than `tests/theme/wpTheme.php`.

Follow-up to [52369], [52383].

See #54597.

git-svn-id: https://develop.svn.wordpress.org/trunk@52386 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-18 21:08:02 +00:00
Jb Audras
6ab94802c2 Site Health: Typo correction in Site Health help tab.
Follow-up to [52053].

Props pedromendonca.
Fixes #54656.


git-svn-id: https://develop.svn.wordpress.org/trunk@52385 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-18 21:00:26 +00:00
antpb
0759d89e67 Media: Fix selections in Media Library Featured Image modal on open.
In [50829] infinite scrolling was removed from the Media Library and modal which introduced unintended behavior for featured images where only the selected image shows when opening the library. This change reverts only the logic that caused this and applies a proper fix when opening the library.

Props benitolopez, hellofromTonya, joedolson, peterwilsoncc, circlecube, danielbachhuber, PieWP, sabernhardt, szaqal21, dariak, sergeybiryukov.
Fixes #53765.


git-svn-id: https://develop.svn.wordpress.org/trunk@52384 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-17 20:15:01 +00:00
Sergey Biryukov
954e9c153f Tests: Add unit tests for theme features that block themes should support by default.
By default, block themes should have a few theme supports enabled:
* `post-thumbnails`
* `responsive-embeds`
* `editor-styles`
* `html5` for `comment-form`, `comment-list`, `style`, `script`
* `automatic-feed-links`

They should also load core block assets only when the blocks are rendered. This commit adds the associated tests.

Follow-up to [52369].

Props costdev.
See #54597.

git-svn-id: https://develop.svn.wordpress.org/trunk@52383 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-16 14:45:32 +00:00
Sergey Biryukov
5cb75a136d Tests: Mock the HTTP request response in download_url() tests.
This aims to speed up the tests and minimize unrelated failures by avoiding an unnecessary external HTTP request, while still performing the intended functionality checks.

Update similar helpers in some other tests to use more consistent terminology.

Follow-up to [37907], [46175], [51626].

See #54420, #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@52382 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-15 19:59:32 +00:00
Sergey Biryukov
2cd907dd63 Tests: Add an assertion to test the WP_REST_Server::add_site_logo_to_index() method.
Additionally:
* Move the test for `WP_REST_Server::add_active_theme_link_to_index()` to a more logical place.
* Replace `assertEquals()` with `assertSame()` in site icon test to also check the type of the value.
* Use a more consistent pattern for the tests.

Follow-up to [51241], [52080].

Props ignatggeorgiev, desrosj, SergeyBiryukov.
Fixes #53516. See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@52381 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-15 18:06:15 +00:00
Isabel Brison
424afb85af Fix deprecated usage of passing null to explode()
As of PHP 8.1, explode() does not permit null as its second argument. This results in warnings being spat out on every page because of a usage of this in wp-includes/block-supports/layout.php.

See #53635.
Props noisysocks.


git-svn-id: https://develop.svn.wordpress.org/trunk@52380 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-15 04:06:53 +00:00
Sergey Biryukov
9792783bdd Post WordPress 5.9 Beta 3 version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@52379 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-14 21:23:02 +00:00
Sergey Biryukov
ffa47c8df4 WordPress 5.9 Beta 3.
git-svn-id: https://develop.svn.wordpress.org/trunk@52378 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-14 20:24:41 +00:00
Tonya Mork
979199ff0d Editor: Add "Featured" patterns from pattern directory to Patterns in block inserter.
This commit backports the remote "Featured" category request and loads it into the Featured Patterns in the block inserter.

Props ryelle.
Fixes #54623.

git-svn-id: https://develop.svn.wordpress.org/trunk@52377 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-14 19:37:44 +00:00
Tonya Mork
08b7927ef8 REST API: Add block theme support for valid non-alphanumeric characters in theme's directory name.
Themes whose `wp-content/themes/<dirname>` include valid non-alphanumeric (cross-platform) characters work for non-block themes, but did not previously resolve for block themes. For example, a block theme in `wp-content/themes/twentytwentytwo-0.4.0/` directory resulted a 404 "No route was found matching the URL and request method" response when attempting to customize it in the Site Editor.

This commit adds support for the following characters in a theme's root directory: `_`, `.`, `@`, `[`, `]`, `(`, and `)`. Subdirectory themes and `-` are already supported.

Follow-up to [51003], [52051], [52275].

Props mkaz, costdev, hellofromTonya, jffng, justinahinon, peterwilsoncc, spacedmonkey, TimothyBlynJacobs.
Fixes #54596.

git-svn-id: https://develop.svn.wordpress.org/trunk@52376 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-14 18:22:07 +00:00
Jeff Ong
83421f420c Twenty Twenty-Two: Sync updates from GitHub for Beta 3.
This commit syncs minor changes for the default theme from its active development repository to core. 

This is a follow up to [52081], [52107], [52164], [52222], [52283], and [52335]. The two main changes introduce global padding to site content while still allowing content to be full-width, and re-organize block patterns into Core's existing categories. 

To view the full set of changes, visit da994d1fe5...88a8f2e3b4.

Props onemaggie, joen, youknowriad, scruffian, sabernhardt, kjellr.
See #54318.


git-svn-id: https://develop.svn.wordpress.org/trunk@52375 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-14 17:09:04 +00:00
Jonny Harris
8770f5c652 REST API: Ensure that the get_theme_item method should respect fields param.
Fix the `get_theme_item` method in the `WP_REST_Global_Styles_Controller` class to respect the fields param context filtering and to return links. 

Props spacedmonkey, hellofromtonya, peterwilsoncc, costdev.
Fixes #54595.



git-svn-id: https://develop.svn.wordpress.org/trunk@52374 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-14 16:29:03 +00:00
John Blackbourn
0c4c91384d Database: Correct and improve documentation for properties and parameters in wpdb.
See #53399


git-svn-id: https://develop.svn.wordpress.org/trunk@52373 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-14 16:22:47 +00:00
Tonya Mork
26c6b33b87 Themes: Rename public static functions in WP_Theme_JSON_Resolver to remove custom_post_type references.
WordPress Core is not really custom and does not reference "custom post type" in its function naming. This commit renames 2 public static methods:

* `WP_Theme_JSON_Resolver::get_user_custom_post_type_id()` renamed to `WP_Theme_JSON_Resolver::get_user_global_styles_post_id()`.
* `WP_Theme_JSON_Resolver::get_user_data_from_custom_post_type()` renamed to `WP_Theme_JSON_Resolver:: get_user_data_from_wp_global_styles()`.

Follow-up to [52049], [52051], [52069], [52232], [52275], [52364].

Props antonvlasenko, bernhard-reiter, costdev, desrosj, hellofromTonya, noisysocks, oandregal, SergeyBiryukov.
Fixes #54517.

git-svn-id: https://develop.svn.wordpress.org/trunk@52372 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-14 16:12:57 +00:00
Tonya Mork
4b35425d7b Customize: Overlay incompatible banner for block themes.
Starting in 5.9, block themes are not compatible with (do not support) Customizer; rather, they use the Site Editor. Viewing installed themes in Customizer, this commit adds an overlay message to alert users and give them a way to activate the block theme. Clicking on the "Activate" button activates the block theme and redirects back to the Appearance > Themes interface, where the user can then enter the Site Editor for customization.

Non-block themes are not affected by this change and continue to work in Customizer.

Follow-up to [41648], [41893], [52279].

Props antonvlasenko, costdev, hellofromTonya, jffng, joyously, noisysocks, poena, shaunandrews.
Fixes #54549.

git-svn-id: https://develop.svn.wordpress.org/trunk@52371 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-14 15:31:14 +00:00
Tonya Mork
d3a851d0d1 Formatting: Use is_scalar() in sanitize_key().
This is a follow-up to [52292] which introduced `is_string()` to check the given key is a string to be sanitized, else the key is set to an empty string. 

`sanitize_key()` is clearly identified (in the documentation) to only work with ''string'' keys. However, it had a bug in it that allowed non-strings to pass through it:
* A non-scalar "key" would throw a PHP Warning (which was resolved in [52292]. 
* A non-string scalar "key" was handled by the PHP native `strtolower()` which converted it into a string.

While `is_string()` is valid, non-string scalar types passed as the key to be sanitized were being set to an empty string. Given that `strtolower()` handles these without error or deprecation as of PHP 8.1, `is_scalar()` protects the website from issues while retaining the past behavior of converting integer keys (for example) into a string.

Changes include:
* Using `is_scalar()` instead of `is_string()`
* Refactor for readability and less code
* More tests

Please note, this does not change the behavior of the function, nor redefine it to now accept non-string scalars.

References:
* https://developer.wordpress.org/reference/functions/sanitize_key/
* https://www.php.net/manual/en/function.strtolower.php

Follow-up [52292].

Props wppunk, hellofromTonya, costdev, jrf.
Fixes #54160.

git-svn-id: https://develop.svn.wordpress.org/trunk@52370 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-14 14:59:33 +00:00
Jb Audras
46d21eb99a Editor: Activate missing default theme features for block themes.
By default, block themes should have a few theme supports enabled by default. These are: `post-thumbnails`, `responsive-embeds`, `editor-styles`, `html5`, `automatic-feed-links`. This changeset backports the changes introduced in https://github.com/WordPress/gutenberg/pull/35593.

Props noisysocks, ocean90, youknowriad, audrasjb, hellofromTonya.
Fixes #54597.


git-svn-id: https://develop.svn.wordpress.org/trunk@52369 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-14 09:47:51 +00:00
Jb Audras
11753b9481 Posts, Post Types: Add missing translation context on FSE related post types labels.
This makes it easier for translators to identify the context of each label. This change also brings consistency with other built-in post types.

Follow-up to [52145], [52069], [52062], [52041], [51003].

Props audrasjb, hellofromTonya.
Fixes #54611.


git-svn-id: https://develop.svn.wordpress.org/trunk@52368 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-14 09:07:17 +00:00
Jb Audras
e860dee727 Docs: Use generic references to "Database" in wp-config-sample.php.
This replaces the references to "MySQL" info in the WordPress configuration sample file. Using the generic term "Database" now refers to either MySQL or MariaDB.

Props Ov3rfly, audrasjb, hellofromTonya.
Fixes #54610.


git-svn-id: https://develop.svn.wordpress.org/trunk@52367 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-14 08:42:16 +00:00
Jb Audras
83753bfe79 Docs: Typo correction in TinyMCE related JS file.
Follow-up to [45066].

See #53399.


git-svn-id: https://develop.svn.wordpress.org/trunk@52366 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-14 08:28:27 +00:00
Robert Anderson
dedcacf92f Filter custom block templates with PHP
This method calls get_block_templates once and uses block template properties
directly for filtering. This way, we can avoid hitting the database for each
public post type.

The previous method is useful when we already know the current post type we
request templates for, like when using REST API.

Follows [52334].
See #54335.
Props mamaduka, youknowriad.


git-svn-id: https://develop.svn.wordpress.org/trunk@52365 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-14 02:44:46 +00:00
Robert Anderson
667fb94b79 Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- Image block: Set image display to grid when no alignment sent to properly align caption on resize
- Update and align template descriptions
- Site Editor - prevent loading state from showing the admin menu.
- Add client side routing for Site Editor
- Navigation: Add clearance for appender in submenus.
- Fix CSS Custom Properties for presets in the site editor
- Add/navigation blocks post processing after migration from menu items
- Allow selector ordering to ensure theme.json root selector margin takes precedence 
- Do not remove theme presets if defaults are hidden
- Format library: fix unsetting highlight color
- FSE: Fix template resolution to give precedence to child theme PHP templates over parent theme block templates with equal specificity
- ColorPalette: Improving accessibility and visibility
- Update: Make the color popover on the gradient picker appear as expected
- Site Editor: Display a notice if export fails
- Fix docs and function naming for gallery block registration in PHP
- Switch to addEventListener for load event in the navigation block view script
- Fix mistake in _remove_theme_attribute_in_block_template_content
- Better synchronisation between Gutenberg and Core code
- Move the block page templates hook into compat/5.9 folder
- Moves to the template loader hooks and functions into lib/compat folder
- Refactor the gutenberg_is_fse_theme function to use wp_is_block_theme
- Site Editor: Update support doc URL in Welcome Guide
- Global Styles: Add Welcome Guide toggle
- Hide remove control point when removing would break gradient control
- Don't request the deprecated navigation areas endpoint outside of the Gutenberg plugin
- Image: Fix resizer controls being hidden in Safari when switching between alignments
- Remove Navigation Menus from WP Admin sidebar
- Site Editor: Hide the block appender in the Template Part editor
- Site Editor: Use server definition for the Template Areas
- Synchronize wp_is_block_theme and block-templates block support with Core
- E2E: Retry login again after a bad nonce request to prevent intermittent test failures 
- Fix theme requirement validation with WP 5.8
- Fix WP 5.9 check for conditionally running code
- Fix post comment form input width
- Border Style Control: Update styling for consistency with border width control
- Fix form-submit styles by adding button classes to the submit-button in post-comments block
- Site Editor: Fix edit template part link in header dropdown
- Move duotone palette to the bottom of global styles gradients
- Fix how appearanceTools works
- Move WP 5.9 wp-admin menus compatibility code to lib/compat folder
- Revert "Site Editor: Set the <title> on the list page to be same as the CPT name"
- Site Editor: Document Actions: add SR text to heading 1
- Do not register global styles CPT in WordPress 5.9
- Global Styles: Move the 'Edit colors' button to a standard menu item
- Fix styles for previews and patterns
- Site Editor: Fix failing E2E test
- Templates: Search for old template names in the parent theme too
- Remove 4 instances of 'gutenberg' text domain from WordPress core
- Fix content loss when ungrouping template parts or reusable blocks
- Simplify the RESET_BLOCK action to fix template part focus mode content loss
- [Global Styles]: Make Blocks section more distinguishable
- Only use block markup for comment form button when using a block theme
- Navigation: Fix vertical alignment of page list in modal.
- Fix: ToggleGroupControl active state
- Remove gutenberg_ prefix from @wordpress/block-library

Props ocean90, oandregal, hellofromtonya, youknowriad.
See #54487.


git-svn-id: https://develop.svn.wordpress.org/trunk@52364 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-14 01:55:28 +00:00
Jonny Harris
7155e3c083 REST API: Ensure that the parent link, uses the rest_get_route_for_post function.
In [51962] the `rest_get_route_for_post` function was implemented in all places where link to a post's REST API endpoint is needed. However in this commit, the up link, which links to the parent post of the current object, did not use this function.   

Props Spacedmonkey, SergeyBiryukov.
Fixes #53656.




git-svn-id: https://develop.svn.wordpress.org/trunk@52363 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-13 15:19:01 +00:00
Sergey Biryukov
df8c3d0e08 Docs: Capitalize "ID", when referring to a widget ID or sidebar ID, in a more consistent way.
Follow-up to [48104], [52357], [52361].

See #53399.

git-svn-id: https://develop.svn.wordpress.org/trunk@52362 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-13 10:19:21 +00:00
Jb Audras
1787bcefbb Docs: Capitalize "ID", when referring to a sidebar ID in a more consistent way.
Follow-up to [52016].

See #53399.



git-svn-id: https://develop.svn.wordpress.org/trunk@52361 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-12 18:59:55 +00:00
Jb Audras
d9261b5d2b Docs: Document the global used in upgrade_590() function.
Follow-up to [51917].

See #53399.


git-svn-id: https://develop.svn.wordpress.org/trunk@52360 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-12 17:55:03 +00:00
Sergey Biryukov
0a346a22ba Build/Test Tools: Disable WP Cron when installing PHPUnit tests.
During the WordPress installation process when running the test suite, an HTTP request was always fired by a cron task and failed, because tests are run in CLI mode only.

To avoid that, the `DISABLE_WP_CRON` constant was previously added to the `bootstrap.php` file. However, the constant is not passed to the `install.php` script. This commit makes a similar change to `install.php`.

Follow-up to [760/tests], [872/tests].

Props Chouby.
Fixes #54612.

git-svn-id: https://develop.svn.wordpress.org/trunk@52359 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-12 15:46:46 +00:00
Sergey Biryukov
cdd5e43a04 General: Mark the recommended MariaDB version number in readme.html with a <strong> tag.
This brings consistency with the MySQL version number.

Follow-up to [52319].

See #41490.

git-svn-id: https://develop.svn.wordpress.org/trunk@52358 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-12 14:56:56 +00:00
Sergey Biryukov
9e4f967968 Docs: Capitalize "ID", when referring to a post ID, term ID, etc. in a more consistent way.
Follow-up to [48104].

See #53399.

git-svn-id: https://develop.svn.wordpress.org/trunk@52357 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-12 14:51:34 +00:00
Sergey Biryukov
6097eddaf4 Docs: Update a comment in wp-admin/load-styles.php per the documentation standards.
Follow-up to [52352].

See #53399.

git-svn-id: https://develop.svn.wordpress.org/trunk@52356 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-12 14:50:18 +00:00
Sergey Biryukov
70823f3ddf Docs: Update some @var tags per the documentation standards.
Follow-up to [27398], [29487], [41626], [51003].

See #53399.

git-svn-id: https://develop.svn.wordpress.org/trunk@52355 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-11 19:49:38 +00:00
Jb Audras
1b541a7e52 Docs: Docblock adjustments in some 5.9 block related functions.
Adds missing `@since` mention to `wp_enqueue_block_style()` and `_wp_multiple_block_styles()`, and a few other minor changes. 

Follow-up to [52069].

See #53359.


git-svn-id: https://develop.svn.wordpress.org/trunk@52354 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-11 11:14:17 +00:00
Tonya Mork
d3f13613d7 Themes: Show only "Customize" or "Activate" button in block theme's Theme Details modal.
At the bottom of a block theme's "Theme Details" modal, only one button will be displayed:
* "Customize" button when the block theme is activated;
* Else, the "Activate" button.

The "Live Preview", "Editor beta", and "Navigation Menus" buttons are removed.

Follow-up to [15646], [52341], [52346].

Props poena, ryelle, kafleg, antonvlasenko, costdev, SergeyBiryukov, hellofromTonya.
Fixes #54578.

git-svn-id: https://develop.svn.wordpress.org/trunk@52353 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-10 20:31:57 +00:00
Sergey Biryukov
882687a54a Docs: Correct the format of some comments per the documentation standards.
Follow-up to [10357], [10939], [43309], [51003], [51266], [51653], [51738], [52110].

See #53399.

git-svn-id: https://develop.svn.wordpress.org/trunk@52352 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-10 20:28:27 +00:00
Peter Wilson
db30405f47 Upgrade/install: Revert upgrader rollback features.
Revert the rollback features introduced for theme and plugin upgrades during the WordPress 5.9 cycle. A bug (suspected to be in third party virtualisation software) causes the upgrades to fail consistently on some set ups. The revert is to allow contributors further time to investigate mitigation options.

Reverts [52337], [52289], [52284], [51951], [52192], [51902], [51899], [51898], [51815].

Props pbiron, dlh, peterwilsoncc, galbaras, SergeyBiryukov, afragen, costdev, bronsonquick, aristath, noisysocks, desrosj, TobiasBg, hellofromTonya, francina, Boniu91.
See #54543, #54166, #51857.




git-svn-id: https://develop.svn.wordpress.org/trunk@52351 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-10 00:04:03 +00:00
Sergey Biryukov
92cbcb3da6 Coding Standards: Remove a trailing comma from a compact() call in _wp_customize_include().
This fixes a `Trailing comma's are not allowed in function calls in PHP 7.2 or earlier` error in the PHP compatibility check.

Follow-up to [52348].

See #53359.

git-svn-id: https://develop.svn.wordpress.org/trunk@52350 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-09 15:30:48 +00:00
Sergey Biryukov
56741a3047 Editor: Add an editor settings flag to enable the new gallery for mobile apps for 5.9.
Currently the WordPress mobile apps rely on the `__unstableGalleryWithImageBlocks` flag being set in order to enable the new gallery block format.

This commit includes the value in the `get_default_block_editor_settings()` function in order to ensure that versions of the mobile app >= 18.2 will be able to add and edit gallery blocks in the new format.

Props glendaviesnz, ocean90, hellofromTonya, noisysocks.
Fixes #54583.

git-svn-id: https://develop.svn.wordpress.org/trunk@52349 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-09 15:23:23 +00:00
Sergey Biryukov
61296a7bad Coding Standards: Simplify or wrap some long conditions in wp-includes/theme.php for better readability.
Includes adjusting some DocBlocks per the documentation standards.

Follow-up to [35595], [41937], [52256].

See #53359, #53399.

git-svn-id: https://develop.svn.wordpress.org/trunk@52348 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-09 15:11:17 +00:00
Riad Benguella
f7d2a2ee9d Themes: Auto-enable block-templates support for all block themes.
Block themes without theme.json file used to have block-templates support disabled.
This commit brings this in sync with the behavior in the gutenberg plugin.

See #54335.


git-svn-id: https://develop.svn.wordpress.org/trunk@52347 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-09 09:54:13 +00:00
Sergey Biryukov
59633f8198 Coding Standards: Use camel case with a lowercase first letter for the blockTheme array key.
This matches the WordPress JS naming conventions and the naming of other keys in the `$prepared_themes` array.

Follow-up to [52341].

See #54578, #53359.

git-svn-id: https://develop.svn.wordpress.org/trunk@52346 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-08 10:14:52 +00:00
Jb Audras
7c8bed0be2 Coding Standards: Correct alignment in blocks.php and class-wp-rest-templates-controller.
See #53359.


git-svn-id: https://develop.svn.wordpress.org/trunk@52345 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-07 22:48:54 +00:00
Sergey Biryukov
be006b0c55 Post WordPress 5.9 Beta 2 version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@52344 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-07 21:56:28 +00:00
Sergey Biryukov
0e13a6add1 WordPress 5.9 Beta 2.
git-svn-id: https://develop.svn.wordpress.org/trunk@52343 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-07 21:19:26 +00:00
Jonny Harris
9f0d8fdf01 REST API: Improve permission handling in global style endpoint.
The new wp_global_styles post type is registered to use edit_theme_options in the capability settings. The WP_REST_Global_Styles_Controller class's permission checks methods use the capability in a hard coded form rather than looking up the capability via the post type object. Changing the permission callbacks to lookup capabilities via the post type object, allows theme and plugin developers to modify the capability used for editing global styles via a filter and these values to be respected via the Global Styles REST API.

Props Spacedmonkey, peterwilsoncc, hellofromTonya , antonvlasenko, TimothyBlynJacobs, costdev, zieladam.
Fixes #54516.



git-svn-id: https://develop.svn.wordpress.org/trunk@52342 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-07 20:56:18 +00:00
Tonya Mork
f33c456925 Themes: Hide "Live Preview" button for FSE block themes.
Currently, the Site Editor does not have a live preview feature for non-activated block themes.

This commit is a stop-gate to remove the "Live Preview" button for those themes. It avoids confusing users and avoiding a notification message that doesn't make sense.

Props antonvlasenko, costdev, hellofromTonya, kafleg, paaljoachim.
Fixes #54578.

git-svn-id: https://develop.svn.wordpress.org/trunk@52341 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-07 20:05:27 +00:00
Jonny Harris
8697aee5f9 REST API: Ensure that the export template endpoint returns a valid WP_Error object.
Ensure that the export template endpoint returns a WP_Error object, including code and message, so that the site editor can display an error message. 
Add some basic unit tests to ensure that permission checks are working as expected. 

Follow-up to [52286].

Props Spacedmonkey, dlh, hellofromTonya , Mamaduka, TimothyBlynJacobs.
Fixes #54448.



git-svn-id: https://develop.svn.wordpress.org/trunk@52340 602fd350-edb4-49c9-b593-d223f7449a82
2021-12-07 18:36:29 +00:00