44796 Commits

Author SHA1 Message Date
Jonathan Desrosiers
0c812b536b Build/Test Tools: Exclude plugins and non-bundled themes from PHP compatibility scans.
Fixes #54425.

git-svn-id: https://develop.svn.wordpress.org/trunk@52148 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-12 18:38:54 +00:00
Weston Ruter
e4132b5a61 Twenty Twenty-One: Prevent printing skip link focus fix when SCRIPT_DEBUG is enabled.
An `else` statement was missing in `twenty_twenty_one_skip_link_focus_fix()`. See ba83586ff1.

Fixes #54429.


git-svn-id: https://develop.svn.wordpress.org/trunk@52147 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-12 16:06:35 +00:00
Tonya Mork
2ff7174e7c Build/Test Tools: Mock no results remote request in WP_REST_Block_Directory_Controller:: get_items().
* Refactors the mock logic to a helper function for reuse in multiple tests.
* Mocks the remote request in `WP_REST_Block_Directory_Controller_Test:: test_get_items_no_results()` using the mock helper.

Follow-up to [48242], [52137].

Props hellofromTonya, sergeybiryukov.
See #54420.

git-svn-id: https://develop.svn.wordpress.org/trunk@52146 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-12 13:45:05 +00:00
Robert Anderson
74df751e48 Editor: Add Navigation Area infrastructure
Copies Navigation Area infrastrucutre from lib/navigation.php in Gutenberg. This
allows a Navigation block to be associated with a particular area which persists
when switching theme.

Props antonvlasenko, mamaduka, spacedmonkey.
See #54337.


git-svn-id: https://develop.svn.wordpress.org/trunk@52145 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-12 03:53:18 +00:00
Tonya Mork
ff04bb0017 Bootstrap/Load: Check $_SERVER['SCRIPT_NAME'] exists before passing to strpos() in wp_fix_server_vars().
If `SCRIPT_NAME'` does not exist (which can happen in cron jobs), the following happens:

* PHP 8.1+:
    * `Warning: Undefined array key "SCRIPT_NAME"`
    * `Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated` 
* PHP 8.0: `Warning: Undefined array key "SCRIPT_NAME"`
* PHP 5.6-7.4: No warning or notice

This commit checks if the key exists before passing it to `strpos()`. This resolves the warning, notice, and future error.

Follow-up to [3034], [3069], [12732].

Props audrasjb, costdev, hellofromTonya, karpstrucking, mcjambi, sergeybiryukov.
Fixes #54142.

git-svn-id: https://develop.svn.wordpress.org/trunk@52144 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-12 01:08:35 +00:00
Robert Anderson
95adcec4c9 Update 'react' and 'react-dom'
Update 'react' and 'react-dom' packages to version 17.0.1. This is the version
expected by @wordpress components.

See #54337.


git-svn-id: https://develop.svn.wordpress.org/trunk@52143 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-12 00:03:30 +00:00
Sergey Biryukov
9451b13db3 Twenty Twenty-One: Correct default image alignment in the editor.
By default, the theme centers images on the front end when no alignment is selected. In the editor, however, images were aligned to the left side of the block.

This commit ensures that the alignment in the editor matches the one on the front end.

Props sabernhardt, ashfame, poena, annezazu.
Fixes #53809.

git-svn-id: https://develop.svn.wordpress.org/trunk@52142 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-11 19:33:48 +00:00
David Baumwald
04f62997d3 Posts, Post Types: Update _edit_last meta when posts are edited in bulk.
When posts are edited in bulk, the `_edit_last` meta was not updated for each post.  This change adds a call to update the `_edit_last` meta to the current user ID for each post the is updated.

Props calebwoodbridge, peterwilsoncc, guillaumeturpin, audrasjb.
Fixes #42446.

git-svn-id: https://develop.svn.wordpress.org/trunk@52141 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-11 19:07:52 +00:00
David Baumwald
d762d720cc Options, Meta APIs: Correct docs for $_meta_value parameter in xxx_{$meta_type}_meta hooks.
In `add_{$meta_type}_meta`, `added_{$meta_type}_meta`, `update_{$meta_type}_meta`, `updated_{$meta_type}_meta`, `delete_{$meta_type}_meta`, and `deleted_{$meta_type}_meta` hooks, the `$_meta_value` parameter was documented as "Serialized if non-scalar".  However, `$_meta_value` is a copy of the raw meta value before `maybe_serialize` is run and is not serialized.  This change updates each of the above hooks' docblocks to remove "Serialized if non-scalar" from the `$_meta_value` parameter description.

