Commit Graph

31937 Commits

Author SHA1 Message Date
desrosj
1d093f699c Build/Test Tools: Exclude plugins and non-bundled themes from PHP compatibility scans.
Fixes #54425.
Built from https://develop.svn.wordpress.org/trunk@52148


git-svn-id: http://core.svn.wordpress.org/trunk@51740 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-12 18:40:00 +00:00
Weston Ruter
719ec3ae6d 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51739 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-12 16:07:59 +00:00
hellofromTonya
41072d4e53 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.
Built from https://develop.svn.wordpress.org/trunk@52146


git-svn-id: http://core.svn.wordpress.org/trunk@51738 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-12 13:47:01 +00:00
noisysocks
93d4851bbf 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-12 03:55:01 +00:00
hellofromTonya
2128238311 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.
Built from https://develop.svn.wordpress.org/trunk@52144


git-svn-id: http://core.svn.wordpress.org/trunk@51736 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-12 01:10:01 +00:00
noisysocks
33bb9d7c6b 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51735 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-12 00:05:15 +00:00
Sergey Biryukov
97f3ab0f2a 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.
Built from https://develop.svn.wordpress.org/trunk@52142


git-svn-id: http://core.svn.wordpress.org/trunk@51734 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-11 19:35:00 +00:00
davidbaumwald
00403bc675 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.
Built from https://develop.svn.wordpress.org/trunk@52141


git-svn-id: http://core.svn.wordpress.org/trunk@51733 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-11 19:09:00 +00:00
davidbaumwald
841e45a864 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.
Built from https://develop.svn.wordpress.org/trunk@52140


git-svn-id: http://core.svn.wordpress.org/trunk@51732 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-11 18:32:00 +00:00
joedolson
356fe8c2dd 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.
Built from https://develop.svn.wordpress.org/trunk@52139


git-svn-id: http://core.svn.wordpress.org/trunk@51731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-11 17:20:58 +00:00
hellofromTonya
2ff53354c1 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.
Built from https://develop.svn.wordpress.org/trunk@52138


git-svn-id: http://core.svn.wordpress.org/trunk@51730 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-11 17:00:05 +00:00
hellofromTonya
b68878b83f 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.
Built from https://develop.svn.wordpress.org/trunk@52137


git-svn-id: http://core.svn.wordpress.org/trunk@51729 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-11 16:53:59 +00:00
hellofromTonya
2ae0e77e47 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.
Built from https://develop.svn.wordpress.org/trunk@52136


git-svn-id: http://core.svn.wordpress.org/trunk@51728 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-11 16:29:00 +00:00
noisysocks
51d95be654 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51727 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-11 07:43:31 +00:00
noisysocks
ad15f6422f 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51726 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-11 04:47:02 +00:00
noisysocks
449f1bb07a 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51725 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-11 03:52:00 +00:00
Weston Ruter
9038612705 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51724 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-11 02:49:18 +00:00
davidbaumwald
dd80fd488b 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.
Built from https://develop.svn.wordpress.org/trunk@52131


git-svn-id: http://core.svn.wordpress.org/trunk@51723 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 21:11:00 +00:00
Aaron Jorbin
268feb8c36 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


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


git-svn-id: http://core.svn.wordpress.org/trunk@51722 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 21:00:00 +00:00
desrosj
7fae079419 Tests: Update qUnit test fixtures after [52128].
See #54336.
Built from https://develop.svn.wordpress.org/trunk@52129


git-svn-id: http://core.svn.wordpress.org/trunk@51721 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 20:27:59 +00:00
desrosj
d77367a962 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.
Built from https://develop.svn.wordpress.org/trunk@52128


git-svn-id: http://core.svn.wordpress.org/trunk@51720 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 19:56:00 +00:00
John Blackbourn
62fc5121f2 Docs: Add missing documentation for the $javascript parameter of the wp_inline_script_attributes filter.
See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@51719 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 18:41:03 +00:00
Sergey Biryukov
5781b8c80e 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.
Built from https://develop.svn.wordpress.org/trunk@52111


git-svn-id: http://core.svn.wordpress.org/trunk@51703 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 15:32:01 +00:00
desrosj
b6d67c1519 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.
Built from https://develop.svn.wordpress.org/trunk@52110


