Commit Graph

49193 Commits

Author SHA1 Message Date
Aaron Jorbin c0adfeff65 Plugins: Show an admin notice on successful activation.
Plugin activation on the Plugins > Add New screen is performed using AJAX, no longer performing redirects. This means that users will not see a newly activated plugin's menu items, admin notices, or other UI elements until the user refreshes or navigates to another screen. Without adequate messaging and direction, users may be unsure of what to do next.

This shows an admin notice when a plugin is activated from its plugin card or modal, informing the user that the plugin was activated, and that some changes may not occur until they refresh the page.

Follow-up to [57545].

Reviewed by joedolson.
Merges [58081] to the 6.5 branch.

Props costdev, jorbin, jeherve, flixos90, joedolson, ironprogrammer, audrasjb, alanfuller, kevinwhoffman, devsahadat, afragen, adrianduffell, azaozz, jason_the_adams, JeffPaul, webdevmattcrom, DrewAPicture, justlevine, stevejonesdev, benlk, roytanck.
Fixes #60992. See #22316.

Built from https://develop.svn.wordpress.org/branches/6.5@58083


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57548 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-02 17:48:13 +00:00
Aaron Jorbin e19f9d5d06 REST API: Return empty object when no fallback templates are found (wp/v2/templates/lookup)
This prevents a number of php notices that are surfaced due to the endpoint being called on load of the post editor even when there are no templates.

Reviewed by joemcgill.
Merges [58079] to the 6.5 branch.

Props grantmkin, CookiesForDevo, britner, wildworks, jorbin.
Fixes #60909.

Built from https://develop.svn.wordpress.org/branches/6.5@58080


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57545 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-02 16:29:14 +00:00
Aaron Jorbin 4546b73afb Script Loader: Ensure wp_localize_script() works when called early.
Before, wp_localize_script() did not work when the $wp_scripts global was not already set (for example because of a script registration happening elsewhere) and even emitted a warning in that case. Due to side effects such as block registration early in the load process, this usually never happened. However, the absence of these side effects in 6.5 caused the wp_localize_script() to no longer work in places such as the login_enqueue_scripts.

By calling wp_scripts() in wp_localize_script(), the $wp_scripts global is automatically set if needed, restoring previous behavior. Adds both a PHP unit test and an e2e test to verify this use case. Hat tip: jorbin.

Thanks for the birthday wishes, Pascal!

Reviewed by Jorbin.
Merges [58068] to the 6.5 branch.

Props salcode, aslamdoctor, jorbin, swissspidy.
Fixes #60862.

Built from https://develop.svn.wordpress.org/branches/6.5@58078


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57543 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-02 15:06:16 +00:00
Pascal Birchler def147d01e 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.

Merges [57925] to the 6.5 branch.
Reviewed by jorbin.

Props verygoode, swissspidy.
Fixes #60888.
Built from https://develop.svn.wordpress.org/branches/6.5@58066


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-30 09:47:06 +00:00
isabel_brison 5186adde1b Editor: fix spacing in function doc.
Correctly formats spacing in `get_layout_styles` docblock.

Props mukesh27, sabernhardt.
Reviewed by jorbin.
Merges [58030] to the 6.5 branch.
See #60981.

Built from https://develop.svn.wordpress.org/branches/6.5@58058


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57523 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-30 03:25:05 +00:00
isabel_brison 07fe72c6b3 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.
Reviewed by jorbin.
Merges [58028] to the 6.5 branch.
See #60981.

Built from https://develop.svn.wordpress.org/branches/6.5@58057


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57522 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-30 03:19:10 +00:00
isabel_brison c164facc1d 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.
Reviewed by jorbin.
Merges [57948] to the 6.5 branch.
Fixes #60936.

Built from https://develop.svn.wordpress.org/branches/6.5@58056


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57521 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-30 01:48:09 +00:00
Adam Silverstein 899608b6be Media: fix potential error in class-avif-info.php::get_item_features().
Import upstream fix from libavifinfo, correcting a potential fatal error.

Reviewed by jorbin.
Merges [58049] to the 6.5 branch.

Props yguyon.
Fixes #60980.


Built from https://develop.svn.wordpress.org/branches/6.5@58050


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-26 15:27:13 +00:00
Bernhard Reiter a4e4498d9f Block Hooks: Fix `@since` and deprecated versions.
Two `@since` PHPDoc fields, and the version argument to one `_deprecated_argument()` incorrectly stated 6.5.1 as the relevant WordPress version where a change was introduced.