Props pputzer, hasanuzzamanshamim.
Fixes #53102.

git-svn-id: https://develop.svn.wordpress.org/trunk@52140 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-11 18:30:27 +00:00
Joe Dolson
7b61f1305a Upgrade/Install: Update screen reader text counts in adminbar.
Update the hidden screen-reader-text update count in the adminbar when updates are run on the plugin or theme screens.

Props pento, paulschreiber, adamsilverstein, afercia, SergeyBiryukov, sabernhardt.
Fixes #29022.

git-svn-id: https://develop.svn.wordpress.org/trunk@52139 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-11 17:19:58 +00:00
Tonya Mork
206ee73bdd Build/Test Tools: Mock remote request for unknown plugin in WP_REST_Plugins_Controller::create_item().
Instead of hitting the live API, this commit mocks the remote request when testing creating an item that's an unknown plugin.

Follow-up to [48242].

Props hellofromTonya, noisysocks, sergeybiryukov, TimothyBlynJacobs.
See #54420.

git-svn-id: https://develop.svn.wordpress.org/trunk@52138 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-11 16:58:27 +00:00
Tonya Mork
046d86f95b Build/Test Tools: Mock remote request for WP_REST_Block_Directory_Controller::get_items().
Instead of hitting the live API, this commit mocks the remote request.

Follow-up to [48242].

Props hellofromTonya, noisysocks, sergeybiryukov, TimothyBlynJacobs.
Fixes #54420.

git-svn-id: https://develop.svn.wordpress.org/trunk@52137 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-11 16:52:22 +00:00
Tonya Mork
06dc5e170f Template: Fix "undefined index: 00" when archive month query is empty in wp_title().
When `m` query_tag has a valid year, i.e. `?m=2021`, and there are posts for that year, `substr()` returns a `false` on PHP 5.6 and an empty string on PHP 7.0+. Passing either of those values to `$wp_locale->get_month()` results in a PHP notice on PHP 5.6 to PHP 7.4 and a PHP Warning on PHP 8.0+.

Why? The `$month` lookup table has zeroized keys from '01' to '12'. A empty value is passed to `zeroise()` returns `'00'` which is directly passed as a key in the month property. That key does not exist.

While `$wp_locale->get_month()` would benefit from guarding/validation, this fix ensures a falsey value is not passed as a month.

Tests are added including a test that fails with this fix not applied.

Follow-up to [801], [35294], [35624].

Props antpb, audrasjb, costdev, davidmosterd, drewapicture, herregroen, hellofromTonya, michelwppi, sergeybiryukov.
Fixes #31521.

git-svn-id: https://develop.svn.wordpress.org/trunk@52136 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-11 16:27:44 +00:00
Robert Anderson
d2ddc42e6d Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- Group - Fix inner container regexes using fixed div tag
- Image block: Make sure the Image block border radius is inherited if the image is linked
- Navigation: Small fixes
- FSE: Add template_type guards
- Template Part Block: Add some guards
- Fix getEntityRecords to ensure resolution on REST API failure
- Ensure menus before map operation in Nav block
- Link editing: Account for link anchor no longer being present when generating unique link instance key
- Navigation: Hide post attributes meta box
- Fix failing tests and compatibility with 5.9.
- Fix missing <MainDashboardButton> slot fill in site editor
- Move WP_REST_Block_Navigation_Areas_Controller from Gutenberg to Core.
- Fix site editor reset styles in WP 5.9

See #54337.


git-svn-id: https://develop.svn.wordpress.org/trunk@52135 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-11 07:41:38 +00:00
Robert Anderson
37c8dfc09f Hide Customize from admin bar when using a block theme
Don't add the Customize link to the admin bar when a block theme is activated.

See #54337.


git-svn-id: https://develop.svn.wordpress.org/trunk@52134 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-11 04:45:22 +00:00
Robert Anderson
f7d670c767 REST API: Add /wp/v2/block-navigation-areas endpoint
Copies WP_REST_Block_Navigation_Areas_Controller from the Gutenberg plugin. This
provides the /wp/v2/block-navigation-areas endpoint used by the Navigation
block.

Props antonvlasenko, TimothyBlynJacobs.
Fixes #54393.