git-svn-id: http://core.svn.wordpress.org/trunk@51702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 14:18:06 +00:00
desrosj
b1996cbec4 i18n: Add missing translation wrapper for the Global Styles post type description.
Follow up to [52041].

See #54336.
Built from https://develop.svn.wordpress.org/trunk@52109


git-svn-id: http://core.svn.wordpress.org/trunk@51701 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 14:07:00 +00:00
desrosj
5932a68ba6 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.
Built from https://develop.svn.wordpress.org/trunk@52108


git-svn-id: http://core.svn.wordpress.org/trunk@51700 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 14:01:59 +00:00
desrosj
2803958573 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.
Built from https://develop.svn.wordpress.org/trunk@52107


git-svn-id: http://core.svn.wordpress.org/trunk@51699 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 13:53:59 +00:00
desrosj
a64530a976 Posts, Post Types: Remove gutenberg text domain from post type strings.
Introduced in [52041], and [52069].

See #54336, #54337.
Built from https://develop.svn.wordpress.org/trunk@52106


git-svn-id: http://core.svn.wordpress.org/trunk@51698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 13:46:00 +00:00
noisysocks
3e094c27d0 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 06:01:30 +00:00
desrosj
80f38671d0 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.
Built from https://develop.svn.wordpress.org/trunk@52096


git-svn-id: http://core.svn.wordpress.org/trunk@51688 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 01:50:00 +00:00
hellofromTonya
d9d820660f 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.
Built from https://develop.svn.wordpress.org/trunk@52095


git-svn-id: http://core.svn.wordpress.org/trunk@51687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 01:26:59 +00:00
Peter Wilson
37c02eb5fe 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.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 00:46:00 +00:00
desrosj
1dac2cdae7 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.
Built from https://develop.svn.wordpress.org/trunk@52093


git-svn-id: http://core.svn.wordpress.org/trunk@51685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 00:41:00 +00:00
Peter Wilson
951ec3905d 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.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 00:02:59 +00:00
davidbaumwald
372c7476b2 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.
Built from https://develop.svn.wordpress.org/trunk@52091


git-svn-id: http://core.svn.wordpress.org/trunk@51683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 23:47:59 +00:00
Peter Wilson
ac37144d96 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 23:42:00 +00:00
Peter Wilson
d05a2816ce 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51681 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 23:32:59 +00:00
Peter Wilson
f888c5cbbb 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.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51680 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 23:09:00 +00:00
davidbaumwald
d5f7417686 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.
Built from https://develop.svn.wordpress.org/trunk@52087


git-svn-id: http://core.svn.wordpress.org/trunk@51679 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 23:07:01 +00:00
Sergey Biryukov
878c7c0486 Coding Standards: Use strict comparison in wp-admin/includes/ms.php.
Props davidbaumwald, audrasjb.
Fixes #47422.
Built from https://develop.svn.wordpress.org/trunk@52086


git-svn-id: http://core.svn.wordpress.org/trunk@51678 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 23:06:01 +00:00
hellofromTonya
9d4d3f8fba 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.
Built from https://develop.svn.wordpress.org/trunk@52085


git-svn-id: http://core.svn.wordpress.org/trunk@51677 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 22:59:58 +00:00
hellofromTonya
2f84a45fdf 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.
Built from https://develop.svn.wordpress.org/trunk@52084


git-svn-id: http://core.svn.wordpress.org/trunk@51676 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 22:39:00 +00:00
davidbaumwald
d6de0e4498 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.
Built from https://develop.svn.wordpress.org/trunk@52083


git-svn-id: http://core.svn.wordpress.org/trunk@51675 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 22:27:59 +00:00
hellofromTonya
2c874cfabc 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.
Built from https://develop.svn.wordpress.org/trunk@52082


git-svn-id: http://core.svn.wordpress.org/trunk@51674 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 22:26:01 +00:00
desrosj
b04ed7ed22 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.
Built from https://develop.svn.wordpress.org/trunk@52081


