Commit Graph

20069 Commits

Author SHA1 Message Date
davidbaumwald
be9b533e13 Administration: Add new get_views_links method to WP_List_Table.
Many `WP_List_Table` child classes in core use mostly the same code to create their "view" links markup.  To DRY-up the code, a new `WP_List_Table->get_view_links` method is being introduced to consolidate the HTML link generation when provided an array of links.

This change also implements this new method in the relevant `WP_List_Table_xxx` child classes `get_views` methods.  Finally, unit tests are being added to validate view links markup and test for some "unhappy paths".

Props afercia, costdev, garrett-eclipse, Dharm1025, juhise, peterwilsoncc.
Fixes #42066.
Built from https://develop.svn.wordpress.org/trunk@54215


git-svn-id: http://core.svn.wordpress.org/trunk@53774 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-19 21:08:10 +00:00
audrasjb
130e13e39e Editor: Backport block supports filter callback, registrations and tests to 6.1.
This changeset backports the following changes:

- Implement [https://github.com/WordPress/gutenberg/pull/42880 gutenberg#42880]: Backport script loader: enqueue stored block supports styles
- Allow a way to bypass `SCRIPT_DEBUG` in tests. See [https://github.com/WordPress/wordpress-develop/pull/3259#issuecomment-1250403735 comment] and the related [https://github.com/WordPress/gutenberg/pull/44248 Gutenberg pull request]

Props ramonopoly, gziolo, bernhard-reiter, audrasjb, costdev.
See #56467.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53773 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-19 20:56:10 +00:00
davidbaumwald
89213a3e4e Role/Capability: Add a new update_role function.
Until now, changing a user's role involved deleting a user's role then re-adding.  This change creates a new `update_role` function and associated method in `WP_Roles` to consolidate this process.

This commit also introduces new unit tests around `update_role` and adds additional "unhappy path" tests for roles and capabilities in general.

Props maksimkuzmin, peterwilsoncc, NomNom99, costdev, SergeyBiryukov.
Fixes #54572.
Built from https://develop.svn.wordpress.org/trunk@54213


git-svn-id: http://core.svn.wordpress.org/trunk@53772 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-19 20:49:10 +00:00
davidbaumwald
5358008d68 Upgrade/Install: Add plugin URL to the automatic update email.
For each automatic plugin update, both successful and failed, information about each plugin is included in the email upon completion of the process.  This change adds the plugin URL, if known, to the information included for each plugin that was processed.

This change also adds unit tests to validate the email contents after various automatic plugin update scenarios.

Props JosVelasco, pbiron, oliverstapelfeldt, ChrisHardie, Ipstenu, dd32, peterwilsoncc, audrasjb, costdev.
Fixes #53049.
Built from https://develop.svn.wordpress.org/trunk@54212


git-svn-id: http://core.svn.wordpress.org/trunk@53771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-19 20:28:11 +00:00
audrasjb
3639a578ef Editor: Backport block supports (border, color, elements, spacing) from Gutenberg to WP 6.1.
This changeset backports `border`, `color`, `elements` and `spacing` block supports changes from Gutenberg to WP 6.1. 

See tracking issue on Gutenberg repository: [https://github.com/WordPress/gutenberg/pull/43440 gutenberg#43440].

Props ramonopoly, glendaviesnz, bernhard-reiter, audrasjb, costdev.
See #56467.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53770 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-19 20:14:10 +00:00
desrosj
1966addc05 Coding Standards: Various alignment fixes from composer format.
Follow up to [53874], [54097], [54110], [54155], [54162], [54184].

See #39210, #55443, #56288, #56092, #56408, #56467, #55881.
Built from https://develop.svn.wordpress.org/trunk@54210


git-svn-id: http://core.svn.wordpress.org/trunk@53769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-19 19:51:09 +00:00
desrosj
0fe6115af2 External Libraries: Update the jQuery UI library to version 1.13.2.
This is a bug fix release. For more information on the changes included, see https://jqueryui.com/changelog/1.13.2/.

Props Clorith, monolithon, desrosj.
Fixes #56239.
Built from https://develop.svn.wordpress.org/trunk@54209


git-svn-id: http://core.svn.wordpress.org/trunk@53768 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-19 18:04:09 +00:00
davidbaumwald
34cd38aa84 Posts, Post Types: Update new wp_post_class_taxonomies filter name for consistency.
In [54066], a new filter was added to alter the taxonomies for which class names are generated for a given post type.  At the time, the filter name was prefixed with `wp_`.

For consistency with filters of a similar type, this change updates the filter name to `post_class_taxonomies`.

Follow-up to [54066].

Props SergeyBiryukov.
See #37114.
Built from https://develop.svn.wordpress.org/trunk@54208


git-svn-id: http://core.svn.wordpress.org/trunk@53767 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-19 17:54:11 +00:00
Sergey Biryukov
04f0d611f8 Tests: Reset timezone-related options if the tests change them.
The `options` table is not explicitly reset after each test or test class, so if an option is changed during a test, it should be reset to the default value ''after'' the test.

This commit does so for those tests which did not have such resetting in place yet, while one or more tests in the class ''do'' change the value of the `timezone_string` option.

Note: The test suite executes a `ROLLBACK` query after each test, which should reset the `options` table in theory, however that appears to not always be enough, as some timezone-related tests can fail in a complete test suite run, while not failing when run in isolation. This commit aims to improve stability of the tests.

Follow-up to [45857] / #45821.

Props jrf, costdev.
See #56468.
Built from https://develop.svn.wordpress.org/trunk@54207


git-svn-id: http://core.svn.wordpress.org/trunk@53766 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-19 17:45:09 +00:00
davidbaumwald
0da06515aa Login and Registration: Add a new filter for the lost password link.
On the login page, the "Register" link for new users has been filterable for some time.  This change adds the ability to filter the "Lost your password?" link as well.

Props wparslan, audrasjb, rafiahmedd, SergeyBiryukov, antonvlasenko, hellofromTonya.
Fixes #55388.
Built from https://develop.svn.wordpress.org/trunk@54206


git-svn-id: http://core.svn.wordpress.org/trunk@53765 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-19 17:09:08 +00:00
Clorith
f277e8c168 Site Health: Improve the details provided by the REST API checks.
The descriptions provided whenever a REST API check failed lacked details that would help in troubleshooting any issues, most notably the actual REST API endpoint that was being tested.

Adding this vital piece of detail, along with a revamp of the error messages shown, where previously there was a risk that the markup of your website was included as an error message, improves the overall user experience, and gives more accurate details that can be looked when looking up how to fix or improve the behavior of the REST API.

Props dingo_d, shetheliving.
Fixes #54617.
Built from https://develop.svn.wordpress.org/trunk@54205


git-svn-id: http://core.svn.wordpress.org/trunk@53764 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-19 15:30:09 +00:00
hellofromTonya
94ae52c079 Editor: Fix function name case in wp_default_packages_inline_scripts().
Fixes function name typo by changing from uppercase `get_current_user_ID()` to lowercase `get_current_user_id()`.

>Note: Function names are case-insensitive for the ASCII characters A to Z, though it is usually good form to call functions as they appear in their declaration.
[https://www.php.net/manual/en/functions.user-defined.php As per the PHP manual], PHP functions are case-insensitive, meaning the code runs. However, this fix is necessary for consistency, maintainability, and future-proofing.

Follow-up to [54182].

Unprop hellofromTonya.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54204


git-svn-id: http://core.svn.wordpress.org/trunk@53763 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-19 14:20:09 +00:00
Sergey Biryukov
93bc199337 Tests: Simplify the data provider for testing whether KSES globals are defined.
To avoid duplicating array values as keys when using a named data provider, the `text_array_to_dataprovider()` helper method can be used.

Follow-up to [52229], [53521].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@54203


git-svn-id: http://core.svn.wordpress.org/trunk@53762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-19 14:18:09 +00:00
desrosj
9913822661 External Libraries: Update the jQuery library to version 3.6.1.
This is a maintenance release. For more information on the changs included, see https://blog.jquery.com/2022/08/26/jquery-3-6-1-maintenance-release/.

Props tobiasbg.
See #56451.
Built from https://develop.svn.wordpress.org/trunk@54202


git-svn-id: http://core.svn.wordpress.org/trunk@53761 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-19 14:16:24 +00:00
audrasjb
2fda7d7d1a Coding Standards: Replace double quote with single quote in test_if_failed_update().
Follow-up to [54200].
See #55758.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53760 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-19 09:16:11 +00:00
audrasjb
7b14bdbec0 Text Changes: Remove self-reference ("we") in WordPress Admin.
This changes some admin-area, user-facing text, to better match the guidelines and recommendations set forth in the make/core handbook, specifically:

> the word “we” should be avoided (...) unless its made very clear which group is speaking

Follow-up to [51979], [53131], [53132], [53148], [53156].

Props kebbet, costdev, SergeyBiryukov.
Fixes #55758.
See #46057.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-19 08:59:11 +00:00
audrasjb
c279ba3edb Docs: Typo correction in _load_textdomain_just_in_time() docblock.
Props kebbet.
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-19 08:44:10 +00:00
Sergey Biryukov
38e393f7d0 Tests: Move the basic get_block_templates() test to the dedicated file.
Now that the function has its own test class, the remaining test from `Tests_Block_Template_Utils` can be moved to `Tests_Blocks_GetBlockTemplates` for consistency.

Includes:
* Uncommenting some assertions previously commented out.
* Moving the `get_template_ids()` helper method to the top of the class.
* Standardizing on `wpSetUpBeforeClass()`/`wpTearDownAfterClass()` in both classes.
* Declaring the test theme name as a constant in both classes, since the value is not changed by any of the tests.
* Renaming some properties in both classes for clarity.

Follow-up to [51003], [52062], [53927], [54184], [54187].

See #55652.
Built from https://develop.svn.wordpress.org/trunk@54198


git-svn-id: http://core.svn.wordpress.org/trunk@53757 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-18 13:10:09 +00:00
Clorith
e68db2692f Site Health: Adjust margins for the Site Health dashboard widget.
This aligns the spacing within the widget with other core widgets, and removes an unintended margin which was pushing the indicator slightly above the centered position it was intended to have.

Props sabernhardt, costdev, mukesh27.
Fixes #56369.
Built from https://develop.svn.wordpress.org/trunk@54197


git-svn-id: http://core.svn.wordpress.org/trunk@53756 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-18 01:29:09 +00:00
Clorith
3c1cd858dd Site Health: Improve the description for Authorization header checks.
Previously the description left the user stuck with no path forward if flushing their permalinks was not enough.

This change givers a clearer description of what approving an application may involve (allowing these to connect to the users site), but also an additional step towards resolution if flushing permalinks are not enough; pointing them towards their host.

Props Presskopp, webcommsat.
Fixes #54508.
Built from https://develop.svn.wordpress.org/trunk@54196


git-svn-id: http://core.svn.wordpress.org/trunk@53755 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-17 23:51:08 +00:00
Sergey Biryukov
4dd6f110a3 Docs: Revert the WP_Block_Parser documentation changes now.
This commit reverts [54193] and [54194].

It appears that these changes should first be made [533e0b7dad/packages/block-serialization-default-parser/parser.php upstream in the Gutenberg respository] and then backported to core, as the [https://github.com/WordPress/wordpress-develop/actions/runs/3074068296/jobs/4966609235#step:8:1 tests fail otherwise].

See #56581.
Built from https://develop.svn.wordpress.org/trunk@54195


git-svn-id: http://core.svn.wordpress.org/trunk@53754 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-17 17:31:11 +00:00
Sergey Biryukov
e076ee2ee1 Docs: Correct @return type for WP_Block_Parser::parse().
This affects:
* `WP_Block_Parser::parse()`
* `WP_Block_Parser::$output`

Both the method and the property are documented as returning `WP_Block_Parser_Block[]` (an array of `WP_Block_Parser_Block` objects), but the result is in fact an array of arrays of various values, so `array[]` is the correct notation.

Follow-up to [43751] for the 5.0 branch, [44116] for trunk.

Props Chouby.
Fixes #56581.
Built from https://develop.svn.wordpress.org/trunk@54194


git-svn-id: http://core.svn.wordpress.org/trunk@53753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-17 17:13:11 +00:00
Sergey Biryukov
6435a4c9c7 Docs: Correct @since tags for some block parser properties and methods.
This affects:
* `WP_Block_Parser::$empty_attrs`
* `WP_Block_Parser::next_token()`
* `WP_Block_Parser::freeform()`
* `WP_Block_Parser_Block::$innerContent`

The `@since` tags referred to early Gutenberg versions instead of WordPress core. These properties and methods were introduced in WordPress 5.0, so `5.0.0` is the correct version.

Some of the other `@since` tags are removed, as they are related to early Gutenberg development before it was merged into WordPress core, and are not relevant for core.

Follow-up to [43751], [43884], [43955] for the 5.0 branch, [44116], [44261], [44281] for trunk.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53752 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-17 16:49:09 +00:00
joedolson
b67e8e4dd9 Login and Registration: Required fields in network registration.
Properly label site and user information on the network registration screen with the HTML5 required attribute and clarify the values expected for the site domain and subdirectory fields.

Props SteelWagstaff, henrywright, sabernhardt.
Fixes #54344.
Built from https://develop.svn.wordpress.org/trunk@54192


git-svn-id: http://core.svn.wordpress.org/trunk@53751 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-17 00:35:10 +00:00
joedolson
4ed6d8ad76 Login and Registration: Access improvements to network signup.
Fix a variety of accessibility issues with the network registration and activation screens. Fix associations between error messages and fields, improve labels for radio buttons, add fieldset and legend to properly group fields.

Props afercia, allisonplus, sabernhardt.
Fixes #40361.
Built from https://develop.svn.wordpress.org/trunk@54191


git-svn-id: http://core.svn.wordpress.org/trunk@53750 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-16 23:13:10 +00:00
audrasjb
cad5069194 Docs: Update wp_rand docblock to clarify that it returns a non-negative number.
Props hakre, westi, jeremyfelt, neychok, sabernhardt, audrasjb.
Fixes #15089.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53749 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-16 22:39:11 +00:00
audrasjb
17480cc205 General: Replace Codex with HelpHub in WordPress readme.
This updates WordPress main `readme.txt` file to replace Codex link with HelpHub.

Props audrasjb, netweb, SergeyBiryukov, tobifjellner.
See #48987.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53748 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-16 22:27:10 +00:00
audrasjb
eafd18308b Code Modernization: Remove -webkit-appearance CSS declarations.
This changeset removes the deprecated `-webkit-appearance` CSS property used in `customizer-controls.css`. It doesn't change anything to the interface.

Props laurent22777, desrosj, celloexpressions, costdev, rolfsiebers, audrasjb, Clorith.
Fixes #38431.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53747 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-16 22:17:10 +00:00
Sergey Biryukov
8375b6e2eb Tests: Update the test for respecting the post type in get_block_templates().
* Use `assertSameSets()` to avoid a failure when array items are returned in different order ([https://github.com/WordPress/wordpress-develop/actions/runs/3067320461/jobs/4953478602#step:19:274 example]).
* Move the test to a more appropriate place now that the function has its own test class.
* Rename the test method to match the function name.

Follow-up to [52062], [53927], [54184].

See #55881.
Built from https://develop.svn.wordpress.org/trunk@54187


git-svn-id: http://core.svn.wordpress.org/trunk@53746 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-16 15:12:09 +00:00
spacedmonkey
b01bafe003 Posts, Post Types: Improve performance of the get_user_data_from_wp_global_styles method.
Improve the logic found in `get_user_data_from_wp_global_styles` method. Replace call to `wp_get_recent_posts` with the more standard, `WP_Query` for consistancy. Use transient over standard cache, to improve performance on sites without persistent object caching. Improve handling of cases where `wp_insert_post` returns a `WP_Error`.

Props spacedmonkey, adamsilverstein, mukesh27, peterwilsoncc, andregal.
Fixes #55392.
Built from https://develop.svn.wordpress.org/trunk@54186


git-svn-id: http://core.svn.wordpress.org/trunk@53745 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-16 10:57:14 +00:00
audrasjb
44569531b2 Code Modernization: Reduce CSS float usage in wp-admin - Timezone settings.
This changeset is a part of a task dedicated to improve wp-admin CSS code with less floating, as float never was intended for layout. The idea is to gradually replace floating methods that take the HTML element out of the normal flow of the document with more modern and robust positioning methods.

Props kebbet.
See #55557.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53744 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-15 22:59:11 +00:00
hellofromTonya
47d61a73ef Editor: Fix get_block_templates() to get templates for a post type.
When a post type is passed to `get_block_templates()` in the query, return only the templates that match that post type.

Fixes an issue where:
* when a block template provided by a theme has been edited by the user
* and that template has specific defined `postTypes`
* but after editing, the template was available for all post types.

Follow-up to [52062].

Props aljullu, bernhard-reiter, hellofromTonya.
Fixes #55881.
Built from https://develop.svn.wordpress.org/trunk@54184


git-svn-id: http://core.svn.wordpress.org/trunk@53743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-15 22:28:13 +00:00
Sergey Biryukov
335203e971 Editor: Finalize the theme_json_get_style_nodes hook name.
This consolidates the name of a filter introduced earlier in the 6.1 cycle, renaming it from `get_style_nodes` to `theme_json_get_style_nodes` as to be more coherent with the other hooks introduced in 6.1 as well.

This commit backports the original PR from Gutenberg repository:
* [https://github.com/WordPress/gutenberg/pull/44189 #44189 Use prefix 'theme_json_' in hooks related to theme.json]

Reference: [https://github.com/WordPress/wordpress-develop/pull/3247 #3247 Add hooks to filter theme.json data].

Follow-up to [54118].

Props oandregal, scruffian, bernhard-reiter.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54183


git-svn-id: http://core.svn.wordpress.org/trunk@53742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-15 20:28:18 +00:00
hellofromTonya
8c85dde1c6 Editor: Persist preferences in user meta.
Adds a new feature to persist editor UI preferences between page loads and browsers.

* Adds a new preferences persistence API.
* Saves editor preferences in user meta instead of in browser's local storage.

Why?
Due to the transient nature of browser storage, this persistence is not as sticky as it is expected to be, including: switching browsers (unique storage between browsers), or using private browsing tabs (storage cleared between sessions), or the same user across a network of sites (storage unique by domain).

This is a backport from Gutenberg.[https://github.com/WordPress/gutenberg/pull/39795 See WordPress/gutenberg PR 39795].

Props talldanwp, youknowriad, noisysocks, mamaduka, costdev, ironprogrammer, hellofromTonya.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54182


git-svn-id: http://core.svn.wordpress.org/trunk@53741 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-15 16:45:40 +00:00
Sergey Biryukov
21eb7900b3 Docs: Clarify the $allowed_protocols default value in various KSES functions.
Add a note that the parameter is optional and defaults to the result of `wp_allowed_protocols()`.

This affects:
* `wp_kses()`
* `filter_block_content()`
* `filter_block_kses()`
* `filter_block_kses_value()`

Includes synchronizing the `$allowed_html` parameter description for consistency.

Follow-up to [649], [6630], [18826], [32603], [43016], [46896], [48478].

Props armondal, SergeyBiryukov.
Fixes #56580.
Built from https://develop.svn.wordpress.org/trunk@54181


git-svn-id: http://core.svn.wordpress.org/trunk@53740 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-15 13:29:13 +00:00
audrasjb
82c08816f6 Docs: Use third-person singular verbs in Template Loading functions descriptions, as per docblocks standards.
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53739 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-15 12:49:08 +00:00
audrasjb
199454f6ae Docs: Clarify that get_page_template() doesn't work on block themes.
When working on a block theme, `locate_block_template()` should be used instead of `get_page_template()`. This changeset updates the docblock of this function accordingly.

Props audrasjb, costdev, robinwpdeveloper.
Fixes #56394.
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53738 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-15 12:44:09 +00:00
Sergey Biryukov
3b0c68d032 Docs: Clarify documentation for the nav_menu_item_id filter.
This aims to make it clear that the filter is applied to an HTML ID attribute for the menu item's `<li>` element, and not a numeric ID.

Follow-up to [15407], [25410], [27201], [38559], [51739].

Props dilipbheda, robinwpdeveloper, mukesh27, audrasjb, SergeyBiryukov.
See #56574, #55646.
Built from https://develop.svn.wordpress.org/trunk@54178


git-svn-id: http://core.svn.wordpress.org/trunk@53737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-15 12:32:08 +00:00
audrasjb
57b47f0a09 Help/About: Remove .hidden class when the Help Tab panel is displayed.
It is obviously more logical and semantic to remove the `hidden` class when the panel is displayed. Plus, it prevents from weird behavior occurring when plugins also use the `hidden` class to hide stuff.

Props grabmedia, SergeyBiryukov, helen, sabernhardt, costdev, audrasjb.
Fixes #27697.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53736 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-15 12:29:12 +00:00
hellofromTonya
f3ff15edfc Themes: Introduces block-based template parts for Classic themes.
Allows Classic / Hybrid themes to use block-based template parts without using complete block-based templates.

* Exposes the Site Editor's template parts UI
* Adds Appearance > "Template Parts" menu
* Enabled within the theme via adding a theme support for `'block-template-parts'`
{{{#!php
add_theme_support( 'block-template-parts' );
}}}

This is a backport from Gutenberg.[https://github.com/WordPress/gutenberg/pull/42729 See WordPress/gutenberg PR 42729].

Follow-up to [52330], [52069], [52178].

Props mamaduka, fabiankaegy, poena, scruffian, manfcarlo, bernhard-reiter, hellofromTonya.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54176


git-svn-id: http://core.svn.wordpress.org/trunk@53735 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-15 12:20:09 +00:00
audrasjb
5ea7b42f89 Editor: Backport build_query_vars_from_query_block changes from Gutenberg repository.
This changeset backports changes from the following Gutenberg pull requests:

- [https://github.com/WordPress/gutenberg/pull/43590 gutenberg#43590] Add a filter to `build_query_vars_from_query_block`
- [https://github.com/WordPress/gutenberg/pull/40933 gutenberg#40933] Block Library - Query Loop: Add parents filter

Props ntsekouras, bernhard-reiter.
See #56467.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53734 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-15 11:41:10 +00:00
audrasjb
c72fae1c58 Editor: Backport wp_theme_element_class_name() alias.
This changeset backports the `wp_theme_element_class_name()` alias for the "internal" `WP_Theme_JSON::get_element_class_name()` function.

This is a backport of [https://github.com/WordPress/gutenberg/pull/44099 gutenberg/PR44099].

Note: this changeset doesn't replace calls to `WP_Theme_JSON::get_element_class_name` in the tests, since those are specifically for the `WP_Theme_JSON` class.

Props bernhard-reiter, cbravobernal, costdev.
See #56467.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53733 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-15 10:55:08 +00:00
audrasjb
81ada51ba4 Docs: Use third-person singular verbs in Media API function descriptions, as per docblocks standards.
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53732 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-15 10:52:08 +00:00
audrasjb
83a2c2428a Docs: Add missing @since history in Gallery Shortcode function.
Props bengreeley, audrasjb, desrosj, mukesh27.
Fixes #56206.
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-15 08:56:08 +00:00
audrasjb
11fdb19ae3 Twenty Nineteen: Define underline thickness for links.
This changeset adds `text-decoration-thickness: 2px;` to all underlined link to ensure that underline thickness stay consistent across browsers. This fixes an issue where the underline style on links using the Hoefler Text font was too thin in Firefox.

Props allancole, sabernhardt, danfarrow, audrasjb, neychok, multidots1896, maartenj.
Fixes #45925.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53730 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-15 08:35:18 +00:00
audrasjb
1efbea5145 Twenty Twenty-One: Remove WooCommerce related CSS selectors.
The selectors for Twenty Twenty-One's default `max-width` have used the `.woocommerce` class since the theme's [956a3172a4 (diff-b757cb999144a1bc7e14604bc6d4bab7d87ea1a3bf5000c33937e490d75b9d92R3-R9) initial commit]. This changeset removes all WooCommerce CSS selector from the theme, as they would need to be supported forever. The change was tested with WooCommerce installed and no issues were raised. 

Props sabernhardt, audrasjb, davidbaumwald, tahmidulkarim, mukesh27.
Fixes #56366.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53729 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-14 22:33:10 +00:00
Andrew Ozz
c9d23006db Site health:
- Add a check to `wp_check_php_version()` whether the current PHP version is lower than the next (desired) minimum version.
- Set the next desired minimum PHP version to 7.2.
- Use that check to update the warnings in the `wp_dashboard_php_nag()` widget, and on the Site Health screen.

Props Clorith, SergeyBiryukov, ironprogrammer, azaozz.
See #56199.
Built from https://develop.svn.wordpress.org/trunk@54169


git-svn-id: http://core.svn.wordpress.org/trunk@53728 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-14 22:19:14 +00:00
audrasjb
e254c02be5 Twenty Twenty-Two: Add "Accessibility Ready" tag to theme in repository
A cross-team consensus has been reached to allow Twenty Twenty-Two to be tagged as "Accessibility Ready" on the WordPress Themes repository.

Props bph, kjellr, utz119, ryokuhi, joedolson, audrasjb, mikeschroder, poena, annezazu.
Fixes #55172.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53727 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-14 21:52:14 +00:00
audrasjb
6d5fca2685 Twenty Twenty: Fix Social Links widget alignment.
This fixes an alignment issue with the Social Links block used in the context of a widget area.

Props grandeljay, sabernhardt.
Fixes #56474.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53726 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-14 21:34:10 +00:00
audrasjb
ea0711255f Twenty Twenty: Ensure Latest Posts block set to 2 columns displays accordingly in the Editor.
This brings consistency between block editor and front-end rendering.

Props smit08, mukesh27, sabernhardt, multidots1896.
Fixes #56175.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53725 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-14 21:19:10 +00:00
Andrew Ozz
136dc2b108 Site health: Add a menu bubble with the critical issues count to the Tools -> Site Health submenu.
Props: Clorith
See: #56199

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


git-svn-id: http://core.svn.wordpress.org/trunk@53724 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-14 21:14:14 +00:00
audrasjb
ae532c8ef2 Twenty Twenty-One: Fix Heading Block alignment when nested in Cover Block.
This brings consistency between block editor and front-end rendering.

Props mrfoxtalbot, kajalgohel, harshvaishnav, audrasjb.
Fixes #56050.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53723 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-14 20:51:16 +00:00
audrasjb
9ea8cc678c Twenty Twenty: Fix Heading Block alignment when nested in Cover Block.
This brings consistency between block editor and front-end rendering.

Props mrfoxtalbot, tahmidulkarim, NomNom99, audrasjb.
Fixes #56049.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53722 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-14 19:43:13 +00:00
hellofromTonya
bfcd054304 Editor: Backport foundation for Layout block support refactor (part 1).
Backports the following changes from the Gutenberg repository:

* [WordPress/gutenberg/40875 gutenberg/40875] Layout: Use semantic classnames, centralize layout definitions, reduce duplication, and fix blockGap in theme.json
* [WordPress/gutenberg/42544 gutenberg/42544] Layout: Add a disable-layout-styles theme supports flag to opt out of all layout styles gutenberg/42544
* [WordPress/gutenberg/42087 gutenberg/42087] Theme.json: Add block support feature level selectors for blocks gutenberg/42087
* [WordPress/gutenberg/43792 gutenberg/43792] Global Styles: Split root layout rules into a different function gutenberg/43792
* [WordPress/gutenberg/42544 gutenberg/42544] Layout: Add a disable-layout-styles theme supports flag to opt out of all layout styles gutenberg/42544
* [WordPress/gutenberg/42665 gutenberg/42665] Layout: Reduce specificity of fallback blockGap styles gutenberg/42665
* [WordPress/gutenberg/42085 gutenberg/42085] Core CSS support for root padding and alignfull blocks gutenberg/42085

Notes:
* It doesn't entirely port over PR 40875 — the remaining PHP changes for that PR will be explored in a separate PR targeting `layout.php`.
* [54159] was reverted in [54160] due to PHPUnit test failures for tests added by the commit. Later, tests passed when applied on top of `trunk`. There were various outages today of upstream `wp-env` dependencies, which likely were the root cause of the earlier failures. For historical tracking and to make sure, recommitting [54159] but instead on top of current `trunk`. See PR 3205 for more details.
* Giving additional props for those who did a deep dive investigation into the failed tests.

Follow-up to [54160], [54159].

Props andrewserong, aaronrobertshaw, isabel_brison, bernhard-reiter, hellofromTonya.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54162


git-svn-id: http://core.svn.wordpress.org/trunk@53721 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-14 18:44:09 +00:00
Sergey Biryukov
2c79eaf031 Feeds: Add a set of fine-grained filters to disable the different types of feed links separately.
The previously available set of filters in the `feed_links()` function to enable or disable display of various feed links was quite limited:
* `feed_links_show_posts_feed` to control the main feed
* `feed_links_show_comments_feed` to control both the global comments feed and the comment feed for singular posts.

In order to disable the other feeds (post type archive, category, tag, custom taxonomy, author archive, search results), one would have to unhook `feed_links_extra()` from `wp_head`, but that would completely remove all of those feeds, as well as the single post comments feed.

To allow for more flexibility, this commit introduces a full set of filters in the `feed_links_extra()` function to control each one of the feeds independently, including a way to enable/disable the single post comments feed when the global comments feed is disabled/enabled:

* `feed_links_extra_show_post_comments_feed`
* `feed_links_extra_show_post_type_archive_feed`
* `feed_links_extra_show_category_feed`
* `feed_links_extra_show_tag_feed`
* `feed_links_extra_show_tax_feed`
* `feed_links_extra_show_author_feed`
* `feed_links_extra_show_search_feed`

All of them default to `true`, except for `feed_links_extra_show_post_comments_feed` which defaults to the result of `feed_links_show_comments_feed` to ensure backward compatibility.

Follow-up to [33838], [33839], [53125].

Props lopo, mukesh27, audrasjb, SergeyBiryukov.
Fixes #55904.
Built from https://develop.svn.wordpress.org/trunk@54161


git-svn-id: http://core.svn.wordpress.org/trunk@53720 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-14 17:14:10 +00:00
hellofromTonya
d5c8952218 Editor: Revert [54159].
Reverting changeset due to failing PHPUnit tests. Tests pass without changeset [54156], but fail with it. Reverting to explore why in the original PR after rebasing.

See #56467.
Built from https://develop.svn.wordpress.org/trunk@54160


git-svn-id: http://core.svn.wordpress.org/trunk@53719 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-14 15:52:11 +00:00
audrasjb
c2ff10f1c1 Editor: Backport foundation for Layout block support refactor (part 1).
This change backports the following changes from Gutenberg repository:

- [WordPress/gutenberg#40875 gutenberg#40875] Layout: Use semantic classnames, centralize layout definitions, reduce duplication, and fix blockGap in theme.json
- [WordPress/gutenberg#42544 gutenberg#42544] Layout: Add a disable-layout-styles theme supports flag to opt out of all layout styles gutenberg#42544
- [WordPress/gutenberg#42087 gutenberg#42087] Theme.json: Add block support feature level selectors for blocks gutenberg#42087
- [WordPress/gutenberg#43792 gutenberg#43792] Global Styles: Split root layout rules into a different function gutenberg#43792
- [WordPress/gutenberg#42544 gutenberg#42544] Layout: Add a disable-layout-styles theme supports flag to opt out of all layout styles gutenberg#42544
- [WordPress/gutenberg#42665 gutenberg#42665] Layout: Reduce specificity of fallback blockGap styles gutenberg#42665
- [WordPress/gutenberg#42085 gutenberg#42085] Core CSS support for root padding and alignfull blocks gutenberg#42085

Note that it doesn't entirely port over PR40875 — the remaining PHP changes for that PR will be explored in a separate PR targeting `layout.php`.

Props andrewserong, aaronrobertshaw, isabel_brison.
See #56467.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53718 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-14 14:21:22 +00:00
gziolo
69040b7afe Code Quality: Remove unwanted spaces in the WP_Block_Type class
Follow-up [54155].
Props TobiasBg.


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


git-svn-id: http://core.svn.wordpress.org/trunk@53717 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-14 13:53:13 +00:00
Sergey Biryukov
a2aa01cdac Docs: Correct @return value for wp_get_http_headers().
Following the update to replace the HTTP API internals with Requests library in WordPress 4.6, the return value of `wp_remote_retrieve_headers()` has changed from a simple array to an object which implements `ArrayAccess`.

Since `wp_get_http_headers()` directly returns the result of `wp_remote_retrieve_headers()`, its return value should reflect that change.

Includes:
* Updating the return value for the deprecated `wp_get_http()` function, which also directly returns the result of `wp_remote_retrieve_headers()`.
* Minor DocBlock formatting changes for some other HTTP API functions per the documentation standards.

Follow-up to [2416], [6390], [8092], [9013], [37428], [37989], [38730].

Props mhkuu.
See #54225, #55646.
Built from https://develop.svn.wordpress.org/trunk@54157


git-svn-id: http://core.svn.wordpress.org/trunk@53716 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-14 13:08:14 +00:00
audrasjb
1e791f041d Editor: Backport Style Engine API functions, classes and tests.
This PR migrates the Style Engine PHP functions, classes and tests into Core for 6.1. It backports the original [WordPress/gutenberg#40260 PR #40260] from Gutenberg repository.

Props ramonopoly, bernhard-reiter, costdev, azaozz, andrewserong, mukesh27, aristath.
See #56467.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-14 12:48:16 +00:00
gziolo
714e57b2fc Blocks: Allow registering multiple items for all supported asset types
Follow-up #54337, [52069]. Part of https://github.com/WordPress/gutenberg/issues/41236. More details in https://github.com/WordPress/gutenberg/issues/33542.

Allow passing more than one script per block for `editorScript`, `script`, and `viewScript` fields in the `block.json` metadata file. This aligns with the previously added changes for `style` and `editorStyle` fields.

This change impacts the `WP_Block_Type` class and the REST API endpoint for block types. To ensure backward compatibiliy old names were soft deprecated in favor of new fields that work with array values and have `_handles` suffix.

Props zieladam, dlh, timothyblynjacobs, aristath, bernhard-reiter.
Fixes #56408.


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


git-svn-id: http://core.svn.wordpress.org/trunk@53714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-14 10:52:08 +00:00
audrasjb
1f47c2bcbf Twenty Twenty: Ensure headings styles are consistent between editor and front-end.
This changeset removes `.wp-block` container from headings CSS selectors to restore consistency between editor and front-end styles. It also removes `.wp-block` from headings selectors in the `'block-editor'` array of `twentytwenty_get_localized_font_family_elements()`.

Props kajalgohel, kmadhak, poena, multidots1896, tahmidulkarim, audrasjb.
Fixes #56194.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-14 10:48:11 +00:00
audrasjb
5499d60580 Twenty Twenty: Ensure link color is inherited from paragraph in the editor.
This changeset improves link colors consistency between front-end and the editor.

Props sabernhardt, webcommsat, audrasjb.
Fixes #56214.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53712 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-14 10:19:12 +00:00
audrasjb
b078199637 Twenty Twenty: Correctly align Social Icons block in the editor.
This changeset resets `padding-left` property for the Social Icons block in the editor.

Props umesh84, audrasjb, nidhidhandhukiya, kajalgohel.
Fixes #55987.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53711 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-14 10:04:10 +00:00
audrasjb
3eff1ca584 Twenty Fifteen: Ensure border-bottom styles are applied to the Button Block.
This issue was related to the `:where()` selector, which also affected Twenty Twenty (see #55824).

Props umesh84, sabernhardt.
Fixes #55006.
See #55824.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53710 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-14 09:31:12 +00:00
Sergey Biryukov
aa22aba0ba Upgrade/Install: Update sodium_compat to v1.18.0.
The latest version of sodium_compat includes some improvements, as well as a new feature which will also be included in PHP 8.2.

* Fixed issues with the PHP autoloader:
 * [https://github.com/paragonie/sodium_compat/pull/145 #145]: For WordPress, this ensures when Ed25519 is included, so too is the class it inherits from.
 * [https://github.com/paragonie/sodium_compat/issues/148 #148], [https://github.com/paragonie/sodium_compat/issues/149 #149]: For PHP 7.4+ with opcache preloading, this ensures the include guards don't fail.
* [https://github.com/paragonie/sodium_compat/pull/144 #144]: Added `sodium_crypto_stream_xchacha20_xor_ic()`
 * See [https://github.com/php/php-src/pull/8276 pull request for php-src] (merged in PHP 8.2)
 * For motivation: [https://github.com/paragonie/halite/issues/178 paragonie/halite#178]

Release notes:
https://github.com/paragonie/sodium_compat/releases/tag/v1.18.0

A full list of changes in this update can be found on GitHub:
https://github.com/paragonie/sodium_compat/compare/v1.17.1...v1.18.0

Follow-up to [49741], [51002], [51591], [52988].

Props jrf, paragoninitiativeenterprises.
Fixes #56564.
Built from https://develop.svn.wordpress.org/trunk@54150


git-svn-id: http://core.svn.wordpress.org/trunk@53709 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-14 00:13:14 +00:00
audrasjb
7c01b0a340 Plugins: Visually align plugin cards in Plugin Install screen.
This changeset adds a flexible CSS columns layout to plugin cards in the Plugin Install screen, to ensure plugin cards all have the same height.

Props jamesckemp, audrasjb, joyously, sabernhardt, sharjeelkhanvmi, joyously.
Fixes #55721.
See #55272.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53708 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-13 21:51:12 +00:00
Sergey Biryukov
30a13227bd Tests: Rename the test for wp_guess_url() to match the function name.
Includes adding `public` visibilty keyword for the data provider.

Follow-up to [54146].

See #36827.
Built from https://develop.svn.wordpress.org/trunk@54148


git-svn-id: http://core.svn.wordpress.org/trunk@53707 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-13 20:40:11 +00:00
Sergey Biryukov
e9d2ae077c Tests: Rename the test for pre_option filter to match the filter name.
Move the method to a more appropriate place, next to the test for `default_option_*` filter.

Follow-up to [54145].

See #37930.
Built from https://develop.svn.wordpress.org/trunk@54147


git-svn-id: http://core.svn.wordpress.org/trunk@53706 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-13 20:21:08 +00:00
davidbaumwald
1db23fca3f General: Correct path replacement regex in wp_guess_url.
In `wp_guess_url`, the regex to check for wp-login.php in the URL is slightly too permissive, not escaping `.` in "wp-login.php".  `.` is a token in regex that matches any character.

This change simply escapes the `.` and adds unit test coverage for `wp_guess_url`.

Props cfinke, ocean90, jrf, voldemortensen, jdgrimes, curdin, netweb, petitphp, SergeyBiryukov, costdev.
Fixes #36827.
Built from https://develop.svn.wordpress.org/trunk@54146


git-svn-id: http://core.svn.wordpress.org/trunk@53705 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-13 19:50:12 +00:00
davidbaumwald
11a582b0d4 Options, Meta APIs: Add a new pre-option filter.
Although a `pre_option_{$option}` filter already exists, this change adds a more general `pre_option` filter that will run on every `get_option` call.  This brings the control flow into similar flow as `update_option`.

Props flixos90, NathanAtmoz, desrosj, spacedmonkey, pbearne.
Fixes #37930.
Built from https://develop.svn.wordpress.org/trunk@54145


git-svn-id: http://core.svn.wordpress.org/trunk@53704 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-13 19:29:12 +00:00
davidbaumwald
2608eae664 General: Add a new filter for the_posts_pagination_args.
Props pbiron, joyously, audrasjb, robinwpdeveloper.
Fixes 53392.
Built from https://develop.svn.wordpress.org/trunk@54144


git-svn-id: http://core.svn.wordpress.org/trunk@53703 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-13 18:05:09 +00:00
Sergey Biryukov
4229519bec Upgrade/Install: Remove _copy_dir() function as originally intended.
WordPress 3.2 introduced several enhancements to the `copy_dir()` function:
* No more re-installing Akismet upon upgrade.
* Respect custom `WP_CONTENT_DIR` for bundled plugins/theme installation.
* Respect custom `WP_CONTENT_DIR`/`WP_LANG_DIR` for language files when upgrading.
* Add an exclusion list to `copy_dir()` as well as `WP_Filesystem_Base::wp_lang_dir()`.
* Standardize `WP_Filesystem` path method returns.

However, the version of `copy_dir()` that runs during the upgrade process is the one from the older install, not the newer, which means that these enhancements would only be available after upgrading to WordPress 3.2 first, e.g. in a subsequent upgrade to WordPress 3.3.

In order to make these enhancements immediately available in WordPress 3.2, specifically to take advantage of skip lists and avoid re-installing Akismet if it was previously deleted, a temporary copy of the function was utilized, with the intention to remove it in WordPress 3.3 or a later release.

With further enhancements made to the Upgrade API to support partial and no-content builds, this temporary copy is no longer relevant and can be safely removed.

Follow-up to [17576], [17580], [17581], [18225].

Props afragen, costdev, dd32, peterwilsoncc, SergeyBiryukov.
Fixes #55712. See #17173.
Built from https://develop.svn.wordpress.org/trunk@54143


git-svn-id: http://core.svn.wordpress.org/trunk@53702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-13 16:57:10 +00:00
Sergey Biryukov
47b11120d8 Code Modernization: Fix autovivification from false to array in WP_Scripts::localize().
This function was previously already problematic as it does not do proper input validation, and it has already received tweaks related to PHP 8.0 in [50408] / #52534, which also introduced a `_doing_it_wrong()` notice and added tests.

The short of it is:
* The function expects to receive an `array` for the `$l10n` parameter;
* ...but silently supported the parameter being passed as a `string`;
* ...and would expect PHP to gracefully handle everything else or throw appropriate warnings/errors.

In the previous fix, a `_doing_it_wrong()` notice was added for any non-array inputs. The function would also cause a PHP native "Cannot use a scalar value as an array" warning (PHP < 8.0) or error (PHP 8.0+) for all scalar values, except `false`.

PHP 8.1 deprecated autovivification from `false` to `array`, so now `false` starts throwing an "Automatic conversion of false to array is deprecated" notice.

By rights, the function should just throw an exception when a non-array/string input is received, but that would be a backward compatibility break.

So the current change will maintain the previous behavior, but will prevent both the "Cannot use a scalar value as an array" warning/error as well as the "Automatic conversion of false to array" deprecation notice for invalid inputs.

Invalid inputs ''will'' still receive a `_doing_it_wrong()` notice, which is the reason this fix is considered acceptable.

Includes:
* Adding a test passing an empty array.
* Adding a test to the data provider for a `null` input to make sure that the function will not throw a PHP 8.1 "passing null to non-nullable" notice.

This solves the following PHP 8.1 test error:
{{{
Tests_Dependencies_Scripts::test_wp_localize_script_data_formats with data set #8 (false, '[""]')
Automatic conversion of false to array is deprecated

/var/www/src/wp-includes/class.wp-scripts.php:514
/var/www/src/wp-includes/functions.wp-scripts.php:221
/var/www/tests/phpunit/tests/dependencies/scripts.php:1447
/var/www/vendor/bin/phpunit:123
}}}

Reference: [https://www.php.net/manual/en/migration81.deprecated.php#migration81.deprecated.core.autovivification-false PHP Manual: PHP 8.1 Deprecations: Autovivification from false].

Follow-up to [7970], [18464], [18490], [19217], [50408].

Props jrf, costdev.
See #55656.
Built from https://develop.svn.wordpress.org/trunk@54142


git-svn-id: http://core.svn.wordpress.org/trunk@53701 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-13 15:58:12 +00:00
audrasjb
b089b1d99c Twenty Twenty: Improve support for Post Title block alignment.
This changeset ensures alignement settings are correctly reflected for the Post Title block in the Editor.

Props smit08, kajalgohel, devtanbir, sabernhardt, audrasjb.
Fixes #56167.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53700 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-13 08:47:12 +00:00
audrasjb
fd3e5e5f21 Themes: Implement file description for theme.json.
This changeset adds a file description for `theme.json`. This description is notably used in the Theme File Editor.

Props ocean90, kapilpaul, poena.
Fixes #55325.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53699 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-13 08:20:13 +00:00
audrasjb
bcdc46c51c Twenty Seventeen: Ensure long text wraps correctly in the Button Block.
This changeset replaces `white-space: nowrap` with `white-space: preline` to ensure long text used in the button block correctly wraps to a second line.

Follow-up to [44148].

Props robertghetau, bhrugesh12, sabernhardt, mukesh27.
Fixes #55783.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-12 23:50:11 +00:00
audrasjb
7c4a64e67b Editor: Hide query loop pagination link arrows from assistive technology.
This changeset adss an `aria-hidden="true"` attribute to the optional arrows/chevron characters to the Query Loop and to the Comments Query Loop blocks pagination links.

These characters are text, so they're read out by assistive technologies. For better accessibility, it's best to reduce noise for screen reader users and prevent them to be rendered, using the `aria-hidden="true"` attribute.

Follow-up to [52057].

Props afercia, sabernhardt, kamig478, zieladam, audrasjb, joedolson, costdev.
Fixes #56067.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53697 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-12 23:34:12 +00:00
audrasjb
43b406a5ee Comments: Make wp_required_field_indicator() and wp_required_field_message() output filterable.
This changeset introduces two new hooks:

- `wp_required_field_indicator` allows developers to filter the HTML output of the `wp_required_field_indicator()` function.
- `wp_required_field_message` does the same for the `wp_required_field_message()` function.

The changeset also adds new phpunit tests for these filters.

Follow-up to [53888], [54136].

Props kebbet, audrasjb, sabernhardt, costdev, mukesh27.
Fixes #56389.
See #54394.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-12 22:31:10 +00:00
audrasjb
6b6302f95e Comments: Remove aria-hidden="true" attribute for visible text in comment template.
This changeset removes `aria-hidden="true"` attribute used for required fields in comments template, for better accessibility. It removes the attribute from both `wp_required_field_indicator()` and `wp_required_field_message()` patterns.

Follow-up to [53888].

Props juliemoynat, audrasjb, joedolson, sabernhardt, afercia, costdev.
Fixes #55717.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-12 21:52:10 +00:00
Sergey Biryukov
59e1077010 Code Modernization: Pass correct value to parse_url() in WP_Customize_Manager::get_return_url().
This particular code block only makes sense to run when `$this->return_url` is not null. Previously, it caused a "passing null to non-nullable" deprecation notice on PHP 8.1.

By moving the code into the `if ( $this->return_url )` condition block, the code will only be run when `$this->return_url` contains a non-falsey/non-null value.

No additional tests added as this issue was found via the existing tests for the function containing the bug.

This solves the following two PHP 8.1 test errors:
{{{
1) Tests_WP_Customize_Manager::test_return_url
parse_url(): Passing null to parameter #1 ($url) of type string is deprecated

/var/www/src/wp-includes/class-wp-customize-manager.php:4696
/var/www/tests/phpunit/tests/customize/manager.php:2975
/var/www/vendor/bin/phpunit:123

2) Tests_WP_Customize_Manager::test_customize_pane_settings
parse_url(): Passing null to parameter #1 ($url) of type string is deprecated

/var/www/src/wp-includes/class-wp-customize-manager.php:4696
/var/www/src/wp-includes/class-wp-customize-manager.php:4898
/var/www/tests/phpunit/tests/customize/manager.php:3085
/var/www/vendor/bin/phpunit:123
}}}

Follow-up to [46754].

Props jrf, costdev.
See #55656.
Built from https://develop.svn.wordpress.org/trunk@54135


git-svn-id: http://core.svn.wordpress.org/trunk@53694 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-12 21:50:14 +00:00
Sergey Biryukov
ca57157a39 Code Modernization: Replace deprecated string interpolation patterns.
PHP 8.2 deprecates string interpolation patterns that place the dollar sign outside the curly braces:
{{{
echo "Hello ${name}";
}}}

This commit fixes such patterns by replacing them with proper curly braced patterns:
{{{
echo "Hello {$name}";
}}}

This addresses `Deprecated: Using ${var} in strings is deprecated, use {$var} instead` notices when running tests on PHP 8.2.

References:
* [https://php.watch/versions/8.2/$%7Bvar%7D-string-interpolation-deprecated PHP.Watch: PHP 8.2: ${var} string interpolation deprecated]
* [https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation PHP RFC: Deprecate ${} string interpolation]

Follow-up to [10584], [31733], [42360], [53922].

Props ayeshrajans, jrf.
Fixes #55787.
Built from https://develop.svn.wordpress.org/trunk@54134


git-svn-id: http://core.svn.wordpress.org/trunk@53693 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-12 17:52:08 +00:00
Sergey Biryukov
c03305852e Code Modernization: Add AllowDynamicProperties attribute to all (parent) classes.
Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0.

There are a number of ways to mitigate this:
* If it is an accidental typo for a declared property: fix the typo.
* For known properties: declare them on the class.
* For unknown properties: add the magic `__get()`, `__set()`, et al. methods to the class or let the class extend `stdClass` which has highly optimized versions of these magic methods built in.
* For unknown ''use'' of dynamic properties, the `#[AllowDynamicProperties]` attribute can be added to the class. The attribute will automatically be inherited by child classes.

Trac ticket #56034 is open to investigate and handle the third and fourth type of situations, however it has become clear this will need more time and will not be ready in time for WP 6.1.

To reduce “noise” in the meantime, both in the error logs of WP users moving onto PHP 8.2, in the test run logs of WP itself, in test runs of plugins and themes, as well as to prevent duplicate tickets from being opened for the same issue, this commit adds the `#[AllowDynamicProperties]` attribute to all “parent” classes in WP.

The logic used for this commit is as follows:
* If a class already has the attribute: no action needed.
* If a class does not `extend`: add the attribute.
* If a class does `extend`:
 - If it extends `stdClass`: no action needed (as `stdClass` supports dynamic properties).
 - If it extends a PHP native class: add the attribute.
 - If it extends a class from one of WP's external dependencies: add the attribute.
* In all other cases: no action — the attribute should not be needed as child classes inherit from the parent.

Whether or not a class contains magic methods has not been taken into account, as a review of the currently existing magic methods has shown that those are generally not sturdy enough and often even set dynamic properties (which they should not). See the [https://www.youtube.com/watch?v=vDZWepDQQVE live stream from August 16, 2022] for more details.

This commit only affects classes in the `src` directory of WordPress core.
* Tests should not get this attribute, but should be fixed to not use dynamic properties instead. Patches for this are already being committed under ticket #56033.
* While a number bundled themes (2014, 2019, 2020, 2021) contain classes, they are not a part of this commit and may be updated separately.

Reference: [https://wiki.php.net/rfc/deprecate_dynamic_properties PHP RFC: Deprecate dynamic properties].

Follow-up to [53922].

Props jrf, hellofromTonya, markjaquith, peterwilsoncc, costdev, knutsp, aristath.
See #56513, #56034.
Built from https://develop.svn.wordpress.org/trunk@54133


git-svn-id: http://core.svn.wordpress.org/trunk@53692 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-12 15:47:14 +00:00
gziolo
b0f4c2c37e Blocks: Add new render property in block.json for block types
New `render` field in `block.json` file that accepts a string value. It allows to pass a path to the PHP file that is going to be used to render the block on the server.  Related PR in Gutenberg: https://github.com/WordPress/gutenberg/pull/42430.

Props spacedmonkey, luisherranz, welcher, noisysocks, matveb, fabiankaegy, aristath, zieladam.
Fixes #53148.


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


git-svn-id: http://core.svn.wordpress.org/trunk@53691 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-12 13:14:13 +00:00
TimothyBlynJacobs
950bf585bc REST API: Add support for settings to specify their own additionalProperties.
This switches the Settings Controller to use `rest_default_additional_properties_to_false` and deprecates its own method.

Props anna.bansaghi.
Fixes #56493.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53690 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-11 23:30:10 +00:00
antpb
f185aeb638 Autosave/REST API: Block autosaving from overwriting changes when locked from editing.
Previously when a user was locked from editing a post in the block editor, autosave functionality was allowed to overwrite changes made by the editor that has taken control. This patch honors the lock status keeping autosave from conflicitng with other content editors. 

Props jhart35, adamsilverstein, sathyapulse, chanthaboune, primetimejas, joemcgill, kadamwhite.
Fixes #55659.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53689 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-11 22:35:08 +00:00
Helen Hou-Sandí
3ca1825716 Embeds: Add Google Data Studio as a trusted oEmbed provider
Props swissspidy
Fixes #55771

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


git-svn-id: http://core.svn.wordpress.org/trunk@53688 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-11 22:25:10 +00:00
antpb
fbe878f68d Media: Add muted property for video elements.
This change allows for the muted property to be used in video elements which solves for content that wishes to `autoPlay` when a page is viewed. Adding `muted` to video elements adhears to the requirements browsers have to honor `autoPlay` functionality.

Props prokium, peterwilsoncc, costdev, johnbillion, Benouare.
Fixes #54788.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-11 22:19:10 +00:00
K. Adam White
bd607c1118 REST API: Introduce _pretty query parameter to opt in to JSON_PRETTY_PRINT.
Add support for a "_pretty" meta-parameter on all REST controllers which instructs WordPress to return pretty-printed JSON, for better readability when inspecting endpoint responses in curl output or certain developer tools.

Introduce the "rest_json_encode_options" filter to permit site owners to control this behavior globally.

Props Viper007Bond, TimothyBlynJacobs, chrisguitarguy, johnbillion, swissspidy, adamsilverstein, danielbachhuber, rmccue.
Fixes #41998.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-11 22:02:09 +00:00
Pascal Birchler
7973933ad6 Date/Time: Cast extracted strings to integers in wp_resolve_post_date().
`wp_resolve_post_date()` extracts year/month/day from a post date (which is a string) and passes it to `wp_checkdate` (and from there to `checkdate()`), which requires `int`s.

Casting the strings to integers avoids PHP notices due to incorrect argument types.

Props hilayt24.
Fixes #54186
Built from https://develop.svn.wordpress.org/trunk@54126


git-svn-id: http://core.svn.wordpress.org/trunk@53685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-11 21:59:09 +00:00
Weston Ruter
aee27cf6c0 Customize: Prevent JS error in Links widget when selective refresh is enabled
This prevents erroneously replacing the `data-customize-partial-id` when only the `id` attribute should be replaced. 

Props dlh, costdev, nikeo, greenshady.
Fixes #39451.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-11 21:57:09 +00:00
Aaron Jorbin
6937c8d87e Build/Test: Prevent using unsupported NPM versions.
Using NPM 7+ currently causes a number of issues. In order to improve developer experience, we should prevent a developer from going down the road of using incompatible engines.

See also: https://github.com/WordPress/gutenberg/pull/29204 and https://github.com/WordPress/gutenberg/pull/23600.

Props rcorrales.
Fixes #56547.


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


git-svn-id: http://core.svn.wordpress.org/trunk@53683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-11 21:54:08 +00:00
TimothyBlynJacobs
fc4485c17f REST API: Add support for searching resources by id.
This brings support for the `include` and `exclude` collection parameters to the Search Controller. This can be used to find an item by id when it's subtype is unknown.

Props kadamwhite.
Fixes #56546.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-11 21:12:11 +00:00
Joe McGill
8f390b309a Editor: Refresh nones for metaboxes after reauthentication.
This fixes an issue where metaboxes fail to save after a session expires and a user logs in again via the heartbeat API.

Props LinSoftware.
Fixes #52584.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53681 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-11 20:46:10 +00:00
TimothyBlynJacobs
ef6619d68e REST API: Use helper functions for building routes in more places.
Props get_dave, spacedmonkey.
Fixes #56472.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53680 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-11 18:55:09 +00:00
Aaron Jorbin
a99adb76ed Customize: Use Semantically correct function
Functionally, `add_action` and `add_filter` are essentially the same, but semantically they are not.

Props Drivingralle.
Fixes #56285.


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


git-svn-id: http://core.svn.wordpress.org/trunk@53679 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-11 18:18:10 +00:00
Sergey Biryukov
1a37650766 Docs: Correct @global tags in WP_User_Query::prepare_query().
* `$blog_id` global was replaced with `get_current_blog_id()` and is no longer used directly.
* `$wp_roles` global usage was previously undocumented.

Follow-up to [32637], [38457], [51943].

Props shoaibkarimali.
Fixes #56543.
Built from https://develop.svn.wordpress.org/trunk@54119


git-svn-id: http://core.svn.wordpress.org/trunk@53678 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-11 13:13:12 +00:00
Sergey Biryukov
70c0f6f0e1 Editor: Backport Elements API updates.
This commit backports the original PRs from Gutenberg repository:

* [https://github.com/WordPress/gutenberg/pull/40260 #40260 Add support for button elements to theme.json]
* [https://github.com/WordPress/gutenberg/pull/40889 #40889 Theme Json: Don't output double selectors for elements inside blocks]
* [https://github.com/WordPress/gutenberg/pull/41140 #41140 Global Styles: Add support for caption elements]
* [https://github.com/WordPress/gutenberg/pull/41160 #41160 Global Styles: Load block CSS conditionally]
* [https://github.com/WordPress/gutenberg/pull/41240 #41240 Global Styles: Button Element: update button element selector]
* [https://github.com/WordPress/gutenberg/pull/41335 #41335 Duotone: Fix CSS Selectors rendered by theme.json duotone/filter settings for blocks on public pages]
* [https://github.com/WordPress/gutenberg/pull/41446 #41446 Block styles: Account for style block nodes that have no name]
* [https://github.com/WordPress/gutenberg/pull/41696 #41696 Global Styles: Allow references to values in other locations in the tree]
* [https://github.com/WordPress/gutenberg/pull/41753 #41753 Elements: Add an API make it easier to get class names]
* [https://github.com/WordPress/gutenberg/pull/41786 #41786 Support pseudo selectors on elements in theme json]
* [https://github.com/WordPress/gutenberg/pull/41822 #41822 Elements: Button - Fix element selectors]
* [https://github.com/WordPress/gutenberg/pull/41981 #41981 Global Styles: Add support for heading elements]
* [https://github.com/WordPress/gutenberg/pull/42072 #42072 Fix link element hover bleeding into button element default styles]
* [https://github.com/WordPress/gutenberg/pull/42096 #42096 Add visited to link element allowed pseudo selector list]
* [https://github.com/WordPress/gutenberg/pull/42669 #42669 Link elements: Add a :where selector to the :not to lower specificity]
* [https://github.com/WordPress/gutenberg/pull/42776 #42776 Theme JSON: Add a static $blocks_metadata data definition to the Gutenberg instance of WP_Theme_JSON]
* [https://github.com/WordPress/gutenberg/pull/43088 #43088 Pseudo elements supports on button elements]
* [https://github.com/WordPress/gutenberg/pull/43167 #43167 Theme_JSON: Use existing append_to_selector for pseudo elements]
* [https://github.com/WordPress/gutenberg/pull/43988 #43988 Styles API: Fixed selectors for nested elements]

Props onemaggie, bernhard-reiter, cbravobernal, mmaattiiaass, scruffian, andraganescu, dpcalhoun, get_dave, Mamaduka, SergeyBiryukov.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54118


git-svn-id: http://core.svn.wordpress.org/trunk@53677 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-10 12:38:12 +00:00
Sergey Biryukov
9ba0095255 KSES: Allow assigning values to CSS variables.
The `safecss_filter_attr()` function allows using custom CSS variables like `color: var(--color)`. However, it did not allow assigning values to CSS variables like `--color: #F00`, which is common in Global Styles and Gutenberg.

This commit adds support for assigning values to CSS variables, so that the function can be used consistently in Global Styles and the future Style Engine in Gutenberg.

Follow-up to [50923], [54100].

Props aristath, ramonopoly, SergeyBiryukov.
Fixes #56353.
Built from https://develop.svn.wordpress.org/trunk@54117


git-svn-id: http://core.svn.wordpress.org/trunk@53676 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-09 12:39:11 +00:00
audrasjb
02032a7562 Docs: Clarify wp-includes/update.php main docblock description.
Props costdev, audrasjb.
See #55646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@53675 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-09 09:15:12 +00:00