49261 Commits

Author SHA1 Message Date
Joe Dolson
ee5142efbc Media: Accessibility: Copy attachment properties on site icon crop.
Add parity between site icon, custom header, and default image crop behaviors. [53027] fixed a bug where alt text and caption were not copied on custom headers, but did not apply that change in any other context.

Deprecate the `create_attachment_object` method in the `Wp_Site_Icon` and `Custom_Image_Header` classes and replace that functionality with the new function `wp_copy_parent_attachment_properties()` to improve consistency.

Props afercia, rcreators, jorbin, joedolson, huzaifaalmesbah, shailu25, swissspidy, mukesh27.
Fixes #60524.

git-svn-id: https://develop.svn.wordpress.org/trunk@57755 602fd350-edb4-49c9-b593-d223f7449a82
2024-03-02 20:13:02 +00:00
Pascal Birchler
04afd909aa Editor: do not expose protected post meta fields in block bindings.
Ignores meta keys which are considered protected or not registered to be shown in the REST API. Adds tests.

Props santosguillamot, swissspidy, gziolo, xknown, peterwilsoncc.
Fixes #60651.

git-svn-id: https://develop.svn.wordpress.org/trunk@57754 602fd350-edb4-49c9-b593-d223f7449a82
2024-03-02 14:11:53 +00:00
Pascal Birchler
5bf25d881f Build/Test Tools: Add initial tests for the WP_Filesystem_Direct class.
Since `WP_Filesystem_Direct` is by far the most used filesystem abstraction class, this facilitates future changes with sufficient test coverage.

Props swissspidy, costdev, mukesh27.
Fixes #57774.

git-svn-id: https://develop.svn.wordpress.org/trunk@57753 602fd350-edb4-49c9-b593-d223f7449a82
2024-03-02 14:05:38 +00:00
Sergey Biryukov
c828ba187a Docs: Document the $xmlrpc_logging global in logIO().
Follow-up to [1348], [19935].

Props viralsampat, upadalavipul, sabernhardt.
See #60021.

git-svn-id: https://develop.svn.wordpress.org/trunk@57752 602fd350-edb4-49c9-b593-d223f7449a82
2024-03-02 13:47:56 +00:00
Pascal Birchler
d1fafd868e Editor: Simplify sanitization code path in WP_Theme_JSON after [57496]
Removes the custom `WP_Theme_JSON::is_assoc()` method again in favor of the existing `wp_is_numeric_array()` helper function.

Props mmaattiiaass, costdev, swissspidy, spacedmonkey.
Fixes #60360.

git-svn-id: https://develop.svn.wordpress.org/trunk@57751 602fd350-edb4-49c9-b593-d223f7449a82
2024-03-02 13:39:43 +00:00
Pascal Birchler
919b833fbf Query: Remove leading whitespace from certain database queries.
Unintended leading whitespace at the beginning of a raw MySQL query led to unexpected behavior such as broken pagination. Eliminating said whitespace avoids that.

Adds unit tests to prevent regressions.

Props wpfed, swissspidy, ironprogrammer, tadamarketing, afercia.
Fixes #56841.

git-svn-id: https://develop.svn.wordpress.org/trunk@57750 602fd350-edb4-49c9-b593-d223f7449a82
2024-03-02 13:36:02 +00:00
Sergey Biryukov
0efafc1dfd Build/Test Tools: Use a consistent parameter name between rand_str() and rand_long_str().
Follow-up to [36272], [50265].

Props harsh175, sabernhardt.
Fixes #60401.

git-svn-id: https://develop.svn.wordpress.org/trunk@57749 602fd350-edb4-49c9-b593-d223f7449a82
2024-03-02 12:53:53 +00:00
Sergey Biryukov
3d8f3aa610 Docs: Document some globals in wp-settings.php.
Follow-up to [18532], [18993], [27158], [38362].

Props upadalavipul, viralsampat, sabernhardt.
See #60021.

git-svn-id: https://develop.svn.wordpress.org/trunk@57748 602fd350-edb4-49c9-b593-d223f7449a82
2024-03-02 10:45:27 +00:00
Sergey Biryukov
63a670d7f4 Docs: Correct the placement of @global tags in wp-includes/admin-bar.php.
Follow-up to [38810], [56209].

Props shailu25, sabernhardt.
See #60021.