git-svn-id: http://core.svn.wordpress.org/trunk@51673 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 21:02:02 +00:00
TimothyBlynJacobs
d224b7cf10 REST API: Expose the site icon in the REST API index.
Props spacedmonkey, palmiak.
Fixes #52321.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51672 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 20:37:59 +00:00
TimothyBlynJacobs
e2d4385a4f 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51671 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 19:00:01 +00:00
desrosj
c86f41d98b Coding Standards: Minor alignment fix after [52058].
See #52058.
Built from https://develop.svn.wordpress.org/trunk@52078


git-svn-id: http://core.svn.wordpress.org/trunk@51670 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 18:51:02 +00:00
desrosj
de1c682e0a 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.
Built from https://develop.svn.wordpress.org/trunk@52077


git-svn-id: http://core.svn.wordpress.org/trunk@51669 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 18:08:01 +00:00
Sergey Biryukov
ea201ced16 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.
Built from https://develop.svn.wordpress.org/trunk@52076


git-svn-id: http://core.svn.wordpress.org/trunk@51668 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 16:22:58 +00:00
hellofromTonya
80c868534a Login and Registration: Fix failing test for "email already exists" registration error improvement.
Follow-up to [52074].

Fixes #53631.
Built from https://develop.svn.wordpress.org/trunk@52075


git-svn-id: http://core.svn.wordpress.org/trunk@51667 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 16:21:01 +00:00
hellofromTonya
0fd9ad6c2f Login and Registration: Improve "email already exists" registration error message.
Adds the `wp_login_url()` login link to the Error message to be more helpful to users when their user email already is registered.

Improves the error message to more clearly communicate next step.

Follow-up to [16009], [22124], [31963].

Props andynick, costdev, dansoschin, sabernhardt, webcommsat.
Fixes #53631.
Built from https://develop.svn.wordpress.org/trunk@52074


git-svn-id: http://core.svn.wordpress.org/trunk@51666 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 15:28:59 +00:00
Adam Silverstein
e47027ff1f Media: Add "webp" extension to wp.media.controller.Library isImageAttachment.
Add "webp" extension to a media extension check, fixing an issue where the last used media
link type was not used for WebP images.

Props almendron, desrosj, kallookoo.
Fixes #53917.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 15:01:00 +00:00
Dominik Schilling
0b45e56052 Editor, Docs: Add documentation for the $block_editor_context parameter of the block_editor_rest_api_preload_paths hook.
See #52920.
See #53399.
Built from https://develop.svn.wordpress.org/trunk@52072


git-svn-id: http://core.svn.wordpress.org/trunk@51664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 13:00:00 +00:00
youknowriad
55840750c5 Site Editor: Load as full screen by default.
To avoid UI jumps when loading the page, the site-editor.php page
is marked as full screen by default. 
This also matches the behavior of the post editor.

See #54337.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51663 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 09:14:02 +00:00
TimothyBlynJacobs
e5a988644b REST API: Regenerate wp-api-generated.js after [52068].
See #53063.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51662 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 02:28:00 +00:00
noisysocks
c421e9b34a Add Site Editor and PHP changes from Gutenberg 10.1 - 11.9
- First pass at adding the site editor from the Gutenberg plugin to
  wp-admin/site-editor.php.
- Adds miscellaneous PHP changes from Gutenberg 10.1 - 11.9.

Follows [52042].
See #54337.
Props youknowriad, aristath, hellofromtonya, gziolo.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 02:17:17 +00:00
TimothyBlynJacobs
84dae82fd3 REST API: Add batch support for posts and terms controllers.
This also exposes the value of `allow_batch` in `OPTIONS` requests to a route.

A future commit will add batch support to more resources.

Props spacedmonkey, chrisvanpatten.
See #53063.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 01:59:02 +00:00
hellofromTonya
5c47273f06 Posts, Post Types: Add $old_status parameter to {$new_status}_{$post->post_type} action.
Follow-up to [5797], [28106], [31461].

Props aaroncampbell, audrasjb, desrosj, johnbillion, sebastianpisula, swissspidy.
Fixes #36180.
Built from https://develop.svn.wordpress.org/trunk@52067


git-svn-id: http://core.svn.wordpress.org/trunk@51659 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 01:30:58 +00:00
hellofromTonya
8853582220 General: Convert wp_list_filter() into a wrapper for wp_filter_object_list().
The code in `wp_list_filter()` was a duplicate of `wp_filter_object_list()`, minus the `WP_List_Util::pluck()` (used when `$field` is configured).