This changeset fixes them by setting them to 6.5.3 instead.

Reviewed by swissspidy.
Merges [58042] to the to the 6.5 branch.

Follow-up to [58041].
See #60754.
Built from https://develop.svn.wordpress.org/branches/6.5@58043


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57509 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-24 12:20:12 +00:00
Bernhard Reiter 5b64778886 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.

Reviewed by gziolo.
Merges [57919] to the to the 6.5 branch.

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


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57507 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-24 12:02:13 +00:00
audrasjb b37dea1ca7 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].

Reviewed by audrasjb, jorbin.
Merges [57887] to the to the 6.5 branch.
Props kebbet, narenin, nestea29950.
Fixes #60827.



Built from https://develop.svn.wordpress.org/branches/6.5@58038


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57504 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-23 17:34:17 +00:00
joedolson 5831500ae4 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.
Reviewed by joedolson.
Merges [57881] to the 6.5 branch.
Fixes #60876.
Built from https://develop.svn.wordpress.org/branches/6.5@58036


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57502 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-22 22:42:11 +00:00
joedolson 582e438785 Revert accidental commits to 6.5 branch. Reverts [58019] and [58018]. Unprops @joedolson
Built from https://develop.svn.wordpress.org/branches/6.5@58020


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57486 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-17 20:12:12 +00:00
joedolson 1ed114d588 Help/About: Text consistency follow-up to [58018].
Follow up to [58018]. Remove extra 'support for' from Export help link text.

Props sabernhardt.
Fixes #60097.
Built from https://develop.svn.wordpress.org/branches/6.5@58019


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57485 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-17 19:21:12 +00:00
joedolson 031702359a 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 screens for consistency and changes the order of paragraphs. 

Props sabernhardt, joedolson.
Fixes #60097.
Built from https://develop.svn.wordpress.org/branches/6.5@58018


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57484 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-17 19:15:14 +00:00
John Blackbourn 28985e969e Post WordPress 6.5.2 version bump.
Built from https://develop.svn.wordpress.org/branches/6.5@57980


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57466 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-09 21:50:17 +00:00
John Blackbourn 918a5c9548 WordPress 6.5.2.
Built from https://develop.svn.wordpress.org/branches/6.5@57978


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57464 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-09 21:05:15 +00:00
John Blackbourn 262144d2d4 WordPress 6.5.1.
Built from https://develop.svn.wordpress.org/branches/6.5@57959


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57453 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-09 15:26:14 +00:00
John Blackbourn 66e36c2f18 Editor: Update npm packages for the 6.5 branch.
Updates the editor npm packages to the latest patch versions for 6.5.1.

Built from https://develop.svn.wordpress.org/branches/6.5@57950


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57447 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-09 11:03:28 +00:00
Joe McGill 7a5bc0367d 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].

Reviewed by jorbin.
Merges [57928] to the to the 6.5 branch.

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

Built from https://develop.svn.wordpress.org/branches/6.5@57947


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57444 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-09 01:25:17 +00:00
Sergey Biryukov e4e1f40f0a 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].

Reviewed by jorbin.
Merges [57931] to the 6.5 branch.

Props peterwilsoncc, jorbin.
See #60865.
Built from https://develop.svn.wordpress.org/branches/6.5@57935


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57436 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-06 14:21:18 +00:00
desrosj 50fa686639 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.

Merges [57918] to the 6.5 branch.

Props swissspidy, thelovekesh.
See #60901.
Built from https://develop.svn.wordpress.org/branches/6.5@57927


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57428 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-04 18:12:15 +00:00
audrasjb ccafe4031c Post WordPress 6.5 version bump.
The 6.5 branch is now 6.5.1-alpha.




Built from https://develop.svn.wordpress.org/branches/6.5@57914


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57415 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-02 18:57:12 +00:00
audrasjb 2fa87ae663 WordPress 6.5.
Built from https://develop.svn.wordpress.org/branches/6.5@57912


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57413 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-02 18:10:16 +00:00
audrasjb d22ebda400 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.

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

Reviewed by audrasjb.
Merges [57903] and [57904] to the 6.5 branch.
Props dextorlobo, swissspidy, davidbaumwald, SergeyBiryukov.
Fixes #60865.