git-svn-id: https://develop.svn.wordpress.org/trunk@57747 602fd350-edb4-49c9-b593-d223f7449a82
2024-03-01 22:41:23 +00:00
Joe Dolson
bb7de8b138 Customize: Accessibility: Label menu subitems when updating menus.
Fix missing subitem indicator when menu items in the Customizer are children of parent menu items & add menu item original title to button text. Adds parity with the admin menu editor and fixes a bug where the button text was 'untitled' if the menu item title had not been edited.

Props designsimply, afercia, celloexpressions, kushang78, joedolson, rcreators.
Fixes #32728.

git-svn-id: https://develop.svn.wordpress.org/trunk@57746 602fd350-edb4-49c9-b593-d223f7449a82
2024-03-01 16:19:23 +00:00
Pascal Birchler
186eeafb68 Quick/Bulk Edit: Ensure the “All” checkbox is properly toggled in certain scenarios.
When removing a single item from the bulk edit box or when adding more items, the “All” checkboxes at the top and bottom of the posts list table should be properly toggled.

Props hiteshtalpada, oglekler, webcommsat, ugyensupport, chaion07, Toru.
Fixes #59121.

git-svn-id: https://develop.svn.wordpress.org/trunk@57745 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-29 22:00:53 +00:00
Sergey Biryukov
0fb376ba9b Tests: Use assertSame() in post meta revisioning tests.
This ensures that not only the return values match the expected results, but also that their type is the same.

Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.

Includes correcting the test class name.

Follow-up to [56714].

See #59655.

git-svn-id: https://develop.svn.wordpress.org/trunk@57744 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-29 20:00:07 +00:00
Pascal Birchler
56f1a37bbe Interactivity API: Revert [57742] pending a Gutenberg package update.
This function can only be renamed after updating Gutenberg npm packages, as some of the core blocks already use this function.

See #60575.

git-svn-id: https://develop.svn.wordpress.org/trunk@57743 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-29 14:28:52 +00:00
Pascal Birchler
a92b25a341 Interactivity API: Rename data_wp_context() to wp_interactivity_data_wp_context().
Increases clarity about where the function belongs to, bringing it in line with other related functions.

Props swissspidy, gziolo, cbravobernal, youknowriad, ankitmaru, westonruter, luisherranz, darerodz.
Fixes #60575.

git-svn-id: https://develop.svn.wordpress.org/trunk@57742 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-29 12:26:19 +00:00
Pascal Birchler
f9ab386f63 Privacy: Update default privacy page content to use latest block markup.
Avoids “Updated Block” warnings being logged to the console.

Props 254volkan, swissspidy.
Fixes #60530.

git-svn-id: https://develop.svn.wordpress.org/trunk@57741 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-29 12:15:43 +00:00
Riad Benguella
9c415ed5fb Editor: Prevent infinite loops when filtering the font library folder.
Changing the font library is something we expect hosts to perform.
It's important that we make this filter as seemless as possible.
This commit prevents a potential infinite loop caused by calling wp_get_upload_dir() within the font_dir filter.

Props mmaattiiaass, ironprogrammer, costdev, swissspidy.
Fixes #60652.

git-svn-id: https://develop.svn.wordpress.org/trunk@57740 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-29 10:15:20 +00:00
Riad Benguella
a7943a9f02 Bundled Theme: Fix focus outline in Twenty Twenty-Four in the editor.
Improvements made to the focus outline style for Twenty Twenty-Four caused a regression in the focus outlines of the block editor. This commit solves the regressions by reducing the CSS specificity while keeping the improvements.

Follow-up to [57554].

Props wildworks, poena, sabernhardt, youknowriad, oglekler.
Fixes #60535.

git-svn-id: https://develop.svn.wordpress.org/trunk@57739 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-29 10:06:20 +00:00
Dennis Snell
faf0ed0aa2 HTML API: Remove superfluous type-coercing empty() check.
When returning modifiable text in the HTML API, if the text segment
coerces to `false` inside `empty()`, then an empty string has been
returned instead of the string itself. For example, the text node in the
following HTML snippet:

{{{
    <div>0</div>
}}}

In this patch the `empty()` check is removed. The purpose of the original
check was to skip further processing if the text content is empty, but
the check is not needed and the additioanl processing is minimal.
Removing the code removes the defect and leaves a cleaner method in its
absence.