git-svn-id: https://develop.svn.wordpress.org/trunk@52133 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-11 03:50:22 +00:00
Weston Ruter
02a2f9c9f5 Embeds: Conditionally enqueue wp-embed only if needed and send ready message in case script loads after post embed windows.
* Prevent loading `wp-embed` script unconditionally on every page in favor of conditionally enqueueing when a post embed is detected. The `wp-embed` script is also explicitly marked as being in the footer group. Sites which currently disable post embed scripts from being enqueued via `remove_action( 'wp_head', 'wp_oembed_add_host_js' )` will continue to do so.
* Send a `ready` message from the host page to each post embed window in case the `iframe` loads before the `wp-embed` script does. When the `ready` message is received by the post embed window, it sends the same `height` message as it sends when it loads.
* Eliminate use of `grunt-include` to inject emoji script and the post embed script. Instead obtain the script contents via `file_get_contents()` (as is done elsewhere in core) and utilize `wp_print_inline_script_tag()`/`wp_get_inline_script_tag()` to construct out the script. This simplifies the logic and allows the running of src without `SCRIPT_DEBUG` enabled.
* For the embed code that users are provided to copy for embedding outside of WP, add the `secret` on the `blockquote` and `iframe`. This ensures the `blockquote` will be hidden when the `iframe` loads. The embed code in question is accessed here via `get_post_embed_html()`.

Props westonruter, swissspidy, pento, flixos90, ocean90.
Fixes #44632, #44306.


git-svn-id: https://develop.svn.wordpress.org/trunk@52132 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-11 02:47:10 +00:00
David Baumwald
1e785fa0c3 Taxonomy: Document that the get_terms filter can have null for $taxonomies.
The `get_terms` filter currently documents that the filter passes an array as both the first and second parameters, which is normally true, except that the second can be `null` when not specified.  This change updates the filter's docblock to indicate that the second parameter can also be of a `null` type.

Props dd32, audrasjb, mukesh27.
Fixes #54222.

git-svn-id: https://develop.svn.wordpress.org/trunk@52131 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-10 21:09:30 +00:00
Aaron Jorbin
4160c23106 Build/Test: Change default GitHub branch to trunk
See: https://make.wordpress.org/core/2021/11/10/default-git-branch-for-wordpress-wordpress-develop/
See: https://make.wordpress.org/core/2020/06/18/proposal-update-all-git-repositories-to-use-main-instead-of-master/

Fixes #54399



git-svn-id: https://develop.svn.wordpress.org/trunk@52130 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-10 20:58:15 +00:00
Jonathan Desrosiers
40799ba11f Tests: Update qUnit test fixtures after [52128].
See #54336.

git-svn-id: https://develop.svn.wordpress.org/trunk@52129 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-10 20:26:14 +00:00
Jonathan Desrosiers
e1ac6c3fba General: Minor fixes to Global Style related code.
Follow up to [52041,52049-52052,52054,52106,52108-52110].

Props swisspidy, TobiasBg, spacedmonkey, kebbet, oandregal.
See #54336.

git-svn-id: https://develop.svn.wordpress.org/trunk@52128 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-10 19:54:51 +00:00
John Blackbourn
f60e4ba84f Docs: Add missing documentation for the $javascript parameter of the wp_inline_script_attributes filter.
See #53399


git-svn-id: https://develop.svn.wordpress.org/trunk@52127 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-10 18:39:40 +00:00
Sergey Biryukov
c3b6a5f44c Docs: List the expected return type first in a few functions:
* `get_previous_post()`
* `get_next_post()`
* `get_adjacent_post()`.

Follow-up to [46696], [47060], [49929], [49963], [51286].

See #53399.

git-svn-id: https://develop.svn.wordpress.org/trunk@52111 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-10 15:30:31 +00:00
Jonathan Desrosiers
c59c7dd5f9 Docs: Avoid using “CPT” instead of “custom post type”.
Additionally, when referring to built in Core post types, “custom” is unnecessary.

This also adds a period to the end of the `wp_global_styles` post type description.

Follow up to [38829], [51003], [52041], [52049], [52062].

See #53399, #54335, #54336.

git-svn-id: https://develop.svn.wordpress.org/trunk@52110 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-10 14:16:03 +00:00
Jonathan Desrosiers
663666d6a4 i18n: Add missing translation wrapper for the Global Styles post type description.
Follow up to [52041].

See #54336.

git-svn-id: https://develop.svn.wordpress.org/trunk@52109 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-10 14:05:29 +00:00
Jonathan Desrosiers
0a34910828 Posts, Post Types: Mark the wp_global_styles post type as _builtin.
All native or “built-in” post types should be marked as such.