In testing the wrapper, discovered an edge case (and potential bug) in `WP_List_Util::filter()` where if the operator matches an empty array was returned without resetting the output property. Without that property being set correctly, `WP_List_Util::get_output()` was not correct. This commit also fixes this by resetting the property to an empty array.  

Follow-up to [15686], [17427], [38928], [51044].

Props pbearne, sergeybiryukov, hellofromTonya.
Fixes #53988.
Built from https://develop.svn.wordpress.org/trunk@52066


git-svn-id: http://core.svn.wordpress.org/trunk@51658 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 01:10:59 +00:00
Felix Arntz
780b0399f7 Media: Refine the heuristics to exclude certain images and iframes from being lazy-loaded to improve performance.
This changeset implements the refined lazy-loading behavior outlined in https://make.wordpress.org/core/2021/07/15/refining-wordpress-cores-lazy-loading-implementation/ in order to improve the Largest Contentful Paint metric, which can see a regression from images or iframes above the fold being lazy-loaded. Adjusting this so far has been possible for developers via filters and still is, however this enhancement brings a more accurate behavior out of the box for the majority of themes.

Specifically, this changeset skips the very first "content image or iframe" on the page from being lazy-loaded. "Content image or iframe" denotes any image or iframe that is found within content of any post in the current main query loop as well as any featured image of such a post. This applies both to "singular" as well as "archive" content: On a "singular" page the first image/iframe of the post is not lazy-loaded, while on an "archive" page the first image/iframe of the _first_ post in the query is not lazy-loaded.

This approach refines the lazy-loading behavior correctly for the majority of themes, which use a single-column layout for post content. For themes with multi-column layouts, a new `wp_omit_loading_attr_threshold` filter can be used to change how many of the first images/iframes are being skipped from lazy-loaded (default is `1`). For example, a theme using a three-column grid of latest posts for archives could use the filter to override the threshold to `3` on archive pages, so that the first three content images/iframes would not be lazy-loaded.

Props adamsilverstein, azaozz, flixos90, hellofromtonya, jonoaldersonwp, mte90, rviscomi, tweetythierry, westonruter.
Fixes #53675. See #50425.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51657 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 00:36:01 +00:00
hellofromTonya
c610440f46 Users: Introduce wp_list_users() function.
Introduces a new function called `wp_list_users()`. Similar to other list functions such as `wp_list_authors()`, it lists all the users of the site. Options are available to configure the HTML output.

Following the same pattern of the other list functions, the list's HTML output is rendered by default. Setting the `echo` argument to `false`, returns the list's HTML output.

A new test class is included.

Props afercia, audrasjb, chriscct7, costdev, desrosj, greenshady, hellofromTonya, mte90, nacin, rohan013, sergeybiryukov.
Fixes #15145.
Built from https://develop.svn.wordpress.org/trunk@52064


git-svn-id: http://core.svn.wordpress.org/trunk@51656 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 00:23:58 +00:00
joedolson
98cb0591eb Coding Standards: PHP Code style errors.
Fixes coding standards issues.

Follow up to [52060].

See #43700.
Built from https://develop.svn.wordpress.org/trunk@52063


git-svn-id: http://core.svn.wordpress.org/trunk@51655 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 00:01:57 +00:00
noisysocks
f05f235042 Editor: Add block theme infrastructure
Adds the required infrastructure to render block-based themes. This is sourced
from the Gutenberg plugin.

Fixes #54335.
Props bernhard-reiter, youknowriad, ntsekouras, hellofromtonya.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51654 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 23:10:59 +00:00
hellofromTonya
85fedc53ba General: Add "noopener" to wp_list_bookmarks() output.
In the bookmarks walker `_walk_bookmarks()`, add a `'noopener'` to the bookmark's `rel` attribute when there's `target` attribute.

Adds a new test class for `wp_list_bookmarks()` and tests for this change.

Follow-up to [3880], [10712].

Props birgire, costdev, hellofromTonya, mukesh27 , sergeybiryukov, tw2113.
Fixes #53839.
Built from https://develop.svn.wordpress.org/trunk@52061


git-svn-id: http://core.svn.wordpress.org/trunk@51653 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 23:06:58 +00:00
joedolson
a308811553 Coding Standards: PHP Code style errors.
Fixes coding standards issues.