Developed in https://github.com/WordPress/wordpress-develop/pull/6199

Follow-up to [57348]
Follow-up to #60170



git-svn-id: https://develop.svn.wordpress.org/trunk@57738 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-28 21:13:27 +00:00
Sergey Biryukov
9da33adc85 Tests: Expand wp_parse_id_list() unit tests.
Includes:
* Moving pre-existing `wp_parse_id_list()` tests to their own file.
* Merging new and pre-existing `wp_parse_slug_list()` tests.
* Using named data provider in `wp_parse_list()` tests.

Follow-up to [25170], [40044], [44546], [57284], [57725].

Props pbearne, mukesh27, SergeyBiryukov.
Fixes #60218. See #60217, #59647.

git-svn-id: https://develop.svn.wordpress.org/trunk@57737 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-28 18:09:38 +00:00
Colin Stewart
0366ad880a Plugin Dependencies: Don't assume API response has a slug property.
Previously, `WP_Plugin_Dependencies::get_dependency_api_data()` attempted to set an array key using the `slug` property returned in a Plugins API response. However, the Plugins API response is filterable and may not contain a `slug` property.

Earlier in the method, a local `$slug` variable is used as a key for the same array.

For safety and consistency, this replaces array key references to `$information->slug` with `$slug`.

Follow-up to [57545].

Props pbiron, afragen, swissspidy, costdev.
Fixes #60540.

git-svn-id: https://develop.svn.wordpress.org/trunk@57736 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-28 18:02:09 +00:00
Pascal Birchler
a69052a75f Tests: Address capitalization and docblock inconsistencies in some test class names.
Follow-up to [57060], [57718], [57725], [57726], [57727], [57728], [57733].

Props swissspidy, costdev.
See #59647.

git-svn-id: https://develop.svn.wordpress.org/trunk@57735 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-28 09:44:40 +00:00
Pascal Birchler
a2ef6fa9c9 I18N: Improve docs for pomo library classes.
Props subrataemfluence, pento, hrshahin.
Fixes #44424.

git-svn-id: https://develop.svn.wordpress.org/trunk@57734 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-28 09:29:03 +00:00
Sergey Biryukov
b75d47cfd8 Tests: Correct capitalization and fix typos in some test class names.
Follow-up to [57060], [57718], [57725], [57726], [57727], [57728].

See #59647.

git-svn-id: https://develop.svn.wordpress.org/trunk@57733 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-27 23:05:18 +00:00
Tonya Mork
1de7ddb4ac General: Revert r57698 for WP_List_Util::pluck().
r57698 caused a regression for arrays of objects which have magic methods and dynamic properties. A fix is identified.

However, a deeper dive discovered additional scenarios which will require a different fix.

Reverting gives more time for resolving these scenarios and more soak time to discover if there are others.

Props dd32, jamescollins, swissspidy.
See #59774.

git-svn-id: https://develop.svn.wordpress.org/trunk@57732 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-27 22:36:09 +00:00
Joe McGill
2b85d22d6a Docs: Improve docblock for WP_Block_Patterns_Registry::register.
This documents the new `filePath` property supported by `WP_Block_Patterns_Registry::register` and also updates the property name to camel case formatting to be consistent with other block pattern properties.

Props thekt12, spacedmonkey, joemcgill.
See #59532.


git-svn-id: https://develop.svn.wordpress.org/trunk@57731 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-27 21:03:54 +00:00
Aaron Jorbin
3eafb919b5 Site Icon/Customizer: Update strings in customizer to align with options-general.php.
This uses the new strings for alt text and site icon description that were introduced in [57713] as a part of #54370.

The strings are translated in PHP and then use `wp.i18n.sprintf` since the alt text strings live in a PHP file even though they are output as part of a template that is used in JavaScript.

Props westonruter, swissspidy, jorbin.
Fixes #60641.


git-svn-id: https://develop.svn.wordpress.org/trunk@57730 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-27 20:19:51 +00:00
Pascal Birchler
e80e07fb5d Build/Test Tools: Add unit tests for _delete_option_fresh_site().
Props pbearne, costdev, desrosj.
Fixes #57191.

git-svn-id: https://develop.svn.wordpress.org/trunk@57729 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-27 19:07:08 +00:00
swissspidy
a5f635ef2f Build/Test Tools: Add unit tests for maybe_hash_hex_color().
Props pbearne.
Fixes #60272.