Follow up to [52041].

See #54336.

git-svn-id: https://develop.svn.wordpress.org/trunk@52108 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-10 14:00:07 +00:00
Jonathan Desrosiers
4b612044f8 Twenty Twenty-Two: Import the assets directory from GitHub.
This directory was missed during the initial import.

Follow up to [52081].

Props kafleg.
See #52081.

git-svn-id: https://develop.svn.wordpress.org/trunk@52107 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-10 13:52:30 +00:00
Jonathan Desrosiers
7de4393e80 Posts, Post Types: Remove gutenberg text domain from post type strings.
Introduced in [52041], and [52069].

See #54336, #54337.

git-svn-id: https://develop.svn.wordpress.org/trunk@52106 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-10 13:44:08 +00:00
Robert Anderson
bef7547231 Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- Force remount LinkControl when moving between links within same richtext block
- Site Editor: Change ToolsMoreMenuGroup slot-fill name
- Respect fields param for global styles REST API requests.
- Try ensuring the item after post content clears floats
- Fix submenus not opening on click
- Apply i18n functions to Nav block menu drops when selecting existing Menu
- Gallery: Make sure the mobile warning notice only runs when images are added to a new block
- Prepare navigation php code for core patch
- Address deprecation issues from Buttons flex layout PR.
- Block Library: Fix incorrect attributes definitions
- Fix Navigation accessibility issues

See #54337.


git-svn-id: https://develop.svn.wordpress.org/trunk@52103 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-10 05:59:55 +00:00
Jonathan Desrosiers
6e2472b8c2 Build/Test Tools: Make adjustments to how Quick Draft tests confirm expected behavior.
Twenty Twenty-One contained a filter on `the_title` to change the default post title to “Untitled”.

Whenever possible, the default behavior of Core without theme modifications should be confirmed in tests. The default behavior here is for a post title to be “(no title)” when one is not entered.

This change also makes an adjustment to be more specific when retrieving the text to verify results to prevent dates and post statuses from being pulled in.

Props davidbaumwald, desrosj, peterwilsoncc, hellofromTonya.
Fixes #54409.

git-svn-id: https://develop.svn.wordpress.org/trunk@52096 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-10 01:49:01 +00:00
Tonya Mork
c5f9e9abea Revisions: Introduce wp_get_post_revisions_url() to get URL for editing revisions.
There's now a way to get a link to a given post's revisions. Introducing `wp_get_post_revisions_url()` and its unit tests.

Props adamsilverstein, audrasjb, costdev, davidbaumwald, garrett-eclipse, georgestephanis, hellofromTonya, iaaxpage.
Fixes #39062.

git-svn-id: https://develop.svn.wordpress.org/trunk@52095 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-10 01:25:09 +00:00
Peter Wilson
6fc6730d4f Taxonomy: Change some static strings to registration labels.
Add additional label options to `register_taxonomy()` to allow developers further flexibility for customizing the edit taxonomy screen.

Props mclaurent, swissspidy, johnbillion, jeremyescott, theMikeD, jeremyfelt, dontgo2sleep, SergeyBiryukov, audrasjb, Boniu91.
Fixes #43060.



git-svn-id: https://develop.svn.wordpress.org/trunk@52094 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-10 00:44:49 +00:00
Jonathan Desrosiers
be7313f8c2 Themes: Twenty Twenty-Two is now the default theme.
It's Friday night, and I feel alright. The party is here in the block theme.

See #54318.

git-svn-id: https://develop.svn.wordpress.org/trunk@52093 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-10 00:39:45 +00:00
Peter Wilson
94dc7028be Quick/Bulk Edit: Disable auto-correct for slugs.
Disable auto-correct for the slug field on the quick/bulk edit interface. As slugs may consist of a number of words combined in to a single string, they are unlikely to pass spell checkers.

Props swb1192, SergeyBiryukov, afragen, Clorith, desrosj, JeffPaul, sabernhardt, Boniu91, costdev, hellofromTonya.
Fixes #50499.



git-svn-id: https://develop.svn.wordpress.org/trunk@52092 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-10 00:01:56 +00:00
David Baumwald
e0ba1258dc Login and Registration: Pass $errors parameter to registration_redirect filter.
On user registration, the `$errors` variable is the result of `register_new_user` which contains either the newly registered user's ID on success or a `WP_Error` object on failure.  This change passes that context to the `registration_redirect` filter.