Follow up to [52058].

See #43700.
Built from https://develop.svn.wordpress.org/trunk@52060


git-svn-id: http://core.svn.wordpress.org/trunk@51652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 23:03:58 +00:00
antpb
975f56e42b Media: Change upload button to a file input for better e2e targeting.
Changes the media library upload button to `input type="file"` for better end to end testing capabilities.

Props  justinahinon, joedolson, sabernhardt, audrasjb.
Fixes #54168.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51651 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 22:49:00 +00:00
joedolson
d00b86ff06 I18N: Add language switcher on login/registration screens.
Load a language switcher on the login and registration screens that allows users to choose any already-installed language. Set user locale on registration.

Props johnbillion, Nikschavan, afercia, sabernhardt, garrett-eclipse, keyur5, paaljoachim, Clorith, tobifjellner.
Fixes #43700.
Built from https://develop.svn.wordpress.org/trunk@52058


git-svn-id: http://core.svn.wordpress.org/trunk@51650 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 22:37:59 +00:00
jorgefilipecosta
8e7b8a1837 Add: get_query_pagination_arrow function to core.
Fixes a crash that is happening when using an FSE theme because a function required is missing. Ports the function from the Gutenberg plugin.

Props oandregal, youknowriad.
Built from https://develop.svn.wordpress.org/trunk@52057


git-svn-id: http://core.svn.wordpress.org/trunk@51649 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 22:31:58 +00:00
jorgefilipecosta
934efac655 Fix: Linting error affecting trunk.
Props oandregal.
Built from https://develop.svn.wordpress.org/trunk@52056


git-svn-id: http://core.svn.wordpress.org/trunk@51648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 21:57:58 +00:00
johnjamesjacoby
65866fa233 Admin/Help: add commas to end of multi-line array items.
Follow up to r52053.

See #54357.
Built from https://develop.svn.wordpress.org/trunk@52055


git-svn-id: http://core.svn.wordpress.org/trunk@51647 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 21:55:00 +00:00
jorgefilipecosta
d8fe393934 Add: Public functions for interacting with global styles & settings.
This commit ports the public functions to interact with the global styles & settings.

See #54336.
Props oandregal.
Built from https://develop.svn.wordpress.org/trunk@52054


git-svn-id: http://core.svn.wordpress.org/trunk@51646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 21:45:58 +00:00
johnjamesjacoby
8dfb59d4de Admin/Help: add docs links to several screens.
This change intends to better guide users towards many of the useful resources available on WordPress.org.

* Appearance/Customizer - Add link to Customizer docs.
* Appearance/Editor - Improve link text & destination.
* Privacy Settings - Link to Privacy Settings docs.
* Site Health - Link to Site Health docs.

Props audrasjb, jdy68, webcommsat.

Fixes #54357.
Built from https://develop.svn.wordpress.org/trunk@52053


git-svn-id: http://core.svn.wordpress.org/trunk@51645 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 21:43:01 +00:00
jorgefilipecosta
d8da1f0ac9 Add: Global styles user content escaping.
This commit adds global styles user content escaping. In addition, it ports the logic on the Gutenberg plugin implemented on WordPress/gutenberg#28061 to the core.
The logic tries to follow what was done for standard post content.

See #54336.
Props oandregal.
Built from https://develop.svn.wordpress.org/trunk@52052


git-svn-id: http://core.svn.wordpress.org/trunk@51644 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 21:24:59 +00:00
jorgefilipecosta
db5d8b5e03 Add: Global Styles Rest endpoints.
This commit ports the global styles rest endpoints from the Gutenberg plugin into the core.

See #54336.
Props oandregal, aristath, timothyblynjacobs, spacedmonkey, youknowriad.
Built from https://develop.svn.wordpress.org/trunk@52051


git-svn-id: http://core.svn.wordpress.org/trunk@51643 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 21:00:07 +00:00
jorgefilipecosta
cba4afb663 Fix: Update block-theme-pl_PL.mo file.
See #54336.
Props oandregal.
Built from https://develop.svn.wordpress.org/trunk@52050


git-svn-id: http://core.svn.wordpress.org/trunk@51642 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 20:33:59 +00:00
jorgefilipecosta
065c639a2a Update theme.json classes for WordPress 5.9.
This commit ports to core the changes to the classes that deal with theme.json code.

