46557 Commits

Author SHA1 Message Date
Joe Dolson
a091aade62 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54191 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-16 23:11:41 +00:00
Jb Audras
84550fcb64 Docs: Update wp_rand docblock to clarify that it returns a non-negative number.
Props hakre, westi, jeremyfelt, neychok, sabernhardt, audrasjb.
Fixes #15089.


git-svn-id: https://develop.svn.wordpress.org/trunk@54190 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-16 22:37:48 +00:00
Jb Audras
edb40d0954 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54189 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-16 22:25:54 +00:00
Jb Audras
c2ef1a020e 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54188 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-16 22:15:55 +00:00
Sergey Biryukov
dabab3f636 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54187 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-16 15:10:58 +00:00
Jonny Harris
53e58ebbb3 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54186 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-16 10:55:58 +00:00
Jb Audras
d4c62394e1 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54185 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-15 22:57:52 +00:00
Tonya Mork
72178ec839 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54184 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-15 22:26:28 +00:00
Sergey Biryukov
14e54b5d20 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54183 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-15 20:26:13 +00:00
Tonya Mork
fc6bc030d4 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54182 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-15 16:43:39 +00:00
Sergey Biryukov
2b4d385298 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54181 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-15 13:27:38 +00:00
Jb Audras
777a18d02f Docs: Use third-person singular verbs in Template Loading functions descriptions, as per docblocks standards.
See #55646.


git-svn-id: https://develop.svn.wordpress.org/trunk@54180 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-15 12:47:16 +00:00
Jb Audras
4e1752407b 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54179 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-15 12:42:35 +00:00
Sergey Biryukov
7bb7969664 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54178 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-15 12:30:54 +00:00
Jb Audras
9b6a3ecfcf 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54177 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-15 12:27:02 +00:00
Tonya Mork
98cfa29f8d 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54176 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-15 12:18:30 +00:00
Jb Audras
b98a8bbbd4 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54175 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-15 11:39:43 +00:00
Jb Audras
d0a771175d 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54174 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-15 10:53:18 +00:00
Jb Audras
7991edbabd Docs: Use third-person singular verbs in Media API function descriptions, as per docblocks standards.
See #55646.


git-svn-id: https://develop.svn.wordpress.org/trunk@54173 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-15 10:50:40 +00:00
Jb Audras
0b2f05a9f6 Docs: Add missing @since history in Gallery Shortcode function.
Props bengreeley, audrasjb, desrosj, mukesh27.
Fixes #56206.
See #55646.


git-svn-id: https://develop.svn.wordpress.org/trunk@54172 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-15 08:54:44 +00:00
Jb Audras
4c10e3e590 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54171 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-15 08:33:52 +00:00
Jb Audras
39617d8116 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54170 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-14 22:31:19 +00:00
Andrew Ozz
0fdfa266af 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54169 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-14 22:17:53 +00:00
Jb Audras
fe87f8e37a 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54168 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-14 21:50:12 +00:00
Jb Audras
235faff315 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54167 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-14 21:33:01 +00:00
Jb Audras
26fad95654 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54166 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-14 21:17:26 +00:00
Andrew Ozz
40861573b1 Site health: Add a menu bubble with the critical issues count to the Tools -> Site Health submenu.
Props: Clorith
See: #56199


git-svn-id: https://develop.svn.wordpress.org/trunk@54165 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-14 21:12:12 +00:00
Jb Audras
c2dcd6ef42 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54164 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-14 20:49:46 +00:00
Jb Audras
3e9fd8235f 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54163 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-14 19:41:54 +00:00
Tonya Mork
72380e31ca 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54162 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-14 18:42:04 +00:00
Sergey Biryukov
d6e842cd28 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54161 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-14 17:12:20 +00:00
hellofromTonya
759f2b3a05 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54160 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-14 15:50:01 +00:00
Jb Audras
34aeac1db2 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54159 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-14 14:19:16 +00:00
Greg Ziółkowski
7c86dfee68 Code Quality: Remove unwanted spaces in the WP_Block_Type class
Follow-up [54155].
Props TobiasBg.



git-svn-id: https://develop.svn.wordpress.org/trunk@54158 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-14 13:51:39 +00:00
Sergey Biryukov
e4a2e73d11 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54157 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-14 13:06:53 +00:00
Jb Audras
7fcc88a087 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54156 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-14 12:46:33 +00:00
Greg Ziółkowski
3381f05fa2 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@54155 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-14 10:50:26 +00:00
Jb Audras
73c668d791 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54154 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-14 10:46:51 +00:00
Jb Audras
960330890b 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54153 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-14 10:17:05 +00:00
Jb Audras
2030705bc5 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54152 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-14 10:02:10 +00:00
Jb Audras
a8f702f4c5 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54151 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-14 09:29:15 +00:00
Sergey Biryukov
11160414e5 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54150 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-14 00:11:11 +00:00
Jb Audras
a338319ce0 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@54149 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-13 21:49:14 +00:00
Sergey Biryukov
ebd2606b0d 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54148 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-13 20:38:56 +00:00
Sergey Biryukov
5225a99b9d 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54147 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-13 20:19:17 +00:00
David Baumwald
7b9d4cf54a 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54146 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-13 19:48:45 +00:00
David Baumwald
9bde2e9f26 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54145 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-13 19:27:19 +00:00
David Baumwald
751a7b81e3 General: Add a new filter for the_posts_pagination_args.
Props pbiron, joyously, audrasjb, robinwpdeveloper.
Fixes 53392.

git-svn-id: https://develop.svn.wordpress.org/trunk@54144 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-13 18:03:30 +00:00
Sergey Biryukov
d8b262968a 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54143 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-13 16:56:00 +00:00
Sergey Biryukov
695cd019c7 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54142 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-13 15:56:28 +00:00