Props Collizo4sky, aadilali, mukesh27, audrasjb.
Fixes #53992.

git-svn-id: https://develop.svn.wordpress.org/trunk@52091 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-09 23:46:09 +00:00
Peter Wilson
6815eb6f33 Block Editor: Update SVN props to ignore new asset files.
Update svn props to ignore additional CSS, JavaScript and source map files following the package updates preparing for WordPress 5.9.

Follow up to [52042], [52046], [52069] and [52089].
See #54337, #53361.


git-svn-id: https://develop.svn.wordpress.org/trunk@52090 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-09 23:40:25 +00:00
Peter Wilson
06a22748a8 Block Editor: Update SVN props to ignore new asset files.
Update svn props to ignore additional CSS, JavaScript and source map files following the package updates preparing for WordPress 5.9.

Follow up to [52042], [52046], [52069].
See #54337, #53361.


git-svn-id: https://develop.svn.wordpress.org/trunk@52089 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-09 23:31:22 +00:00
Peter Wilson
b2758c4494 Login and Registration: Improve messaging for invalid log-out nonces.
Clarify messaging of when `wp_nonce_ays('log-out')` is called due to an invalid log out nonce. The HTML title now describes the action being taken rather than using the generic text "something went wrong".

Props davidkryzaniak, hellofromTonya, peterwilsoncc.
Fixes #52600.



git-svn-id: https://develop.svn.wordpress.org/trunk@52088 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-09 23:05:32 +00:00
David Baumwald
d4447c0d76 Bootstrap/Load: Add HTTP/3 as a valid HTTP protocol.
As of November 2021, the `HTTP/3` protocol is still officially an Internet Draft, but is already supported by 74% of running web browsers and, according to W3Techs, 23% of the top 10 million websites. It has been supported by Google Chrome (including Chrome for Android, and Microsoft Edge, which is based on it) since April 2020 and by Mozilla Firefox since May 2021. Safari 14 (on macOS Big Sur and iOS 14) has also implemented the protocol but support is hidden behind a feature flag.

Based on the wide support, this change adds `HTTP/3` as a valid HTTP protocol.

Props malthert.
Fixes #54404.

git-svn-id: https://develop.svn.wordpress.org/trunk@52087 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-09 23:04:59 +00:00
Sergey Biryukov
6981c4793f Coding Standards: Use strict comparison in wp-admin/includes/ms.php.
Props davidbaumwald, audrasjb.
Fixes #47422.

git-svn-id: https://develop.svn.wordpress.org/trunk@52086 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-09 23:04:41 +00:00
Tonya Mork
26c9730309 HTTP API: Ensure value returned from 'http_allowed_safe_ports' is an array to avoid PHP 8+ TypeError fatal error.
Adds an `is_array()` check before the `in_array()`. Why? `in_array()` requires a array for the haystack. Any other data type will cause a fatal error on PHP 8.0 or higher:

{{{
Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array
}}}

As this is a new filter, this type check properly guards to avoid the fatal error.

Follow-up to [52084].

See #54331.

git-svn-id: https://develop.svn.wordpress.org/trunk@52085 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-09 22:58:39 +00:00
Tonya Mork
bed3a7c0da HTTP API: Introduce 'http_allowed_safe_ports' filter in wp_http_validate_url().
Adds a new filter `'http_allowed_safe_ports'` to control which ports are allowed for remote requests. By default, ports 80, 443, and 8080 are allowed for safe remote requests.

Adds tests. 

Follow-up to [24480].

Props xknown, johnbillion, jorbin, costdev, dd32.
Fixes #54331.

git-svn-id: https://develop.svn.wordpress.org/trunk@52084 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-09 22:37:19 +00:00
David Baumwald
16b7125de0 Mail: Add wp_mail_succeeded hook to wp_mail.
Adds a new `wp_mail_succeeded` action in `wp_mail` after the mail is sent.  Also, adds a disclaimer to the hook's docblock, clarifying that the hook's firing doesn't necessarily mean the recipient received the mail, only that the mail was processed without any errors.

Props birgire, donmhico, johnbillion.
Fixes #53826.

git-svn-id: https://develop.svn.wordpress.org/trunk@52083 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-09 22:25:40 +00:00
Tonya Mork
64c6beb7f9 Twenty Twenty-One: Add privacy policy link to footer.
If a privacy policy is set, the page links to the footer of the site. As done in the other bundled themes, this link is added using `the_privacy_policy_link()`.