See #54336.
Props oandregal, spacedmonkey, noisysocks, hellofromtonya, youknowriad.
Built from https://develop.svn.wordpress.org/trunk@52049


git-svn-id: http://core.svn.wordpress.org/trunk@51641 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 19:19:58 +00:00
Sergey Biryukov
25b9998213 Tests: Remove the formatting group from wp_is_numeric_array() tests.
Similar to `wp_array_slice_assoc()` or other array-related functions, this appears to be a general-purpose function unrelated to the Formatting component.

Add missing `public` visibility keyword.

Follow-up to [52037].

See #53971.
Built from https://develop.svn.wordpress.org/trunk@52048


git-svn-id: http://core.svn.wordpress.org/trunk@51640 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 17:08:59 +00:00
desrosj
80b78b077d Build/Test Tools: Update/Audit NPM dependencies for bundled themes.
This updates several NPM dependencies to their latest (or latest allowed) versions for bundled themes that have a `package.json` file (Twenty Nineteen and newer).

These updates did not result in any changes to the built files in Twenty Nineteen or Twenty Twenty. Some unnecessary parenthesis have been removed from `calc()` function calls within Twenty Twenty-One.

This change also contains several updates to the `package-lock.json` files made by running `npm audit fix` within each of these themes.

See #53361.
Built from https://develop.svn.wordpress.org/trunk@52047


git-svn-id: http://core.svn.wordpress.org/trunk@51639 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 16:26:01 +00:00
desrosj
713dd52b78 Build/Test Tools: Update/Audit NPM dependencies for 5.9.
This updates several NPM dependencies to their latest (or latest allowed) versions.

- `autoprefixer` from `9.8.6` to `9.8.8`
- `chalk` from `4.1.1` to `4.1.2`
- `grunt-contrib-concat` from `1.0.1` to `2.0.0`
- `grunt-contrib-jshint` from `3.0.0` to `3.1.1`
- `grunt-contrib-qunit` from `4.0.0` to `5.1.1`
- `qunit` from `2.16.0` to `2.17.2`
- `sass` from `1.34.1` to `1.43.4`
- `sinon` from `11.1.1` to `12.0.1`
- `sinon-test` from `3.1.0` to `3.1.1`
- `uglify-js` from `3.13.9` to `3.14.3`
- `wait-on` from `5.3.0` to `6.0.0`

This change also contains several updates to the `package-lock.json` file made by running `npm audit fix`.

See #53361.
Built from https://develop.svn.wordpress.org/trunk@52046


git-svn-id: http://core.svn.wordpress.org/trunk@51638 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 16:15:22 +00:00
hellofromTonya
4ba2fd6f0e Posts/Post Types: Improves the 'is_post_type_viewable' filter boolean return.
As a follow-up to [52024], simplifies the strict boolean type check to conserve memory and processing. Also includes an explanation of why a strict boolean is required as the returned filtered value. This commit is consistent with the implementation in [52043].

Follow-up to [33666], [36402], [52024].

Props hellofromTonya, peterwilsoncc, cybr, jrf.
Fixes #49628.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51637 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 15:34:59 +00:00
desrosj
c2a7d2a773 Themes: Remove temporary Full Site Editing safety checks.
These checks were added in [51193] and [51197] as a temporary measure to prevent a site owner from activating a Full Site Editing theme when Gutenberg plugin was not active.

Because Core only had partial support for the features required for FSE, the front end of the site would display a white screen or error message to visitors. Unless the site owner visited the front end, there would be no indication that there was a problem.

Since 5.9 will include the remaining features required for FSE, these checks can be removed.

Props poena, jffng.
Fixes #54366. See #534190.
Built from https://develop.svn.wordpress.org/trunk@52044


git-svn-id: http://core.svn.wordpress.org/trunk@51636 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 15:27:59 +00:00
hellofromTonya
cc39667fc1 Posts/Post Types: Introduce 'is_post_status_viewable ' filter in is_post_status_viewable().
Introduces a new filter 'is_post_status_viewable' which allows overriding the check.

The function's return signature is a boolean type. This commit ensures
the return signature remains unchanged by requirinng a strict boolean
type of the returned filtered value.