git-svn-id: https://develop.svn.wordpress.org/trunk@57728 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-27 18:51:02 +00:00
swissspidy
9c9708dd73 Build/Test Tools: Add unit tests for sanitize_hex_color_no_hash().
Props pbearne.
Fixes #60271.

git-svn-id: https://develop.svn.wordpress.org/trunk@57727 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-27 18:49:01 +00:00
Pascal Birchler
17287999af Build/Test Tools: Add unit tests for sanitize_hex_color().
Props pbearne.
Fixes #60270.

git-svn-id: https://develop.svn.wordpress.org/trunk@57726 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-27 18:47:35 +00:00
Pascal Birchler
6e0ca03ba6 Build/Test Tools: Add unit tests for wp_parse_slug_list().
Props pbearne.
Fixes #60217.

git-svn-id: https://develop.svn.wordpress.org/trunk@57725 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-27 17:15:25 +00:00
Pascal Birchler
07a68a6620 Build/Test Tools: Add unit tests for absint().
Props pbearne.
Fixes #60101.

git-svn-id: https://develop.svn.wordpress.org/trunk@57724 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-27 17:13:04 +00:00
Pascal Birchler
96cab8af01 Post WordPress 6.5 Beta 3 version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@57723 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-27 16:24:19 +00:00
Pascal Birchler
227543d07e WordPress 6.5 Beta 3.
git-svn-id: https://develop.svn.wordpress.org/trunk@57722 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-27 16:12:56 +00:00
Riad Benguella
1bb5c2c5ce Editor: Update Packages with the latest bug fixes for 6.5 beta 3
It includes all the backports from this Gutenberg PR https://github.com/WordPress/gutenberg/pull/59394/

Props get_dave, youknowriad.
See #60315.

git-svn-id: https://develop.svn.wordpress.org/trunk@57721 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-27 14:46:29 +00:00
Riad Benguella
eb7a0a454c Font face resolver: print font faces from font families defined in all theme.json origins.
This commit updates the theme.json style generation to allow a font family name to be repeated across theme.json origins (default, theme, custom).

Props mmaattiiaass, hellofromtonya, arthur791004, ironprogrammer.
Fixes #60605.

git-svn-id: https://develop.svn.wordpress.org/trunk@57720 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-27 12:04:55 +00:00
Pascal Birchler
938dd078d4 Docs: Improve wording and add missing full stops in a few docblocks.
Props shailu25, sabernhardt.
Fixes #60323.

git-svn-id: https://develop.svn.wordpress.org/trunk@57719 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-27 10:27:08 +00:00
Pascal Birchler
0f086aebc8 Build/Test Tools: Add PHPUnit test for the _mce_set_direction function.
The new test checks the functionality of the text direction setting, ensuring it correctly switches between `rtl` and `ltr` options.

Props pbearne, SergeyBiryukov.
Fixes #60219.

git-svn-id: https://develop.svn.wordpress.org/trunk@57718 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-27 10:23:34 +00:00
Pascal Birchler
aa0f7e19c9 Editor: add shadow.defaultPresets to appearance tools opt-ins.
Props madhudollu.
Fixes #60633.

git-svn-id: https://develop.svn.wordpress.org/trunk@57717 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-27 10:20:11 +00:00
Riad Benguella
1d05ea9d11 Editor: Check for null values in Theme JSON to cater for blockGap.
When resolving theme.json preset variables, add a check to make sure the value is not empty before we run it through strpos() and preg_match_all().

Props ramonopoly, mukesh27, get_dave.
Fixes #60613.

git-svn-id: https://develop.svn.wordpress.org/trunk@57716 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-27 10:13:13 +00:00
Kelly Choyce-Dwan
ec37b57fb9 Help/About: Update the About page for 6.5.
Introducing the new content & design for the 6.5 About page & related pages. This style is simplified, with no header images, and brings back the illustrations from previous versions for Contribute, Freedoms, and Privacy.

This also includes a fix for heading hierarchy on the Get Involved page.

Props laurlittle, dansoschin, benjamin_zekavica, richtabor, joen, annezazu, swissspidy, marybaum, ryelle, huzaifaalmesbah.
See #60303.



