Commit Graph

36517 Commits

Author SHA1 Message Date
audrasjb
258523f63e Toolbar: Replace "Edit Site" link with "Site Editor" in the Admin Toolbar.
This changesets replaces the "Edit Site" link with "Site Editor" to avoid duplicate link anchors on multisite admin toolbar. The remaining "Edit site" link takes the user to the site editing screen in the network admin area (`network/site-info.php`) while the new "Site Editor" link takes the user to the site editor (`site-editor.php`).

Follow-up to [52158]. See GB27135.

Props johnbillion, sabernhardt, audrasjb, johnjamesjacoby, pratiklondhe.
Fixes #60977.



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


git-svn-id: http://core.svn.wordpress.org/trunk@57501 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-22 21:06:08 +00:00
Tammie Lister
0eb5aed212 Twenty Twenty-Three: Wraps navigation block in row within header template part.
This allows inserting of own blocks into header since the release of the Block Hooks API, specifically after the navigation block.

Props tomjcafferkey, poena, shailu25.
Fixes #60723.

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


git-svn-id: http://core.svn.wordpress.org/trunk@57500 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-22 20:55:09 +00:00
audrasjb
6371434821 Media: Prevent division by zero in wp_img_tag_add_width_and_height_attr().
This changesets adds a check for `$size_array` values to prevent a potential division by zero.
Follow-up to [57294].

Props jdekhtiar.
Fixes #61054.
See #59352.



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


git-svn-id: http://core.svn.wordpress.org/trunk@57499 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-22 20:35:10 +00:00
audrasjb
2d2b97f115 Docs: Typo corrections in class WP_Meta_Query.
Props truptikanzariya.
Fixes #61051.
See #60699.



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


git-svn-id: http://core.svn.wordpress.org/trunk@57498 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-22 20:25:08 +00:00
Tammie Lister
95533c6f68 Twenty Twelve: Fixes typing errors in block pattern.
There were several instances of typo corrections in block patterns. This removes the last sentence for a simpler resolution.

Props sabernhardt.
Fixes #61004.

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


git-svn-id: http://core.svn.wordpress.org/trunk@57497 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-22 20:19:15 +00:00
isabel_brison
9fd435aa15 Editor: fix spacing in function doc.
Correctly formats spacing in `get_layout_styles` docblock.

Props mukesh27, sabernhardt.
See #60981.

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


git-svn-id: http://core.svn.wordpress.org/trunk@57496 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-22 07:20:09 +00:00
Sergey Biryukov
4fb8608aa5 Docs: Use correct URL for the Embeds documentation article.
Follow-up to [57793].

Props shailu25, estelaris, audrasjb.
See #60732.
Built from https://develop.svn.wordpress.org/trunk@58029


git-svn-id: http://core.svn.wordpress.org/trunk@57495 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-22 06:25:11 +00:00
isabel_brison
9ecc777ded Editor: limit layout rules on themes without theme.json.
Removes output of base rules for flow and constrained layout types on themes without theme.json.

Props evanltd, poena, isabel_brison, andrewserong, oandregal.
See #60981.

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


git-svn-id: http://core.svn.wordpress.org/trunk@57494 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-22 05:30:13 +00:00
Sergey Biryukov
46356f0215 Docs: Remove extra space before @since in WP_Block_Bindings_Registry DocBlock.
Follow-up to [57373].

Props shailu25.
Fixes #61046.
Built from https://develop.svn.wordpress.org/trunk@58027


git-svn-id: http://core.svn.wordpress.org/trunk@57493 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-21 03:52:11 +00:00
Sergey Biryukov
453c78db60 Coding Standards: Use strict comparison in wp_add_global_styles_for_blocks().
Follow-up to [57546].

Props immeet94.
Fixes #60964.
Built from https://develop.svn.wordpress.org/trunk@58026


git-svn-id: http://core.svn.wordpress.org/trunk@57492 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-20 04:01:18 +00:00
Joe McGill
244a8cf308 Themes: Cache block theme patterns in a transient.
This extends the benefits of persistent caching added in [56978] for block theme patterns to sites that are not using a persistent object cache. By default, these caches expire using the value of the `WP_Theme::cache_expiration` property. The transient cache TTL can be overridden using the newly introduced `wp_theme_files_cache_ttl` filter.

Props thekt12, joemcgill, flixos90, peterwilsoncc, spacedmonkey.
See #59600, #59719.

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


git-svn-id: http://core.svn.wordpress.org/trunk@57491 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-19 17:59:16 +00:00
Sergey Biryukov
670692386b Docs: Fix typo in WP_Block_Type::__construct() DocBlock.
Follow-up to [54155].

Props ixkaito.
Fixes #61035.
Built from https://develop.svn.wordpress.org/trunk@58024


git-svn-id: http://core.svn.wordpress.org/trunk@57490 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-19 03:42:18 +00:00
Sergey Biryukov
3c5da9c743 Login and Registration: Check that redirect_to is a string in wp-login.php.
This prevents a fatal error if an array is passed instead.

Follow-up to [2876], [4969], [7524], [8701], [25701], [31417], [49109].

Props TimoTijhof.
Fixes #59373.
Built from https://develop.svn.wordpress.org/trunk@58023


git-svn-id: http://core.svn.wordpress.org/trunk@57489 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-18 06:24:22 +00:00
Peter Wilson
f6fae87e73 Upgrade/Install: Validate source & destination values in WP_Ugrader.
Adds a missing string and some additional validation of paths in the upgrader class.

Follow up to [56992].

Props costdev, jipmoors, karlijnbok, swissspidy, afragen, mukesh27.
Fixes #59712.


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


git-svn-id: http://core.svn.wordpress.org/trunk@57488 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-18 03:17:13 +00:00
joedolson
cc7370b2af Help/About: Accessibility: Remove target="_blank" from data eraser links.
Remove `target="_blank"` from two links to developer resources on adding the personal data eraser to plugins in the Help info for the privacy screens. Also rectifies differences between the export and erase text for consistency and changes the order of paragraphs. 

Props sabernhardt, joedolson.
Fixes #60097.
Built from https://develop.svn.wordpress.org/trunk@58021


git-svn-id: http://core.svn.wordpress.org/trunk@57487 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-17 20:21:15 +00:00
Sergey Biryukov
1c0e271c2f Docs: Correct @since version for COOKIE_DOMAIN default value change.
Follow-up to [58011].

Props mukesh27.
See #46550.
Built from https://develop.svn.wordpress.org/trunk@58017


git-svn-id: http://core.svn.wordpress.org/trunk@57483 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-17 09:46:19 +00:00
Sergey Biryukov
dc9dbf913f Users: Set the default value of COOKIE_DOMAIN to an empty string.
This matches the type expected by the `setcookie()` function for the `$domain` parameter, and resolves a fatal error if `strict_types` is enabled.