Built from https://develop.svn.wordpress.org/branches/6.5@57908


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57409 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-01 17:18:14 +00:00
audrasjb fabe853249 Docs: Improve the docblock for `_wp_filter_font_directory()`.
Removes the recommended use section as this is a private use only function.

Reviewed by davidbaumwald.
Merges [57902] to the 6.5 branch.
Props peterwilsoncc, swissspidy, azaozz.
Fixes #60652.



Built from https://develop.svn.wordpress.org/branches/6.5@57907


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57408 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-01 16:55:12 +00:00
davidbaumwald 97e3caebad Upgrade/Install: Update the `$_old_files` array for 6.5.
Reviewed by audrasjb.
Merges [57905] to the 6.5 branch.

Props audrasjb, huzaifaalmesbah, swissspidy.
See #60648.
Built from https://develop.svn.wordpress.org/branches/6.5@57906


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57407 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-04-01 16:51:13 +00:00
audrasjb c8b285114a Post WordPress 6.5 RC4 version bump.
Built from https://develop.svn.wordpress.org/branches/6.5@57894


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57395 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-28 16:31:10 +00:00
audrasjb 199131d0e3 WordPress 6.5 RC4.
Built from https://develop.svn.wordpress.org/branches/6.5@57893


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-28 16:13:12 +00:00
Pascal Birchler 11ea343fca 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

Reviewed by jorbin, swissspidy.
Merges [57888] to the 6.5 branch.

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/branches/6.5@57891


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57392 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-28 08:31:19 +00:00
Pascal Birchler c94919702a 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.

Reviewed by swissspidy.
Merges [57886] to the 6.5 branch.

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


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57391 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-28 08:29:11 +00:00
Pascal Birchler 0503d5a240 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.

Reviewed by audrasjb.
Merges [57885] to the 6.5 branch.

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


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57390 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-28 08:26:14 +00:00
joedolson 1f48d214f3 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.
Reviewed by joedolson.
Merges [57881] to the 6.5 branch.
Fixes #33049.
Built from https://develop.svn.wordpress.org/branches/6.5@57884


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57385 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-27 15:36:15 +00:00
Pascal Birchler eaf0b91513 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.

Reviewed by davidbaumwald.
Merges [57878] to the 6.5 branch.

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/branches/6.5@57880


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57381 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-26 09:27:06 +00:00
Pascal Birchler 47687d8799 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].

Reviewed by swissspidy.
Merges [57868] to the 6.5 branch.

Props peterwilsoncc, mukesh27, mikachan, costdev, mmaattiiaass, swissspidy, youknowriad, dd32, grantmkin.
Fixes #60652.
Built from https://develop.svn.wordpress.org/branches/6.5@57879


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57380 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-26 09:24:11 +00:00
Pascal Birchler 2b99aa4e4f Editor: Update the Google Fonts font collection URL to the latest version for 6.5.
Reviewed by peterwilsoncc.
Merges [57871] to the 6.5 branch.

Props mmaattiiaass.
Fixes #60819.
Built from https://develop.svn.wordpress.org/branches/6.5@57875


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57376 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-25 11:08:13 +00:00
Pascal Birchler 16fd4cd39c Help/About: Update the About page for 6.5.
Updates the font size for `<code>` tags and updates several translatable strings.

Reviewed by davidbaumwald.
Merges [57870] to the to the 6.5 branch.

Props sabernhardt, laurlittle, SergeyBiryukov.
See #60303.
Built from https://develop.svn.wordpress.org/branches/6.5@57872


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57373 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-23 13:10:11 +00:00
Pascal Birchler 609157125d 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.

Reviewed by jorbin.
Merges [57865] to the to the 6.5 branch.

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


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57370 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-23 09:17:15 +00:00
audrasjb abedb8faca 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].

Reviewed by swissspidy.
Merges [57864] to the to the 6.5 branch.

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



Built from https://develop.svn.wordpress.org/branches/6.5@57866


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57367 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-22 15:26:11 +00:00
audrasjb abc60673ed Post WordPress 6.5 RC3 version bump.
Built from https://develop.svn.wordpress.org/branches/6.5@57856


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57357 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-19 16:18:14 +00:00
audrasjb 28ba236187 WordPress 6.5 RC3.
Built from https://develop.svn.wordpress.org/branches/6.5@57855


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57356 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-19 16:08:11 +00:00
gziolo d948d12595 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, gziolo.
Reviewed by youknowriad.
Merges [57851] to the 6.5 branch.
See #60315.