Follow-up to [49216].

Props ryelle, desrosj, kapilpaul, sabernhardt, audrasjb, justinahinon.
Fixes #53445.

git-svn-id: https://develop.svn.wordpress.org/trunk@52082 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-09 22:24:47 +00:00
Jonathan Desrosiers
adcc2d3ee0 Bundled Themes: Import Twenty Twenty-Two, the new default theme for WordPress 5.9.
Twenty Twenty-Two arrives during an exciting time for WordPress themes. With the advent of Full Site Editing and Global Styles, themes are changing structurally and functionally to enable far more avenues for customization than users have come to expect in the past.

To take advantage of these new abilities, Twenty Twenty-Two has been designed to be the most flexible default theme ever created for WordPress.

Props sourav926, aristath, audrasjb, bgardner, briceduclos, poena, colorful-tones, dgwyer, dimadin, gregrickaby, ellenbauer, jffng, kafleg, karmatosed, kraftbj, kjellr, littlebigthing, onemaggie, matveb, mburridge, mtoensing, nickcernis, nielslange, williampatton, pgking, ribaricplusplus, scruffian, soean, utz119, youknowriad, desrosj, richtabor.
See #54318.

git-svn-id: https://develop.svn.wordpress.org/trunk@52081 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-09 21:00:47 +00:00
Timothy Jacobs
aed3eae13f REST API: Expose the site icon in the REST API index.
Props spacedmonkey, palmiak.
Fixes #52321.


git-svn-id: https://develop.svn.wordpress.org/trunk@52080 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-09 20:36:37 +00:00
Timothy Jacobs
aae0000cef REST API: Introduce Menu management endpoints.
This commit introduces the `/wp/v2/menus`, `/wp/v2/menu-items` and `/wp/v2/menu-locations` REST API endpoints. These endpoints are fully available to users with the `edit_theme_options` capability, but can be read by any user who can edit a REST API available post type.

The `nav_menu` taxonomy and `nav_menu_item` post type now map their capabilities to the `edit_theme_options` primitive capability. This allows developers to provide more fine-grained access control. However, if a developer is currently dynamically removing the `edit_theme_options` capability using `map_meta_cap`, they should use the `user_has_cap` filter instead.

The `wp_update_nav_menu_item()` function has been adjusted to return an error if saving the menu item post or assigning the menu item to a menu generate an error.

Lastly, a new menu item type is introduced, `block`, that can be used to store a Block as a menu item.

Props andraganescu, antonvlasenko, dingo_d, dlh, isabel_brison, kadamwhite, Mamaduka, NateWr, noisysocks, peterwilsoncc, ryelle, schlessera, soean, Spacedmonkey, talldanwp, TimothyBlynJacobs, tobifjellner, westonruter, wpscholar, zieladam.
Fixes #40878.


git-svn-id: https://develop.svn.wordpress.org/trunk@52079 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-09 18:58:59 +00:00
Jonathan Desrosiers
de9a1e6f94 Coding Standards: Minor alignment fix after [52058].
See #52058.

git-svn-id: https://develop.svn.wordpress.org/trunk@52078 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-09 18:49:12 +00:00
Jonathan Desrosiers
f22abe7610 Themes: Avoid fatal error loading admin styles when SCRIPT_DEBUG is false.
This removes the use of `get_theme_file_path()` within `WP_Theme_JSON_Resolver` in favor of the similar `get_file_path_from_theme()` method.

The former is found within `wp-includes/link-template.php`, which is not currently loaded when `load-styles.php` attempts to load the necessary styles. `self::get_file_path_from_theme()` was used previously, but this was changed in [52049].

Props Mamaduka, audrasjb, hellofromTonya, jorbin, desrosj.
Fixes #54401. See #54336.

git-svn-id: https://develop.svn.wordpress.org/trunk@52077 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-09 18:06:35 +00:00
Sergey Biryukov
f0de932e45 Coding Standards: Revert unrelated change to wp_send_user_request().
This fixes a mix of tabs and spaces in the email template. Spaces inside a string are not considered WPCS errors, and are not required to be converted to tabs.

Follow-up to [52060], [52063].

See #43700.

git-svn-id: https://develop.svn.wordpress.org/trunk@52076 602fd350-edb4-49c9-b593-d223f7449a82
2021-11-09 16:21:00 +00:00