Reference: [https://www.php.net/setcookie PHP Manual: setcookie()].

Follow-up to [2725], [6434], [12732], [13062].

Props kmvan, rajinsharwar, jrf, desrosj, Cybr, nicolefurlan, oglekler, hellofromTonya, kirasong, chaion07, mukesh27.
Fixes #46550.
Built from https://develop.svn.wordpress.org/trunk@58011


git-svn-id: http://core.svn.wordpress.org/trunk@57482 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-16 16:52:14 +00:00
dmsnell
d2ce038894 HTML API: Validate HTML Processor against external test suite from html5lib.
In this patch, the test suite from html5lib validates the tree-construction
steps in the HTML Processor to ensure that they are behaving according to the
HTML specification. This suite of tests is also used by the servo project to
test its html5ever package.

A new test module in the HTML API transforms HTML Processor output to match
the expected tree shape from the external tests. For cases where there are
tests validating behaviors of unsupported HTML tags and constructs, the tests
are marked as skipped. As the HTML API continues to expand its own support,
the number of skipped tests will automatically shrink down towards zero.

Additional tests are skipped through the `SKIP_TEST` array in the test runner.

Fixes #60227.
See #58517.
Props azaozz, costdev, dmsnell, hellofromtonya, jonsurrell, jorbin, swisspidy.


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


git-svn-id: http://core.svn.wordpress.org/trunk@57481 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-16 12:08:17 +00:00
Sergey Biryukov
dd6d4e74c1 Code Modernization: Fix implicit nullable parameter type deprecation on PHP 8.4.
In PHP 8.4, declaring function or method parameters with a default value of `null` is deprecated if the type is not nullable.

PHP applications are recommended to ''explicitly'' declare the type as nullable. All type declarations that have a default value of `null`, but without declaring `null` in the type declaration, will emit a deprecation notice:
{{{
function test( array $value = null ) {}
}}}
`Deprecated: Implicitly marking parameter $value as nullable is deprecated, the explicit nullable type must be used instead`

**Recommended Changes**

Change the implicit nullable type declaration to a nullable type declaration, available since PHP 7.1:
{{{#!diff
- function test( string $test = null ) {}
+ function test( ?string $test = null ) {}
}}}

This commit updates the affected instances in core to use a nullable type declaration.

References:
* [https://wiki.php.net/rfc/deprecate-implicitly-nullable-types PHP RFC: Deprecate implicitly nullable parameter types]
* [https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated PHP.Watch: PHP 8.4: Implicitly nullable parameter declarations deprecated]

Follow-up to [28731], [50552], [57337], [57985].

Props ayeshrajans, jrf, audrasjb, jorbin.
Fixes #60786.
Built from https://develop.svn.wordpress.org/trunk@58009


git-svn-id: http://core.svn.wordpress.org/trunk@57480 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-15 20:03:09 +00:00
Tammie Lister
593ccf4342 Twenty Eleven: Removes Negative values for padding.
This fixes the issue where negative values aren't allows in older versions of IE. There is more discussion in another ticket on a wider approach, but for now the decision to commit this was made as an interim solution.

Props mukesh27, SergeyBiryukov, sabernhardt, poena.
Fixes #46771.

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


git-svn-id: http://core.svn.wordpress.org/trunk@57479 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-15 16:40:12 +00:00
Tammie Lister
44528d4fba Twenty Twenty Two: Wraps Navigation block in row.
Now that the Blocks Hooks API is released in 6.4, you might want to insert blocks into header of the theme after the Navigation block. This wraps to allow this.

Props tomjcafferkey, poena, shailu25.
Fixes #60724.

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


git-svn-id: http://core.svn.wordpress.org/trunk@57478 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-15 16:26:15 +00:00
Sergey Biryukov
8689afae77 Twenty Twenty-One: Check for WP_Error before outputting get_the_tag_list().
This prevents a fatal error on PHP 8 and brings consistency with the other bundled themes.

Follow-up to [47886].

Props josephscott, sabernhardt, poena, nirav7707, devsahadat.
Fixes #60800.
Built from https://develop.svn.wordpress.org/trunk@57991


git-svn-id: http://core.svn.wordpress.org/trunk@57477 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-14 21:57:13 +00:00
Sergey Biryukov
7bb686d18b Users: Account for returning false from the authenticate filter.
While technically only `null`, `WP_User`, or `WP_Error` should be returned from the `authenticate` filter, a plugin might return boolean `false` instead, which would trigger the `authentication_failed` error prior to [57882].

This commit aims to preserve that behavior in case `false` is returned.

Follow-up to [57882].

Props johnbillion.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57990


git-svn-id: http://core.svn.wordpress.org/trunk@57476 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-13 16:33:13 +00:00
Tammie Lister
8d0570f72c Twenty Fourteen: Fixes pullquote block issues with font sizing.
The pullquote block was not showing increase in sizes within the editor. This solves that and allows you to see the change both in the editor and front.

Props nidhidhandhukiya, huzaifaalmesbah.
Fixes #59800.

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


git-svn-id: http://core.svn.wordpress.org/trunk@57475 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-12 19:55:12 +00:00
Pascal Birchler
09be520d72 Docs: Revert unintended svn:ignore change after [57987].
See #60699.
Built from https://develop.svn.wordpress.org/trunk@57988


git-svn-id: http://core.svn.wordpress.org/trunk@57474 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-12 17:50:12 +00:00
Pascal Birchler
00d06db33d Docs: Fix various typos and spelling mistakes.
Props swissspidy, jucaduca, sergeybiryukov.
See #60699.
Built from https://develop.svn.wordpress.org/trunk@57987


git-svn-id: http://core.svn.wordpress.org/trunk@57473 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-12 17:47:13 +00:00
Sergey Biryukov
98d90f8533 Coding Standards: Upgrade WPCS to version 3.1.0.
The impact on existing WordPress core code is expected to be minimal, but the release does provide more safeguards for the future.

References:
* [https://github.com/WordPress/WordPress-Coding-Standards/releases/tag/3.1.0 WPCS 3.1.0 release notes]
* [https://github.com/WordPress/WordPress-Coding-Standards/compare/3.0.1...3.1.0 Full list of changes in WPCS 3.1.0]

Follow-up to [56695], [56799], [57378].

Props jrf, garyj, dingo_d, rodrigosprimo, Chouby, westonruter, bjorsch.
Fixes #60840.
Built from https://develop.svn.wordpress.org/trunk@57986


git-svn-id: http://core.svn.wordpress.org/trunk@57472 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-12 12:17:10 +00:00
John Blackbourn
dd224888c7 General: Increase the minimum supported version of PHP to 7.2.24.
Props justlevine, masteradhoc, samiamnot, hellofromTonya, azaozz, jrf, dd32, desrosj, jorbin

Fixes #58719

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


git-svn-id: http://core.svn.wordpress.org/trunk@57471 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-11 21:11:16 +00:00
Sergey Biryukov
181e799593 Docs: Update @since version for wp_zip_file_is_valid().
Follow-up to [57537], [57916], [57929].

Props TobiasBg.
See #60398.
Built from https://develop.svn.wordpress.org/trunk@57984


git-svn-id: http://core.svn.wordpress.org/trunk@57470 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-11 14:28:14 +00:00
Pascal Birchler
a6b9c3d542 Script Loader: stop enqueueing some now obsolete polyfills.
Stop enqueueing polyfills such as `wp-polyfill-inert` (for the `inert` attribute) and `regenerator-runtime` (for generator functions), as they are no longer needed, considering the WordPress project's [https://make.wordpress.org/core/handbook/best-practices/browser-support/ browser support policy].

In addition to that, `wp-polyfill` (essentially `core-js`) is no longer enqueued as a dependency of `react`. This was added in [43903] to ensure compatibility with IE 11, which is no longer supported by WordPress. Developers requiring `wp-polyfill` need to manually add it as a dependency for their scripts.

Props swissspidy, flixos90, adamsilverstein, youknowriad, gziolo.
Fixes #60962.
Built from https://develop.svn.wordpress.org/trunk@57981


git-svn-id: http://core.svn.wordpress.org/trunk@57467 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-10 14:42:17 +00:00
John Blackbourn
a04dc48ea7 Editor: Update npm packages.
Updates the editor npm packages to the latest patch versions for 6.5.1.

See https://github.com/WordPress/gutenberg/pull/60577.

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


git-svn-id: http://core.svn.wordpress.org/trunk@57446 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-09 10:57:27 +00:00
isabel_brison
8fbd2fc6f4 Editor: skip outputting base layout rules if content and wide size values don’t exist.
Skip outputting layout rules that reference content and wide sizes CSS variables, if no layout sizes exist in the current `theme.json`.

Props andrewserong.
Fixes #60936.

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


git-svn-id: http://core.svn.wordpress.org/trunk@57445 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-09 07:20:15 +00:00
jorgefilipecosta
f3873d2f8a Coding Standards: Fix missing strict in_array on block-template-utils.php.
Props swissspidy.
Built from https://develop.svn.wordpress.org/trunk@57946


git-svn-id: http://core.svn.wordpress.org/trunk@57443 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-08 21:42:17 +00:00
Sergey Biryukov
440a5f21ca Twenty Twenty-Four: Remove pattern from home template to improve performance.
Creating the Home Business pattern was needed to show it on the template replacement flows, but there's no need to use it in the template, and the minor code repetition is better than having to do a an extra pattern replacement.

Follow-up to [https://github.com/WordPress/twentytwentyfour/pull/486 PR #486].

Props onemaggie, youknowriad, poena, afercia.
Fixes #60620.
Built from https://develop.svn.wordpress.org/trunk@57945


git-svn-id: http://core.svn.wordpress.org/trunk@57442 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-08 19:21:16 +00:00
jorgefilipecosta
a0712d7758 Honor template_hierarchy filters when creating a template in the Site Editor.
Currently, in blocks themes it's possible to use the ${type}_template_hierarchy filter to alter the template hierarchy. However, those filters are not taken into consideration by the Choose a pattern popup screen that appears when creating a new template in the Site Editor, causing a mismatch between the editor and the frontend.

Props aljullu, mukesh27, ntsekouras, jorgefilipecosta, gziolo.
Fixes #60846.
Built from https://develop.svn.wordpress.org/trunk@57944


git-svn-id: http://core.svn.wordpress.org/trunk@57441 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-08 16:47:16 +00:00
Peter Wilson
f4fb98f366 Script Loader: Improve asset concatenation Etags.
Include the asset version of JavaScript and CSS files when generating the ETag for concatenated assets in `load-scripts.php` and `load-styles.php`. This ensures the ETag is updated as script versions change (for example editor package updates) rather than only when the WordPress version changes.

The `W\` prefix is added to the generated ETag to allow for CDNs and proxy servers modifying the script to add or improve the compression algorithm.

Props azaozz, dav4, ironprogrammer, johnbillion, kkmuffme, monzuralam, peterwilsoncc, sergeybiryukov.
Fixes #58433.

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


git-svn-id: http://core.svn.wordpress.org/trunk@57440 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-07 23:53:19 +00:00
Sergey Biryukov
c518c3a924 Docs: Correct @since version for status code 425 in get_status_header_desc().
Follow-up to [57936].

See #60942.
Built from https://develop.svn.wordpress.org/trunk@57937


git-svn-id: http://core.svn.wordpress.org/trunk@57438 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-07 11:22:08 +00:00
Sergey Biryukov
70e045910b HTTP API: Add support for a description for HTTP status code 425 (Too Early).
Reference: [https://datatracker.ietf.org/doc/rfc8470/ RFC 8470: Using Early Data in HTTP].

Follow-up to [5446], [6104], [10740], [27422], [36274], [36294], [42207].

Props kkmuffme, mukesh27, joemcgill.
Fixes #60942.
Built from https://develop.svn.wordpress.org/trunk@57936


git-svn-id: http://core.svn.wordpress.org/trunk@57437 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-07 11:18:17 +00:00
Sergey Biryukov
46676b4060 Coding Standards: Use strict comparison in wp-includes/class-wp-image-editor-imagick.php.
Follow-up to [22094].

Props aristath, poena, afercia, SergeyBiryukov.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57934


git-svn-id: http://core.svn.wordpress.org/trunk@57435 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-06 13:37:18 +00:00
Aaron Jorbin
a7f59e981f Media: Use flex-start for full browser support.
The value of `start` is not fully supported by Opera Mini which has 1.01% usage. There is no material change in functionality with this change.

Follow-up to [55919].

Props davidbaumwald, sabernhardt, khokansardar, devsahadat.
Fixes #60876.

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


git-svn-id: http://core.svn.wordpress.org/trunk@57434 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-05 21:47:15 +00:00
Tammie Lister
103d0deb89 Twenty Twenty-Four: Fixes typo in testimonial pattern.
There was a small typo which was in a string context only visible to translators for the testimonial pattern. This fixes that.

Props shailu25, SergeyBiryukov.
Fixes #60924.

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


git-svn-id: http://core.svn.wordpress.org/trunk@57433 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-05 20:46:15 +00:00
Sergey Biryukov
6bc444cc42 Tests: Use an image on WordPress.org CDN in external HTTP tests.
Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Props peterwilsoncc, jorbin.
See #60865.
Built from https://develop.svn.wordpress.org/trunk@57931


git-svn-id: http://core.svn.wordpress.org/trunk@57432 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-05 12:12:14 +00:00
Joe McGill
9bb63fd665 Themes: Avoid errors in some environments from _get_block_templates_paths.
This adds an `is_dir()` check in `_get_block_templates_paths` before trying to run a `RecursiveDirectoryIterator` to avoid errors being reported in New Relic even thought the errors should be handled by a try/catch block.

Follow-up to [57215].

Props iCaleb, sean212, mukesh27, joemcgill.
Fixes #60915.


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


git-svn-id: http://core.svn.wordpress.org/trunk@57429 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-04 18:56:57 +00:00
John Blackbourn
78d729602e Database: Remove back-compat for database servers that don't support utf8mb4.
Since WordPress 6.5, the minimum supported version of MySQL and MariaDB is 5.5.5. This means all supported database servers now support the `utf8mb4` character set and therefore the conditional logic for this is no longer necessary.

Props l1nuxjedi, craigfrancis, OllieJones, johnbillion

Fixes #60096

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


git-svn-id: http://core.svn.wordpress.org/trunk@57427 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-04 15:13:14 +00:00
Pascal Birchler
1c8b25a7a5 I18N: Bail early if an invalid text domain is passed to load_textdomain() et al.
Some plugins pass invalid values such as `null` instead of a string, which has never been supported by WordPress (no translations are loaded) and was technically undefined behavior. With the introduction of the new l10n library in #59656, which has stricter type hints, this could end up causing warnings or even fatal errors.

This change adds a deliberate short-circuit to `load_textdomain()` & co. to better handle such a case and document that it is not supported.

Props verygoode, swissspidy.
Fixes #60888.
Built from https://develop.svn.wordpress.org/trunk@57925


git-svn-id: http://core.svn.wordpress.org/trunk@57426 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-04 13:56:13 +00:00
Pascal Birchler
f09686a12a Build/Test Tools: Update a few image URLs in HTTP and image cropping tests.
Follow-up to #60865 / [57903] where similar instances were recently updated due to an upstream change.

Particularly the `test_wp_crop_image_with_url()` test recently began to fail on some environments, likely because of the same change.

This updates the image URLs with the aim to bring more consistency and to get the test passing again more broadly.

Fixes #60907.
Built from https://develop.svn.wordpress.org/trunk@57924


git-svn-id: http://core.svn.wordpress.org/trunk@57425 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-04 13:45:10 +00:00
Pascal Birchler
3ed6382329 Permalinks: Detect FrankenPHP web server support.
Support pretty permalinks when FrankenPHP server is detected, which is built on top of Caddy. Caddy detection was added in [57612].

Props swissspidy, stephenmiracle.
Fixes #60884.
Built from https://develop.svn.wordpress.org/trunk@57923


git-svn-id: http://core.svn.wordpress.org/trunk@57424 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-04 13:40:06 +00:00
Pascal Birchler
54a61e9c9b I18N: Always search for script translations in wp-content/languages/plugins.
Previously, when `WP_PLUGIN_DIR` was set to something other than `wp-content/plugins`, e.g. `wp-content/mods`, `load_script_textdomain` was searching for script translations in `wp-content/languages/mods`. However, that is incorrect, as `WP_PLUGIN_DIR` does not affect where translations are stored. The location is always `wp-content/languages/plugins`.

Props coreymckrill, swissspidy.
Fixes #60891.
Built from https://develop.svn.wordpress.org/trunk@57922


git-svn-id: http://core.svn.wordpress.org/trunk@57423 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-04 13:38:11 +00:00
Sergey Biryukov
9ac3e01c91 Docs: Fix typo in wp_mediaelement_fallback filter description.
Follow-up to [23729], [28128].

Props dilipbheda, mukesh27.
Fixes #60917.
Built from https://develop.svn.wordpress.org/trunk@57921


git-svn-id: http://core.svn.wordpress.org/trunk@57422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-04 11:19:14 +00:00
Felix Arntz
6fe9681e77 Options, Meta APIs: Use more sensible default for autoloading options which allows WordPress core to make a decision.
An excessive amount of autoloaded options is a common cause for slow database responses, sometimes caused by very large individual autoloaded options. As it is not mandatory to provide an autoload value when adding an option to the database, it tends to be ignored, which in combination with a default value of "yes" and lack of documentation can lead to the aforementioned problem.

This changeset enhances the option autoloading behavior in several ways:
* Update the function documentation to encourage the use of boolean `true` or `false` to explicitly provide an autoload value for an option.
* Use new string values `on` and `off` for explicitly provided values stored in the database, to distinguish them from `yes` and `no`, since `yes` does not allow determining whether it was set intentionally by the developer or only as a default.
* Effectively deprecate the values `yes` and `no`. They are still supported for backward compatibility, but now discouraged.
* Use `null` as new default autoload value for `add_option()`. If the developer does not provide an explicit value, this will now trigger WordPress logic to determine an autoload value to use:
    * If WordPress determines that the option should not be autoloaded, it is stored in the database as `auto-off`. As part of this changeset, the single heuristic introduced for that is to check whether the option size is larger than a threshold of 150k bytes. This threshold is filterable via a new `wp_max_autoloaded_option_size` filter.
    * If WordPress determines that the option should be autoloaded, it is stored in the database as `auto-on`. No logic to make such a decision is introduced as part of this changeset, but a new filter `wp_default_autoload_value` can be used to define such heuristics, e.g. by optimization plugins.
    * If WordPress cannot determine whether or not to autoload the option, it is stored in the database as `auto`.
    * This effectively means that any option without an explicit autoload value provided by the developer will be stored with an autoload value of `auto`, unless the option's size exceeds the aforementioned threshold. Options with a value of `auto` are still autoloaded as of today, most importantly for backward compatibility. A new function `wp_autoload_values_to_autoload()` returns the list of autolaod values that dictate for an option to be autoloaded, and a new filter `wp_autoload_values_to_autoload` can be used to alter that list.

These behavioral changes encourage developers to be more mindful of autoloading, while providing WordPress core and optimization plugins with additional control over heuristics for autoloading options where no explicit autoload value was provided.

At the same time, the changes are fully backward compatible from a functionality perspective, with the only exception being that very large options will now no longer be autoloaded if the developer did not explicitly request for them to be autoloaded. Neither WordPress core nor plugins are able to override an explicitly provided value, which is intentional to continue giving developers full control over their own options.

Props pbearne, flixos90, joemcgill, azaozz, spacedmonkey, swissspidy, mukesh27, markjaquith.
Fixes #42441.

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


git-svn-id: http://core.svn.wordpress.org/trunk@57421 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-03 21:31:15 +00:00
Bernhard Reiter
725f302121 Block Hooks: Pass correct context to filters.
The `$context` argument passed to filters such as `hooked_block_types`, `hooked_block`, and `hooked_block_{$hooked_block_type}` allows them to conditionally insert a hooked block. If the anchor block is contained in a template or template part, `$context` will be set to a `WP_Block_Template` object reflecting that template or part.

The aforementioned filters are applied when hooked block insertion is run upon reading a template (or part) from the DB (and before sending the template/part content with hooked blocks inserted over the REST API to the client), but also upon writing to the DB, as that's when the `ignoredHookedBlocks` metadata attribute is set.

Prior to this changeset, the `$context` passed to Block Hooks related filters in the latter case reflected the template/part that was already stored in the database (if any), which is a bug; instead, it needs to reflect the template/part that will result from the incoming `POST` network request that will trigger a database update.

Those incoming changes are encapsulated in the `$changes` argument passed to the `reset_pre_insert_template` and  `reset_pre_insert_template_part` filters, respectively, and thus to the `inject_ignored_hooked_blocks_metadata_attributes` function that is hooked to them. `$changes` is of type `stdClass` and only contains the fields that need to be updated. That means that in order to create a `WP_Block_Template` object, a two-step process is needed:

- Emulate what the updated `wp_template` or `wp_template_part` post object in the database will look like by merging `$changes` on top of the existing `$post` object fetched from the DB, or from the theme's block template (part) file, if any.
- Create a `WP_Block_Template` from the resulting object.

To achieve the latter, a new helper method (`_build_block_template_object_from_post_object`) is extracted from the existing `_build_block_template_result_from_post` function. (The latter cannot be used directly as it includes a few database calls that will fail if no post object for the template has existed yet in the database.)

While somewhat complicated to implement, the overall change allows for better separation of concerns and isolation of entities. This is visible e.g. in the fact that `inject_ignored_hooked_blocks_metadata_attributes` no longer requires a `$request` argument, which is reflected by unit tests no longer needing to create a `$request` object to pass to it, thus decoupling the function from the templates endpoint controller.

Unit tests for `inject_ignored_hooked_blocks_metadata_attributes` have been moved to a new, separate file. Test coverage has been added such that now, all three relevant scenarios are covered:

- The template doesn't exist in the DB, nor is there a block theme template file for it.
- The template doesn't exist in the DB, but there is a block theme template file for it.
- The template already exists in the DB.

Those scenarios also correspond to the logical branching inside `WP_REST_Templates_Controller::prepare_item_for_database`, which is where `inject_ignored_hooked_blocks_metadata_attributes` gets its data from.

Props tomjcafferkey, bernhard-reiter, gziolo, swissspidy.
Fixes #60754.
Built from https://develop.svn.wordpress.org/trunk@57919


git-svn-id: http://core.svn.wordpress.org/trunk@57420 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-03 15:11:14 +00:00
Pascal Birchler
d6ce792045 Build/Test Tools: Migrate to Docker Compose V2.
Compose V2, which was first released in 2020, is included with all currently supported versions of Docker Desktop. Compose V1 stopped receiving updates in July 2023.

The biggest difference is that the command to interact with Compose changed from `docker-compose` to `docker compose`.

GitHub has now started removing V1 from Ubuntu & Windows images, which caused all Docker-based GitHub Actions workflows to fail.

This change migrates to the new `docker compose` command to address these failures.

Props swissspidy, thelovekesh.
Fixes #60901.
Built from https://develop.svn.wordpress.org/trunk@57918


git-svn-id: http://core.svn.wordpress.org/trunk@57419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-03 11:33:12 +00:00
Sergey Biryukov
c98b4ce7f3 Coding Standards: Use strict comparison in wp-includes/class-wp-image-editor-gd.php.
Follow-up to [22094], [22817], [50810], [57524].

Props aristath, poena, afercia, SergeyBiryukov.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57917


git-svn-id: http://core.svn.wordpress.org/trunk@57418 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-03 10:33:24 +00:00
Sergey Biryukov
db1e75b20a Docs: Update @since version for wp_zip_file_is_valid().
Follow-up to [57537].

Props TobiasBg.
See #60398.
Built from https://develop.svn.wordpress.org/trunk@57916


git-svn-id: http://core.svn.wordpress.org/trunk@57417 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-02 19:24:16 +00:00
desrosj
657f36adfa Build/Test Tools: Include 6.4 and 6.5 in upgrade testing.
This ensures that upgrading from 6.4 and 6.5 to the desired version is actually tested.

See #60733.
Built from https://develop.svn.wordpress.org/trunk@57915


git-svn-id: http://core.svn.wordpress.org/trunk@57416 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-02 19:19:17 +00:00
Sergey Biryukov
bac700319a Help/About: Remove unused CSS previously intended for the Freedoms screen.
Follow-up to [44264], [45278], [49219], [49479], [51356], [51459].

Props sjnbham, niravsherasiya7707.
Fixes #60857.
Built from https://develop.svn.wordpress.org/trunk@57911


git-svn-id: http://core.svn.wordpress.org/trunk@57412 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-02 11:12:19 +00:00
audrasjb
4e52c28a2e Docs: Various typo corrections in wp-includes/formatting.php.
Props shailu25.
Fixes #60814.
See #60699.



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


git-svn-id: http://core.svn.wordpress.org/trunk@57411 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-01 20:55:12 +00:00
audrasjb
8396c3fbd5 General: Fix various typo issues found in deprecated.php and Font Library unit tests.
Props shailu25, mukesh27, sabernhardt, audrasjb.
Fixes #60870.



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


git-svn-id: http://core.svn.wordpress.org/trunk@57410 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-01 20:45:13 +00:00
davidbaumwald
3fa06d8fbd Upgrade/Install: Update the $_old_files array for 6.5.
Props audrasjb, huzaifaalmesbah, swissspidy.
Fixes #60648.
Built from https://develop.svn.wordpress.org/trunk@57905


git-svn-id: http://core.svn.wordpress.org/trunk@57406 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-01 16:38:18 +00:00
Sergey Biryukov
041cf81e0d Tests: Revert the image size change in wp_remote_head() and wp_remote_get() tests.
The exact size in the response appears to differ between platforms, but this should make the tests pass for now.

Follow-up to [57903].

See #60865.
Built from https://develop.svn.wordpress.org/trunk@57904


git-svn-id: http://core.svn.wordpress.org/trunk@57405 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-01 14:32:21 +00:00
Sergey Biryukov
6257387ee7 Tests: Update expectations in wp_remote_head() and wp_remote_get() tests.
It appears that something has changed on the WP.com side to compress the requested images on the fly, which interfered with the previous expectations in these tests.

This commit uses a direct file URL and updates the expected image size to match the currently returned response.

Follow-up to [139/tests], [31258], [47142].

Props dextorlobo, swissspidy, davidbaumwald, SergeyBiryukov.
See #60865.
Built from https://develop.svn.wordpress.org/trunk@57903


git-svn-id: http://core.svn.wordpress.org/trunk@57404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-01 13:57:23 +00:00
Andrew Ozz
e68090cdcf Docs: Improve the docblock for _wp_filter_font_directory(). Remove the recommended use section as this is a private use only function.
Props peterwilsoncc, swissspidy, azaozz.
Fixes #60652.
Built from https://develop.svn.wordpress.org/trunk@57902


git-svn-id: http://core.svn.wordpress.org/trunk@57403 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-01 02:53:12 +00:00
Sergey Biryukov
6f636420db Docs: Fix a few typos in wp-admin/includes/class-pclzip.php.
Follow-up to  [6779], [47123], [55827].

Props nithins53, nithi22, mukesh27.
Fixes #60818.
Built from https://develop.svn.wordpress.org/trunk@57901


git-svn-id: http://core.svn.wordpress.org/trunk@57402 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-31 05:52:15 +00:00
Sergey Biryukov
d1ea7a0723 Coding Standards: Revert [57899] pending test failure investigation.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57900


git-svn-id: http://core.svn.wordpress.org/trunk@57401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-30 00:46:11 +00:00
Sergey Biryukov
053fbef212 Coding Standards: Use strict comparison in wp-includes/class-wp-image-editor-gd.php.
Follow-up to [22094], [22817], [50810], [57524].

Props aristath, poena, afercia, SergeyBiryukov.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57899


git-svn-id: http://core.svn.wordpress.org/trunk@57400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-30 00:17:13 +00:00
Sergey Biryukov
1dc3f87870 Networks and Sites: Remove unused $wpdb global in update_blog_details().
Follow-up to [43548].

Props viralsampat.
See #60021.
Built from https://develop.svn.wordpress.org/trunk@57898


git-svn-id: http://core.svn.wordpress.org/trunk@57399 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-29 11:42:13 +00:00
Tammie Lister
11dfccd894 Twenty Twelve: Fixes table block font size not changing.
Currently the table block font size does not change in the editor or front-end. This ensures this is reflected in the table block.

Props sabernhardt, tahmidulkarim, sheulyshila.
Fixes #58074.

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


git-svn-id: http://core.svn.wordpress.org/trunk@57398 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-28 20:58:17 +00:00
Tammie Lister
6ec197bdf3 Twenty Eleven: Fixes adding citation text color issue in pullquote block.
The pullquote block wasn't reflecting text color added for quote and add citation text across the front and back of editor. This fixes that by adding ensuring whatever color is selected is shown in both

Props kajalgohel.
Fixes #56524.

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


git-svn-id: http://core.svn.wordpress.org/trunk@57397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-28 18:16:11 +00:00
Tammie Lister
fa34e40c7b Twenty Twenty: Fixes The design of the ordered and unordered lists within editor.
There wasn't enough padding and the spacing was deteriorating the more depth there was. This reflects the front now and respects background coloring. Impacts both types of lists although original reporting was just on one.

Props aezazshekh, krupalpanchal, multidots1896, kajalgohel, sabernhardt.
Fixes #56083.

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


git-svn-id: http://core.svn.wordpress.org/trunk@57396 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-28 16:59:14 +00:00
Sergey Biryukov
92daa4fe72 Tests: Use an existing user fixture in the test for logging in with an email address.
Creating a new user is redundant here, the fixture shared by other tests can be used instead.

Follow-up to [36617].

See #60705.
Built from https://develop.svn.wordpress.org/trunk@57892


git-svn-id: http://core.svn.wordpress.org/trunk@57393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-28 11:19:18 +00:00
desrosj
3bf6493510 Editor: Merge Editor bug fixes ahead of 6.5 RC4.
This merges several high priority bug fixes for the editor ahead of WordPress 6.5:
- https://github.com/WordPress/gutenberg/pull/60180
- https://github.com/WordPress/gutenberg/pull/60093
- https://github.com/WordPress/gutenberg/pull/60071
- https://github.com/WordPress/gutenberg/pull/60130
- https://github.com/WordPress/gutenberg/pull/59959
- https://github.com/WordPress/gutenberg/pull/60167

Props youknowriad, annezazu, mcsf, jsnajdr, mmaattiiaass, get_dave, scruffian, mikachan, grantmkin, andraganescu, scruffian, antosguillamot, fabiankaegy, huzaifaalmesbah, krupajnanda, colorful-tones, liviopv, mamaduka, kim88, poena, peterwilsoncc, wildworks, swissspidy, desrosj, jorbin.
Fixes #60315.
Built from https://develop.svn.wordpress.org/trunk@57888


git-svn-id: http://core.svn.wordpress.org/trunk@57389 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-28 02:29:24 +00:00
audrasjb
3e244ae879 I18n: Add context to the "Patterns" translatable string for the related admin menu item.
This changeset put back the context parameter of the "Patterns" string which was previously removed to fix a translation issue without introducing a string change during WP 6.5 string freeze period.

Follow-up to [57864].

Props kebbet, narenin, nestea29950.
Fixes #60827.



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


git-svn-id: http://core.svn.wordpress.org/trunk@57388 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-27 22:44:16 +00:00
desrosj
fba385feef Bundled Themes: Bump default theme versions for release with 6.5.
This updates the version of each default theme to the following versions:
- Twenty Ten: `4.1`
- Twenty Eleven: `4.6`
- Twenty Twelve: `4.2`
- Twenty Thirteen: `4.1`
- Twenty Fourteen: `3.9`
- Twenty Fifteen: `3.7`
- Twenty Sixteen: `3.2`
- Twenty Seventeen: `3.6`
- Twenty Nineteen: `2.8`
- Twenty Twenty: `2.6`
- Twenty Twenty-One: `2.2`
- Twenty Twenty-Two: `1.7`
- Twenty Twenty-Three: `1.4`
- Twenty Twenty-Four: `1.1`

These versions will released in coordination with WordPress 6.5.

Props sabernhardt, desrosj, kushang78, mukesh27, huzaifaalmesbah, shailu25, poena.
Fixes #59816.
Built from https://develop.svn.wordpress.org/trunk@57886


git-svn-id: http://core.svn.wordpress.org/trunk@57387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-27 19:06:14 +00:00
Pascal Birchler
0c4eec233d Editor: disable shadow.defaultPresets for classic themes.
With this change default shadow presets are never shown for classic themes, and classic themes have no options for adding custom ones.
This essentially reverts [57717] and [57827] / [57828], which had unintended consequences.

Props ajlende, oandregal, madhudollu, swissspidy, get_dave, andrewserong, desrosj.
Fixes #60815.
Built from https://develop.svn.wordpress.org/trunk@57885


git-svn-id: http://core.svn.wordpress.org/trunk@57386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-27 16:00:12 +00:00
Sergey Biryukov
af0a8e253d Coding Standards: Use strict comparison in wp-includes/pomo/plural-forms.php.
Follow-up to [41722].

Props aristath, poena, afercia, SergeyBiryukov.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57883


git-svn-id: http://core.svn.wordpress.org/trunk@57384 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-27 12:30:12 +00:00
Sergey Biryukov
95f1ba70eb Coding Standards: Use strict comparison in wp-includes/pluggable.php.
Follow-up to [3566], [6387], [10437], [11057], [11387], [16208], [16304], [18195], [20410], [26367], [34947].

Props aristath, poena, afercia, SergeyBiryukov.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57882


git-svn-id: http://core.svn.wordpress.org/trunk@57383 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-26 21:41:11 +00:00
Pascal Birchler
d676def4a8 Media: Fix CSS issue preventing inserting images on smaller viewports.
Addresses a regression introduced in [57605] where the “Select” button in the media modal was not clickable anymore due to an overlaid element.

Props ramonopoly, swissspidy, freewebmentor.
Fixes #33049.
Built from https://develop.svn.wordpress.org/trunk@57881


git-svn-id: http://core.svn.wordpress.org/trunk@57382 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-26 09:39:11 +00:00
Peter Wilson
8e5e7a3a11 Editor: Relocate font files uploads to the uploads directory.
Relocate the upload of font files uploaded via the Font Library feature to the `wp-content/uploads/fonts` (or multisite equivalent) directory.

This accounts for immutable file systems in which directories are unable to be created within `wp-content` and deploy processes which require special consideration of the `uploads` directory to ensure it remains persistent between deploys.

Props azaozz, burnuser, cbirdsong, christopherplus, costdev, davidbaumwald, desrosj, elrae, euthelup, get_dave, grantmkin, hellofromtonya, janthiel, jazzs3quence, johnbillion, jorbin, justlevine, kraftner, matveb, mcsf, mmaattiiaass, nico23, peterwilsoncc, priethor, rmccue, samuelsidler, swissspidy, youknowriad.
Fixes #60845.


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


git-svn-id: http://core.svn.wordpress.org/trunk@57379 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-26 01:25:11 +00:00
Sergey Biryukov
326bd23fd9 Coding Standards: Use strict comparison in wp-includes/ms-load.php.
Follow-up to [12602], [12688], [12896], [27359], [37475].

Props aristath, poena, afercia, SergeyBiryukov.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57877


git-svn-id: http://core.svn.wordpress.org/trunk@57378 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-25 17:19:17 +00:00
Pascal Birchler
c7d9fc540e External Libraries: Update the Requests library to version 2.0.11.
This is a maintenance release with two minor fixes to improve PHP 8.4 compatibility.

References:
- [https://github.com/WordPress/Requests/releases/tag/v2.0.11 Requests 2.0.11 release notes]
- [https://github.com/WordPress/Requests/compare/v2.0.9...v2.0.11 Full list of changes in Requests 2.0.11]

Follow-up to [56554], [54997], [55007], [55046], [55225], [55296], [55629].

Props swissspidy, jrf.
Fixes #60838.
Built from https://develop.svn.wordpress.org/trunk@57876


git-svn-id: http://core.svn.wordpress.org/trunk@57377 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-25 12:23:08 +00:00
Sergey Biryukov
6d5d992cf1 Coding Standards: Use strict comparison in wp-includes/ms-blogs.php.
Follow-up to [12603], [12948], [13125], [13126], [21480], [21485], [38457], [41625], [43654], [43655], [45794].

Props aristath, poena, afercia, SergeyBiryukov.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57874


git-svn-id: http://core.svn.wordpress.org/trunk@57375 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-24 13:04:16 +00:00
Sergey Biryukov
22d95abc55 Coding Standards: Use strict comparison in wp-includes/bookmark.php.
Follow-up to [21], [3570], [3845], [8758].

Props aristath, poena, afercia, SergeyBiryukov.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57873


git-svn-id: http://core.svn.wordpress.org/trunk@57374 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-23 14:20:11 +00:00
Pascal Birchler
807916dd1e Editor: Update the Google Fonts font collection URL to the latest version for 6.5.
Props mmaattiiaass.
Fixes #60819.
Built from https://develop.svn.wordpress.org/trunk@57871


git-svn-id: http://core.svn.wordpress.org/trunk@57372 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-23 09:26:07 +00:00
Pascal Birchler
8b9dfff929 Help/About: Update the About page for 6.5.
Updates the font size for `<code>` tags and updates several translatable strings.

Props sabernhardt, laurlittle, SergeyBiryukov.
See #60303.
Built from https://develop.svn.wordpress.org/trunk@57870


git-svn-id: http://core.svn.wordpress.org/trunk@57371 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-23 09:22:10 +00:00
Peter Wilson
895ea566f6 Editor: Prevent font folder naive filtering causing infinite loops.
This modifies the font directory API to more closely reflect the upload directory API to help account for naive filtering when uploading fonts.

This moves the protection of infinite loops to the new function `_wp_filter_font_directory()` to allow developers extending and maintaining the font library to apply the filter without the need for a closure.

These changes also ensure both the `upload_dir` and `font_dir` filter are applied consistently when both creating and deleting fonts faces. Prior to this commit the `upload_dir` filter was only fired when creating fonts faces via the REST API.

Applying the font directory filter to the `upload_dir` filter is now done by adding the `_wp_filter_font_directory` function rather than `wp_get_font_dir()`. Developers who have previously modified the font upload directory using the `font_dir` filter will NOT need to upload their code.

Extenders wishing to upload files to the font directory can do so via the code:

{{{#!php
<?php
add_filter( 'upload_dir', '_wp_filter_font_directory' );
// Your code to upload or sideload a font file.
remove_filter( 'upload_dir', '_wp_filter_font_directory' );
}}}

Introduces:

* `wp_font_dir()`: Attempt to create and retrieve the font upload directory. The equivalent to `wp_upload_dir()`.
* `_wp_filter_font_directory()`: To run on the `upload_dir` filter, this sets the default destination of the fonts directory and fires the `font_dir` filter. 

`wp_get_font_dir()` has been modified to be a lightweight getter for the font directory. It returns the location without attempting to create it. The equivalent to `wp_get_upload_dir()`.

Follow up to [57740].

Props peterwilsoncc, mukesh27, mikachan, costdev, mmaattiiaass, swissspidy, youknowriad, dd32, grantmkin.
Fixes #60652.

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


git-svn-id: http://core.svn.wordpress.org/trunk@57369 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-22 23:01:10 +00:00
Sergey Biryukov
d28dd189b8 Coding Standards: Use strict comparison in wp-includes/link-template.php.
Follow-up to [4475], [6365], [8706], [9296], [9318], [14141], [15819], [21364], [27802].

Props aristath, poena, afercia, SergeyBiryukov.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57867


git-svn-id: http://core.svn.wordpress.org/trunk@57368 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-22 22:07:11 +00:00
Pascal Birchler
24ad060351 Editor: Check if mb_strtolower exists before using it in the font library.
Prevents an error when uploading fonts on certain systems, because the `mbstring` extension can be missing and thus the function may not be available.

Props mujuonly, swissspidy, peterwilsoncc.
Fixes #60823.
See #55603.
Built from https://develop.svn.wordpress.org/trunk@57865


git-svn-id: http://core.svn.wordpress.org/trunk@57366 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-22 14:17:09 +00:00
audrasjb
fae0e892b7 I18n: Ensure "Patterns" menu item is translatable.
This changeset updates a translation string to ensure the "Patterns" menu item introduced in [57543] is translatable.
This quickfix simply removes the erroneous `context` parameter so no new string is introduced during WP 6.5 string freeze period. A follow-up changeset will be needed to replace the current `__()` function with `_x()` and put back the `context` parameter.

Follow-up to [57543].

Props jdy68, audrasjb, kebbet, swissspidy.
Fixes #60825.



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


git-svn-id: http://core.svn.wordpress.org/trunk@57365 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-22 13:58:14 +00:00
Sergey Biryukov
073bfd5060 Tests: Remove unnecessary use of utf8_encode() in KSES tests.
One of the tests for the `wp_kses_xml_named_entities()` function used `utf8_encode( chr( 160 ) )` to set an expectation of a Unicode character for a non-breaking space.

It is understandable that this expectation was previously set this way, as it is not possible for a developer to distinguish between a ''breaking'' space and a ''non-breaking'' space visually, so the chances of the test accidentally breaking on an incorrect save when the plain Unicode character would be used, was high.

However, the `utf8_encode()` function is deprecated as of PHP 8.2, and its use needs to be removed from the WP codebase.

PHP 7.0 has introduced [https://wiki.php.net/rfc/unicode_escape Unicode escape sequences], which allows to create a text string using Unicode characters referenced by their codepoint. By switching the test case to provide the test expectation using a Unicode escape sequence, we remove the use of the deprecated PHP function and still preserve the safeguard against the test accidentally breaking.

Follow-up to [52229].

Props jrf, afercia, poena, SergeyBiryukov.
See #55603, #60705.
Built from https://develop.svn.wordpress.org/trunk@57861


git-svn-id: http://core.svn.wordpress.org/trunk@57362 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-21 15:47:16 +00:00
Pascal Birchler
d5f0448e78 Coding Standards: Rename the $postid parameter to $post_id in `has_meta().
Props mujuonly.
Fixes #60810.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57860


git-svn-id: http://core.svn.wordpress.org/trunk@57361 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-20 19:07:12 +00:00
Sergey Biryukov
37ce09349a Coding Standards: Use strict comparison in wp-includes/bookmark-template.php.
Follow-up to [3880].

Props aristath, poena, afercia, SergeyBiryukov.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57859


git-svn-id: http://core.svn.wordpress.org/trunk@57360 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-20 12:49:10 +00:00
Sergey Biryukov
31039a896f Coding Standards: Rename the remaining $postid instances in wp_delete_post().
Follow-up to [57853], [57857].

See #60700.
Built from https://develop.svn.wordpress.org/trunk@57858


git-svn-id: http://core.svn.wordpress.org/trunk@57359 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-19 18:04:15 +00:00
Sergey Biryukov
f09287b6e1 Coding Standards: Rename the $postid parameter to $post_id in wp_delete_post().
This matches the parameter name in `wp_trash_post()` and all the other functions receiving post ID as a parameter.

See #60700.
Built from https://develop.svn.wordpress.org/trunk@57857


git-svn-id: http://core.svn.wordpress.org/trunk@57358 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-19 17:47:10 +00:00
audrasjb
1a0add316f Docs: Update various HelpHub links to avoid unnecessary redirections.
Follow-up to [57793], [57798], [57800], [57801].

Props shailu25.
See #60732, #60699.




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


git-svn-id: http://core.svn.wordpress.org/trunk@57355 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-19 14:46:15 +00:00
Pascal Birchler
5cb687dbce Posts, Post Types: Introduce delete_post_{$post->post_type} and deleted_post_{$post->post_type} hooks.
The hooks fire before the general `delete_post` / `deleted_post` hooks and have the same parameters.

They complement the `save_post_{$post->post_type}` hook added in [25050] and the `edit_post_{$post->post_type}` hook added in [43617].

Props benniledl, swissspidy, dargus.
Fixes #60433.
Built from https://develop.svn.wordpress.org/trunk@57853


git-svn-id: http://core.svn.wordpress.org/trunk@57354 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-19 09:33:11 +00:00
youknowriad
9ed35adffa Editor: Update Packages with the latest bug fixes for 6.5 RC 3
It includes all the backports from this Gutenberg PR https://github.com/WordPress/gutenberg/pull/59949/

Props get_dave, youknowriad.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57851


git-svn-id: http://core.svn.wordpress.org/trunk@57352 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-19 08:07:17 +00:00
Sergey Biryukov
cc416fc17b Coding Standards: Use strict comparison in wp-includes/class-walker-comment.php.
Follow-up to [8869], [9207], [23694], [47887].

Props aristath, poena, afercia, SergeyBiryukov.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57850


git-svn-id: http://core.svn.wordpress.org/trunk@57351 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-18 15:46:13 +00:00
Pascal Birchler
b5ef90af01 Build/Test Tools: Make WP_Filesystem_Direct tests more robust.
Follow-up to [57753] to make tests more robust, as there were multiple permission-related errors in the hosting test results.
With this change, the tests now don’t try setting an owner that doesn’t exist.

Props peterwilsoncc, costdev, javiercasares.
See #57774.
Built from https://develop.svn.wordpress.org/trunk@57849


git-svn-id: http://core.svn.wordpress.org/trunk@57350 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-18 09:27:15 +00:00
Sergey Biryukov
4c0984a459 Coding Standards: Use strict comparison in wp-includes/class-wp-walker.php.
Follow-up to [6384], [6456], [6858], [8494], [8961].

Props aristath, poena, afercia, SergeyBiryukov.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57848


git-svn-id: http://core.svn.wordpress.org/trunk@57349 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-17 09:56:16 +00:00
Sergey Biryukov
a0f10b0742 Coding Standards: Use strict comparison in wp-includes/class-wp-theme.php.
Follow-up to [20029], [20119], [20144].

Props aristath, poena, afercia, SergeyBiryukov.
See #60700.
Built from https://develop.svn.wordpress.org/trunk@57847


git-svn-id: http://core.svn.wordpress.org/trunk@57348 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-16 13:18:15 +00:00