Why?
* To maintain this signature and backwards-compatibility.
* To future prepare for PHP 8.1 and beyond.

An explanation is included in the filter's DocBlock.

Follow-up to [50130].

Props audrasjb, hellofromTonya, peterwilsoncc.
Fixes #54375.
Built from https://develop.svn.wordpress.org/trunk@52043


git-svn-id: http://core.svn.wordpress.org/trunk@51635 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 15:21:59 +00:00
youknowriad
ebca9841e8 Block Editor: Update the WordPress Packages based on Gutenberg 11.9 RC1.
This brings the JS packages up to date and is the first step that will allow us 
to include the other block editor updates for WordPress 5.9:
FSE infrastrucutre, site editor and global styles.

Props noisysocks.
See #54337.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 14:29:21 +00:00
jorgefilipecosta
0b4ecc9b23 Add: wp_global_styles custom post type.
This commit adds the wp_global_styles custom post type following the same approach used to add other core custom post types. It also updates the wp_theme taxonomy to include the wp_global_styles post type.
The post type is registered in the same way it is on the plugin we just adapt the location for the core.

See #54336.
Props oandregal.
Built from https://develop.svn.wordpress.org/trunk@52041


git-svn-id: http://core.svn.wordpress.org/trunk@51633 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 14:26:00 +00:00
hellofromTonya
3d10105120 General: Introduce polyfills for str_ends_with() and str_starts_with() added in PHP 8.0.
PHP 8.0 introduced two new functions: `str_ends_with()` and `str_starts_with()`. These perform a case-sensitive check indicating if the string to search in (haystack) ends or begins with the given substring (needle).

These polyfills make these functios available for use in Core.

Ref:
* PHP RFC https://wiki.php.net/rfc/add_str_starts_with_and_ends_with_functions
* PHP manual `str_ends_with()` https://www.php.net/manual/en/function.str-ends-with.php
* PHP manual `str_starts_with()`  https://www.php.net/manual/en/function.str-starts-with.php

Props costdev, hellofromTonya, pbearne, pbiron.
Fixes #54377.
Built from https://develop.svn.wordpress.org/trunk@52040


git-svn-id: http://core.svn.wordpress.org/trunk@51632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 14:22:57 +00:00
hellofromTonya
87557c6260 General: Introduce polyfill for str_contains() added in PHP 8.0.
PHP 8.0 introduced a new function: `str_contains()`. It performs a case-sensitive check indicating if given substring (needle) is contained in the string to search in (haystack).

This polyfill makes this function available for use in Core.

Ref:
* PHP RFC https://wiki.php.net/rfc/str_contains
* PHP manual https://www.php.net/manual/en/function.str-contains.php

Props ayeshrajans, costdev, desrosj, hellofromTonya, knutsp, pbearne.
Fixes #49652.
Built from https://develop.svn.wordpress.org/trunk@52039


git-svn-id: http://core.svn.wordpress.org/trunk@51631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 14:03:58 +00:00
hellofromTonya
10dc403b88 General: Introduce polyfills for array_key_first() and array_key_last() added in PHP 7.3.0.
PHP 7.3.0 introduced two new functions: `array_key_first()` and `array_key_last()`. These two functions return the first and last key of each array respectively, without affecting the internal state of the array.

The polyfills make these two functions available for use in Core on PHP versions less than 7.3.0.

Ref:
* PHP RFC https://wiki.php.net/rfc/array_key_first_last
* PHP manual `array_key_first()` https://www.php.net/manual/en/function.array-key-first.php
* PHP manual `array_key_last()` https://www.php.net/manual/en/function.array-key-last.php

Props desrosj, pbearne, costdev, hellofromTonya, ayeshrajans, manzoorwanijk, audrasjb, sergeybiryukov.
Fixes #45055.
Built from https://develop.svn.wordpress.org/trunk@52038


git-svn-id: http://core.svn.wordpress.org/trunk@51630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 13:51:57 +00:00
hellofromTonya
1a04cb44d2 General: Add phpunit tests for wp_is_numeric_array().
Adds new test class `Tests_Functions_WpIsNumericArray` for `wp_is_numeric_array()`.