Built from https://develop.svn.wordpress.org/branches/6.5@57852


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57353 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-19 09:25:18 +00:00
joedolson d0997b8e96 Media: Fall back to available icons if SVG media icons not found.
Follow up to [57687]. If no icons of the preferred type are available, then the icon array should return the collection of valid icons found, rather than an empty array.

Props dglingren, sabernhardt, swissspidy, sabernhardt, antpb, joedolson.
Reviewed by swissspidy.
Merges [57845] to the 6.5 branch.
Fixes #60740.
Built from https://develop.svn.wordpress.org/branches/6.5@57846


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57347 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-15 20:58:12 +00:00
Pascal Birchler 8a78f7a907 Script Loader: Add new `script_module_loader_src` filter for the script module `src`.
Ensures parity with the `script_loader_src` filter for regular scripts, allowing the URL to be filtered, for example to load them from a CDN or alter query parameters.

Reviewed by swissspidy.
Merges [57840] to the to the 6.5 branch.

Props dd32, peterwilsoncc, westonruter.
Fixes #60742.
Built from https://develop.svn.wordpress.org/branches/6.5@57844


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57345 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-15 15:01:07 +00:00
Pascal Birchler dede0d6b09 Interactivity API: Do not print state if it’s an empty array.
This prunes stores and configurations that are empty arrays, as stores are expected to be JSON objects.
By not printing empty configurations, less redundant data is serialized into the HTML.

Reviewed by gziolo.
Merges [57841] to the to the 6.5 branch.

Props jonsurrell, luisherranz, darerodz, gziolo, swissspidy.
Fixes #60761.
Built from https://develop.svn.wordpress.org/branches/6.5@57843


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57344 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-15 14:59:08 +00:00
Pascal Birchler 2d39c954a2 I18N: Improve translation file cache group & expiration.
Adds an explicit 1 hour expiration for the translation file cache introduced in [57287] / #58919.
This prevents stale caches when a site does not use the regular way of installing language packs, for example when an atomic filesystem is involved.
Also configures the translation_files group as a global cache group on multisite.

Reviewed by swissspidy.
Merges [57831] to the to the 6.5 branch.

Props dd32.
Fixes #60764.
Built from https://develop.svn.wordpress.org/branches/6.5@57838


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57339 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-15 11:20:06 +00:00
Pascal Birchler 4af7fa8ec0 Interactivity API: Prevent warning when using a bind directive with a short attribute name.
Adds new tests and improves existing ones by using `assertSame` to do type comparison as well.

Reviewed by gziolo.
Merges [57835] to the to the 6.5 branch.

Props jonsurrell, cbravobernal, swissspidy, gziolo.
Fixes #60758.
Built from https://develop.svn.wordpress.org/branches/6.5@57837


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57338 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-15 11:18:19 +00:00
Pascal Birchler 9eed18532d Interactivity API: Do not propagate context from void tags to its siblings.
Resolves an issue where context on a void tag element such as `<img>` was incorrectly passed to following elements.
Adds tests.

Reviewed by gziolo.
Merges [57832] to the to the 6.5 branch.

Props santosguillamot, luisherranz, cbravobernal, dmsnell, gziolo, swissspidy.
Fixes #60768.
Built from https://develop.svn.wordpress.org/branches/6.5@57834


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57335 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-14 15:12:10 +00:00
Pascal Birchler 4958667689 Interactivity API: Increase hook priority for processing directives.
Use a priority of 100 to ensure that other filters can add additional directives before the processing starts.
This way, directives will be processed even if the $parsed_block variable is edited by a filter.

Reviewed by gziolo.
Merges [57826] to the to the 6.5 branch.

Props cbravobernal, swissspidy, flixos90, joemcgill, gziolo.
Fixes #60743.
Built from https://develop.svn.wordpress.org/branches/6.5@57830


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57331 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-14 08:59:13 +00:00
Pascal Birchler 22ceb67be0 Editor: disable `shadow.defaultPresets` in default `theme.json`.
This is a follow-up to [57717] to ensure that classic themes without a `theme.json` file or without `appearanceTools: true` in `theme.json` do not have shadow controls by default.

Reviewed by youknowriad.
Merges [57827] to the to the 6.5 branch.

Props wildworks, vcanales, madhudollu, swissspidy, youknowriad.
Fixes #60633
Built from https://develop.svn.wordpress.org/branches/6.5@57828


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-03-13 11:24:11 +00:00