git-svn-id: https://develop.svn.wordpress.org/trunk@57715 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-26 23:49:59 +00:00
Pascal Birchler
3e91cf91f6 Upgrade/Install: Improve localized strings related to plugin/theme installation and activation.
Adds context to strings where applicable to disambiguate them, coherently throughout the admin. Also improves some of the strings introduced in [57545] to ease localization.

Props swissspidy, costdev.
Fixes #60630. See #22316.

git-svn-id: https://develop.svn.wordpress.org/trunk@57714 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-26 20:33:46 +00:00
Aaron Jorbin
d0aa2fe32b Site icon: Polish up Site Icon on the general settings screen.
This fixes a number of issues, chief among them:
- Updates to the site title are reflected in the preview.
- Improve alt text for preview
- Make string describing site icon more succinct.
- Add inline documentation to JavaScript

Props kebbet, jorbin, swissspidy, afercia, mukesh27, alexstine, jameskoster, andraganescu.
Fixes #54370.



git-svn-id: https://develop.svn.wordpress.org/trunk@57713 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-26 20:16:09 +00:00
Sergey Biryukov
a975632f7f Twenty Nineteen: Further adjust CSS selectors used to change the primary color.
This aims to make the file, button, quote, pullquote, and search block selectors work on multiple WordPress versions.

Follow-up to [57637].

Props poena, mukesh27.
Fixes #59922.

git-svn-id: https://develop.svn.wordpress.org/trunk@57712 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-26 16:25:28 +00:00
Pascal Birchler
d1e7c85e7c Login and Registration: Slash email address when updating an existing user.
Addresses an issue with password reset keys when the email address contains special characters such as apostrophes.

Props emirpprime, rajinsharwar, fnpen, hellofromTonya, oglekler, nicolefurlan.
Fixes #52529.

git-svn-id: https://develop.svn.wordpress.org/trunk@57711 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-26 10:41:50 +00:00
Pascal Birchler
55290eddfa Tests: Update incorrect assertion message added in [57366].
Props david.binda.
Fixes #60358.

git-svn-id: https://develop.svn.wordpress.org/trunk@57710 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-26 10:27:30 +00:00
Joe Dolson
716cf66fda Code Standards: Fix alignment in tests.
Fix variable alignment in changed tests. Follow-up to [r57708]. Because I edited the wrong local copy when I fixed that.

Props joedolson.
See #34668.

git-svn-id: https://develop.svn.wordpress.org/trunk@57709 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-26 00:58:11 +00:00
Joe Dolson
eb33c60eaa Toolbar: Accessibility: Keyboard navigation for screen readers.
Change the admin toolbar to have `role="menu"` and support opening for screen readers. Remove screen reader only log out link and collapse duplicate profile links into one link. This is an imperfect solution to a complex problem in the adminbar, but the lack of screen reader access to submenus is a major accessibility problem, and this fix provides access, even if the mechanism is imperfect.

Screen reader log out added in [21452].

Props abletec, Cheffheid, sabernhardt, alexstine, joedolson, afercia, sparklingrobots, danieltj, swissspidy, netweb, dionysous.
Fixes #34668, #43633.

git-svn-id: https://develop.svn.wordpress.org/trunk@57708 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-26 00:50:22 +00:00
Peter Wilson
2ba8f942cb Upgrade/Install: Normalize major versions in is_wp_version_compatible().
Modify `is_wp_version_compatible()` to return the expected result for major WordPress versions formatted as either `x.x` or `x.x.0` (for example `6.5` and `6.5.0`).

The WordPress project currently documents major version numbers in both formats leading to confusion for developers using the `is_wp_version_compatible()` function. As the PHP function `version_compare()` treats `x.x` and `x.x.0` as different version numbers this leads to unexpected results in the WP function.

This change removes a trailing `.0` from major version numbers to account for the WordPress project using the two formats interchangeably.

Props afragen, azaozz, costdev, joemcgill, jorbin, kkmuffme, sessioncookiemonster, swissspidy, wazeter.
Fixes #59448.


git-svn-id: https://develop.svn.wordpress.org/trunk@57707 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-25 22:15:11 +00:00
Sergey Biryukov
78b37f39f6 Tests: Use assertSame() in new_admin_email_subject filter test.
This ensures that not only the return values match the expected results, but also that their type is the same.

Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.

Follow-up to [57283].

See #59655.

git-svn-id: https://develop.svn.wordpress.org/trunk@57706 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-25 15:25:49 +00:00