Props pbearne, hareesh-pillai, hellofromTonya.
Fixes #53971.
Built from https://develop.svn.wordpress.org/trunk@52037


git-svn-id: http://core.svn.wordpress.org/trunk@51629 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 13:30:56 +00:00
gziolo
b519028ab2 Fix relative URLs in inlined block styles that involve external assets
When styles got inlined, relative URLs break. The problem was that URLs inside CSS files are relative to the stylesheet's path, and when styles get inlined that relation is lost. This patch fixes the issue by finding relative URLs which then get modified to be relative to the site's root.

Fixes #54243.
Props aristath, cdyerkes, hellofromtonya.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51628 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 13:24:58 +00:00
John Blackbourn
2a3ad7c430 Docs: Various docblock improvements and corrections.
See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@51627 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 10:48:59 +00:00
John Blackbourn
4c3a23ba40 Docs: Fix some docblock syntax errors and add a missing canonical reference.
See #53399, #52867, #38942, #53668

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


git-svn-id: http://core.svn.wordpress.org/trunk@51626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 10:44:59 +00:00
antpb
3dc76d614a Media: Adjust alt text info link text.
Previous messaging of this link was confusing given it went to an external source. This change describes more accurately that it will perform the action of taking you to the resource.

Props karmatosed, joedolson, melchoyce, hellofromTonya, afercia, sabernhardt, antpb.
Fixes #48939.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51625 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 00:22:57 +00:00
antpb
c1f6817cad Media: Remove security messaging in media upload failures.
Previously, when uploading a media item type that is not supported, the default error message claims that the reason it cannot upload is due to security reasons. This is not always true. Now the warning says that the type is not allowed, which is always true.

Props antpb, Presskopp, peterwilsoncc, desrosj, iluy, circlecube, mikeschroder.
Fixes #53626.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-07 23:29:56 +00:00
joedolson
fffde30995 Widgets: Add filter to disable RSS widget icon.
Add a filter that disables output of the icon on RSS feed widgets. Improves accessibility by providing a path to prevent duplicate or invisible links.

Props sabernhardt, Boniu91.
Fixes #52224.
Built from https://develop.svn.wordpress.org/trunk@52031


git-svn-id: http://core.svn.wordpress.org/trunk@51623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-07 23:04:56 +00:00
joedolson
201f4ddfbe Editor: Update structure of title element for editing.
Re-format the title element for post editing to follow general scheme for WordPress admin screens.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51622 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-07 22:09:56 +00:00
joedolson
56b07f0ea2 Comments: Mark comment text field as required.
Add required asterisk to the comment text field. Historically, the name and email fields are marked as required, but the comment text field is not, though it is actually a required field.

Props infected, solarissmoke, rianrietveld, afercia, sabernhardt, strider72, mai21, audrasjb.
Fixes #16206.
Built from https://develop.svn.wordpress.org/trunk@52029


git-svn-id: http://core.svn.wordpress.org/trunk@51621 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-07 21:14:58 +00:00
antpb
78d274099a Media: Add filter for post thumbnail id.
Introduces new filter `post_thumbnail_id` which allows overriding the default id returned from `get_post_thumbnail_id()`.

Props engelen, alexvorn2, gilbitron, sebastianpisula, SergeyBiryukov, leogermani, rzen, joemcgill, audrasjb.
Fixes #23983.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51620 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-07 20:37:58 +00:00
antpb
5df077df8a Media: Add filter for post thumbnail url.
Introduces new filter `post_thumbnail_url` which allows overriding the default url returned from `wp_get_attachement_image_url()`.

Props ibenic, SergeyBiryukov, jackreichert, audrasjb.
Fixes #40547.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51619 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-07 19:29:00 +00:00
Sergey Biryukov
107d13bc28 Coding Standards: Move wp-includes/class-http.php to wp-includes/class-wp-http.php.
This renames the file containing the `WP_Http` class to conform to the coding standards.

This commit also includes:

- A new `class-http.php` that includes the new file, for anyone that may've been including the file directly.
- Replaces references to the old filename with the new filename.

Follow-up to [8516], [13274], [33748].

Fixes #54389. See #53359.
Built from https://develop.svn.wordpress.org/trunk@52026


git-svn-id: http://core.svn.wordpress.org/trunk@51618 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-07 01:36:57 +00:00