Commit Graph

51567 Commits

Author SHA1 Message Date
gziolo
4ede839674 Abilities API: Add Ability Categories REST API controller
Introduces a new REST API endpoint at `wp-abilities/v1/categories` to expose
ability categories through the WordPress REST API.

The new `WP_REST_Abilities_V1_Categories_Controller` provides:

- GET `/wp-abilities/v1/categories` - Lists all ability categories with pagination
- GET `/wp-abilities/v1/categories/{slug}` - Retrieves a single category by slug

Both endpoints require the `read` capability and return category data including
slug, label, description, and metadata. The collection endpoint supports pagination
with `page` and `per_page` parameters (default: 50, max: 100).

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

Follow-up [61032].

Props gziolo, jason_the_adams, timothyblynjacobs.
Fixes #64098.


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


git-svn-id: http://core.svn.wordpress.org/trunk@60381 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-22 07:07:28 +00:00
Weston Ruter
ff4d53b52a Coding Standards: Rename abbreviated variable in WP_Query code comment.
This was missed as part of renaming `$q` to `$query_vars`.

Follow-up to [60927].

Props westonruter.
See #63168.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60380 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-22 06:30:30 +00:00
ramonopoly
3770a519d6 Query: fix undefined variable $q in WP_Query::generate_cache_key()
The `generate_cache_key()` method in `WP_Query` referenced an undefined variable `$q`. The method only has two parameters: `$args` and `$sql`. The variable `$q` is not defined anywhere in this method scope. This patch replaces the undefined `$q` variable with the correct `$args` parameter.

Follow-up to [59442]

Props ramonopoly, westonruter

Fixes #64135.


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


git-svn-id: http://core.svn.wordpress.org/trunk@60379 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-22 06:20:32 +00:00
Peter Wilson
7de6258b2e Editor: Ignore built assets introduced in WordPress 6.9, SVN edition.
Update the `svn:ignore` property for newly introduced assets in the `src/wp-includes/blocks` directory. 

The code run for this commit was:

{{{
cd src/wp-includes/blocks
svn propset svn:ignore '*.js.map
*.js
*.css' . --recursive
}}}

Follow up to [61012].

See #64117.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60378 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 21:17:35 +00:00
Weston Ruter
6c21899c42 Script Loader: Remove hard-coded versions in test snapshots.
Follow-up to [60999].

Props ellatrix.
See #63486.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60377 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 19:04:34 +00:00
ellatrix
fb078cc848 Post WordPress 6.9 Beta 1 version bump.
Built from https://develop.svn.wordpress.org/trunk@61040


git-svn-id: http://core.svn.wordpress.org/trunk@60376 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 17:33:33 +00:00
ellatrix
8ab440340a WordPress 6.9 Beta 1.
Built from https://develop.svn.wordpress.org/trunk@61039


git-svn-id: http://core.svn.wordpress.org/trunk@60375 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 17:11:29 +00:00
davidbaumwald
e7b0dffcaa Users: Revert Lazy-load user meta.
With [60915] reverted, this changeset is also being reverted to resolve test failures due to common code.

Reverts [60989].

Follow-up to [61037].

Props jorbin, ellatrix, spacedmonkey.
See #63021, #58001.
Built from https://develop.svn.wordpress.org/trunk@61038


git-svn-id: http://core.svn.wordpress.org/trunk@60374 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 15:59:33 +00:00
Aaron Jorbin
9e3ec7f071 Users: Revert Lazy load user capabilities in WP_User object.
The change from public to protected broke tests for extenders and this also broke `WP_User::to_array()`.

Reverts [60915].

Props davidbaumwald, ellatrix, timothyblynjacobs, welcher, spacedmonkey, bradshawtm, peterwilsoncc, jorbin.
See #58001.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60373 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 15:25:36 +00:00
Aaron Jorbin
cf38be60a7 Coding Standards: Fix blank spaces.
Nice to meet you, where you been?

See #63168.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60372 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 14:03:27 +00:00
Aaron Jorbin
d85e98edf8 Coding Standards: Use preincrment.
Sorry Dennis.

Introduced in [60939].
See #63168.



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


git-svn-id: http://core.svn.wordpress.org/trunk@60371 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 14:01:58 +00:00
davidbaumwald
df78f7dc6d Comments: Ensure custom comment form fields appear for logged-in users
When a user is logged in, only the default comment textarea is shown by
the core `comment_form()` implementation, but custom fields supplied via the
`fields` argument are omitted. This mismatch means plugin- and theme-added fields
aren't visible to logged-in users, though they are visible to guests.  

This change fixes this by moving the loop over `$args['fields']` inside
`comment_form()`, so that extra fields are rendered, regardless of login status.

Props maorb, valendesigns, CarlSteffen, swissspidy, rachelbaker, kushsharma, abcd95, iamadisingh, oglekler, welcher.  
Fixes #16576.
Built from https://develop.svn.wordpress.org/trunk@61034


git-svn-id: http://core.svn.wordpress.org/trunk@60370 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 14:00:27 +00:00
ellatrix
d17bae0e95 Templates: add missing file after [61029].
See #62755.
Built from https://develop.svn.wordpress.org/trunk@61033


git-svn-id: http://core.svn.wordpress.org/trunk@60369 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 13:54:22 +00:00
gziolo
d3fe16afc4 Abilities API: Introduce server-side registry and REST API endpoints
Feature proposal at https://make.wordpress.org/ai/2025/07/17/abilities-api/.
Project developed in https://github.com/WordPress/abilities-api.

Introduces a new Abilities API that allows WordPress plugins and themes to register and execute custom abilities with built-in permission checking, input/output validation via JSON Schema, and REST API integration.

## Public Functions

### Ability Management
- `wp_register_ability( string $name, array $args ): ?WP_Ability` - Registers a new ability (must be called on `wp_abilities_api_init` hook)
- `wp_unregister_ability( string $name ): ?WP_Ability` - Unregisters an ability
- `wp_has_ability( string $name ): bool` - Checks if an ability is registered
- `wp_get_ability( string $name ): ?WP_Ability` - Retrieves a registered ability
- `wp_get_abilities(): array` - Retrieves all registered abilities

### Ability Category Management
- `wp_register_ability_category( string $slug, array $args ): ?WP_Ability_Category` - Registers an ability category (must be called on `wp_abilities_api_categories_init` hook)
- `wp_unregister_ability_category( string $slug ): ?WP_Ability_Category` - Unregisters an ability category
- `wp_has_ability_category( string $slug ): bool` - Checks if an ability category is registered
- `wp_get_ability_category( string $slug ): ?WP_Ability_Category` - Retrieves a registered ability category
- `wp_get_ability_categories(): array` - Retrieves all registered ability categories

## Public Classes

- `WP_Ability` - Encapsulates ability properties and methods (execute, check_permission, validate_input, etc.)
- `WP_Ability_Category` - Encapsulates ability category properties
- `WP_Abilities_Registry` - Manages ability registration and lookup (private, accessed via functions)
- `WP_Ability_Categories_Registry` - Manages ability category registration (private, accessed via functions)
- `WP_REST_Abilities_V1_List_Controller` - REST controller for listing abilities
- `WP_REST_Abilities_V1_Run_Controller` - REST controller for executing abilities

## REST API Endpoints

### Namespace: `wp-abilities/v1`

#### List Abilities
- `GET /wp-abilities/v1/abilities` - Retrieve all registered abilities
  - Query parameters: `page`, `per_page`, `category`

#### Get Single Ability
- `GET /wp-abilities/v1/abilities/(?P<name>[a-zA-Z0-9\-\/]+)` - Retrieve a specific ability by name

#### Execute Ability
- `GET|POST|DELETE /wp-abilities/v1/abilities/(?P<name>[a-zA-Z0-9\-\/]+)/run` - Execute an ability
  - Supports multiple HTTP methods based on ability annotations
  - Validates input against ability's input schema
  - Validates output against ability's output schema
  - Performs permission checks via ability's permission callback

## Hooks

### Actions
- `wp_abilities_api_categories_init` - Fired when ability categories registry is initialized (register categories here)
- `wp_abilities_api_init` - Fired when abilities registry is initialized (register abilities here)
- `wp_before_execute_ability` - Fired before an ability gets executed, after input validation and permissions check

- `wp_after_execute_ability` - Fires immediately after an ability finished executing

### Filters
- `wp_register_ability_category_args` - Filters ability category arguments before registration
- `wp_register_ability_args` - Filters ability arguments before registration

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

Props gziolo, jorbin, justlevine, westonruter, jason_the_adams, flixos90, karmatosed, timothyblynjacobs.
Fixes #64098.



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


git-svn-id: http://core.svn.wordpress.org/trunk@60368 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 13:52:27 +00:00
scruffian
c4e375fc4e Editor: Add support for select elements to theme.json.
Adds support for the select element in theme.json so that theme builders and extenders can be style select elements consistently.

We are targeting the select HTML element rather than adding a CSS class, as we do for other elements that theme.json supports. This commit adds no extra styling unless a theme opts in to use this and the specificity of any generated CSS with the element is 0.

See original Gutenberg PR: https://github.com/WordPress/gutenberg/pull/70379.

Example usage:

{{{
	"elements": {
		"select": {
			"color": {
				"text": "red",
				"background": "blue"
			}
		}
	}
}}}

Props onemaggie, joen, get_dave, wildworks, ocean90, mikachan, poena, SirLouen, tusharbharti, yashjawale, abcd95.
Fixes #63555. See #63878.
Built from https://develop.svn.wordpress.org/trunk@61031


git-svn-id: http://core.svn.wordpress.org/trunk@60367 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 13:49:31 +00:00
desrosj
160ccd428e Press This: Revert [60990] for more discussion.
[60990] introduced a new action, `press_this_init`. While the code changes adding the hook are straightforward, the actual use cases are not yet clear.

Reverting the change allows for more discussion to clarify what is actually supported through the addition of this new action.

Props jorbin.
See #53076.
Built from https://develop.svn.wordpress.org/trunk@61030


git-svn-id: http://core.svn.wordpress.org/trunk@60366 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 13:46:24 +00:00
ellatrix
82c917225c Templates: add PHP changes required for the template activation feature.
* Adds the `active_templates` setting, which is an object holding the template slug as a key and template post ID as the value.
* To maintain backwards compatibility, any `wp_template` (post type) not created through the new API will be activated.
* `get_block_template` and `get_block_templates` have been adjusted to check `active_templates`. These functions should never return inactive templates, just like before, to maintain backwards compatibility.
* The pre-existing `/templates` endpoint and sub-endpoints remain and work exactly as before.
* A new endpoint `/wp_template` has been added, but this is just a regular posts controller (`WP_REST_Posts_Controller`). We do register an additional `theme` field and expose the `is_wp_suggestion` meta.
* Another new endpoint `/wp_registered_template` has been added, which is read-only and lists the registered templates from themes and plugin (un-edited, without activations applied).

These changes are to be iterated on.

See https://github.com/WordPress/wordpress-develop/pull/8063.

Props ellatrix, shailu25, ntsekouras.
Fixes #62755.
Built from https://develop.svn.wordpress.org/trunk@61029


git-svn-id: http://core.svn.wordpress.org/trunk@60365 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 13:43:58 +00:00
Sergey Biryukov
6782a70a92 Coding Standards: Use more meaningful variable names in Theme Upgrader.
Per the [https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#naming-conventions Naming Conventions]:

> Don’t abbreviate variable names unnecessarily; let the code be unambiguous and self-documenting.

This commit includes renaming of the following variables:
* `$r` to `$upgrade_data`.
* `$res` to `$connected`.
* `$info` to `$new_theme_data`.

Follow-up to [8989], [11005], [13686], [18618], [20268], [57252].

Props costdev, mukesh27.
See #63168.
Built from https://develop.svn.wordpress.org/trunk@61028


git-svn-id: http://core.svn.wordpress.org/trunk@60364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 13:42:28 +00:00
ellatrix
4872502bff Block editor: make block-editor a script/module dual package.
Fit text is a block support under `block-editor`, that needs assets on the front-end, so block editor now exposes `wpScriptModuleExports` and needs to be included in `SCRIPT_AND_MODULE_DUAL_PACKAGES`, in order for its script modules to be registered and loaded.

See https://github.com/WordPress/wordpress-develop/pull/10373.

Props jorgefilipecosta.
Fixes #64124.
Built from https://develop.svn.wordpress.org/trunk@61027


git-svn-id: http://core.svn.wordpress.org/trunk@60363 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 13:29:33 +00:00
ellatrix
8f1afebf29 Editor: update packages.
Includes the following fixes: 116f67e040, a735e7b35c, 7d0076fee4, c5ab62ec3c.

See: https://github.com/WordPress/wordpress-develop/pull/10375.
See: https://core.trac.wordpress.org/ticket/64117.

Props ellatrix, jorgefilipecosta, ntsekouras.
Built from https://develop.svn.wordpress.org/trunk@61026


git-svn-id: http://core.svn.wordpress.org/trunk@60362 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 13:06:41 +00:00
Aaron Jorbin
cdf6d60db3 Mail: Improve tests for mail embeds
Use a dataProvider to ensure that embeds works with multiple different shaped arrays.

Follow-up to [60698].

Props sirlouen, dmsnell, jorbin.
Fixes #28059.


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


git-svn-id: http://core.svn.wordpress.org/trunk@60361 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 12:47:30 +00:00
cbravobernal
10e6cd7ff1 Global styles: add element support for text related inputs.
Adds elements support to text based form inputs so a theme can style consistently how forms should look like regardless of the plugins/blocks installed.

Props onemaggie, mukesh27, sabernhardt, scruffian, get_dave, ocean90, mikachan, wildworks.

Fixes #63878.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60360 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 12:42:28 +00:00
scruffian
d5243f4ddf Editor: Add support for text inputs to theme.json.
Adds support for text input elements to theme.json so that theme builders and extenders can be style text input elements consistently.

Text input elements are `textarea`, and `input` with type `email`, `number`, `password`, `search`, `text`, `tel` and `url`. We are targeting the HTML elements directly rather than adding a CSS class, as we do for other elements that theme.json supports. This commit adds no extra styling unless a theme opts in to use this and the specificity of any generated CSS with the element is 0.

See original Gutenberg PR: https://github.com/WordPress/gutenberg/pull/70378.

Example usage:

{{{
	"elements": {
		"textInput": {
			"border": {
				"radius": "0",
				"style": "solid",
				"width": "1px",
				"color": "red"
			},
			"color": {
				"text": "var(--wp--preset--color--theme-2)"
			},
			"typography": {
				"fontFamily": "var(--wp--preset--font-family--inter)"
			}
		}
	}
}}}

Reviewed by mukesh27, scruffian.
Merges [9600] to the 6.9 branch.

Props onemaggie, mukesh27, sabernhardt, joen, get_dave, wildworks, ocean90, mikachan, poena.
Fixes #63878. See #63555.
Built from https://develop.svn.wordpress.org/trunk@61023


git-svn-id: http://core.svn.wordpress.org/trunk@60359 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 12:40:31 +00:00
cbravobernal
00a7c0d3d9 Command Palette: Enqueue command-related assets for all admin pages.
Removes the core command initialization and registration code from the edit-post and edit-site packages and enqueues command-related assets globally.

Props wildworks, rcorrales, shailu25, youknowriad.

Fixes #63845.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60358 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 12:34:30 +00:00
ellatrix
e144d4bb63 Global styles: inherit all typography styles.
This PR syncs the changes initially added to Gutenberg in https://github.com/WordPress/gutenberg/pull/70676.

See https://github.com/WordPress/wordpress-develop/pull/9268.
See https://core.trac.wordpress.org/ticket/63700.

Fixes #63700.
Built from https://develop.svn.wordpress.org/trunk@61021


git-svn-id: http://core.svn.wordpress.org/trunk@60357 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 12:22:33 +00:00
luisherranz
2b84c75219 Interactivity API: Support unique IDs in server-side directives processing.
Server-side logic to support unique IDs in the Interactivity API directives to match what the client is doing (https://github.com/WordPress/gutenberg/pull/72161).

Props santosguillamot, darerodz, luisherranz.
Fixes #64106.
Built from https://develop.svn.wordpress.org/trunk@61020


git-svn-id: http://core.svn.wordpress.org/trunk@60356 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 12:09:33 +00:00
luisherranz
fb407f0a14 Interactivity API: Support for loadOnClientNavigation.
Uses the `wp_script_attributes` filter to add a `data-wp-router-options` directive with a `loadOnClientNavigation: true` property for all the interactive blocks that are compatible with client-side navigation to let the Interactivity API router determine which modules it can safely load during client-side navigation.

Props luisherranz, westonruter.
Fixes #64122.
Built from https://develop.svn.wordpress.org/trunk@61019


git-svn-id: http://core.svn.wordpress.org/trunk@60355 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 11:32:35 +00:00
Aaron Jorbin
664796e1f2 Build/Test: Limit PHPUnit Matrix for Pull Requests.
Instead of Pull Requests initiating 300+ actions, this brings it down closer to 50. This should allow more concurrent pull requests and speed up the flow.

Relevant Slack Discussion: https://wordpress.slack.com/archives/C02RQBWTW/p1761040717220989

Props youknowriad, ellatrix.
See #63167

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


git-svn-id: http://core.svn.wordpress.org/trunk@60354 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 11:24:35 +00:00
ellatrix
d03010f0d0 KSES: add MathML tags.
These tags are needed for the new Math block, which is included in WP 6.9.

See https://github.com/WordPress/gutenberg/pull/72182.
See https://github.com/WordPress/wordpress-develop/pull/10307.

Fixes #64115.
Built from https://develop.svn.wordpress.org/trunk@61017


git-svn-id: http://core.svn.wordpress.org/trunk@60353 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 11:06:40 +00:00
Aaron Jorbin
b5110df9c6 Multisite: Use "Network Activate" button on network plugin install screen.
The "Activate" button label should be "Network Activate" after clicking the "Install Now" button in Network Admin > Plugins > Add Plugin.

Props pmbaldha, shailu25, rollybueno.
Fixes #63954.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60352 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 11:01:32 +00:00
cbravobernal
cea01b509f Block editor: Conditionally enqueue front end assets for fitText.
Introduces a new fitText block support that enables automatic font size adjustment to fit text within its container boundaries.

Props jorgefilipecosta, mukesh27, wildworks.

Fixes #64119.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60351 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 10:59:40 +00:00
cbravobernal
cf843d1c0b Block visibility: Add block visibility support.
Adds block support to control block visibility. This support will prevent blocks from being rendered on the frontend, i.e., server-side.

Props wildworks, mukesh27, rollybueno.

Fixes #64061.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60350 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 10:49:44 +00:00
Weston Ruter
a27d227c9d Script Loader: Increase styles_inline_size_limit from 20K to 50K.
Benchmarking of initial page loads versus repeat page loads shows there is a greater performance improvement to increase inlining versus the benefits of relying on browser cache.

This new limit is expected to be further refined during beta based on additional testing.

Props westonruter, sabernhardt, poena, aristath, spacedmonkey, adamsilverstein, jonoaldersonwp, peterwilsoncc.
See #63007.
Fixes #63018.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60349 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 08:47:27 +00:00
ellatrix
0413a7c9dc Packages: sync dependencies arrays.
These arrays were updated through `npm run sync-gutenberg-packages -- --dist-tag=latest`.
Tests started failing after [61009]. They pass with these changes, see https://github.com/WordPress/wordpress-develop/pull/10371.

See #64117.
Built from https://develop.svn.wordpress.org/trunk@61012


git-svn-id: http://core.svn.wordpress.org/trunk@60348 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 08:42:26 +00:00
Aaron Jorbin
c601a29665 Build/Test Tools: Update caniuse data.
Browsers data (caniuse-lite) is 9 months old, so make it more up to date before beta 1.

See #63171.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60347 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 08:21:29 +00:00
dmsnell
4e551d969d wp_mail(): Set sender address by default.
WordPress has been calling `$phpmailer->setFrom()` with a `false` value for an attribute telling it to set the sender address for each message. This sender address is also known by other names: Envelope-From, MAIL FROM, Return-Path, etc... Unfortunately, this configuration can easily lead to mail being rejected by numerous mail hosts due to an invalid domain being generated by the local mail server/MTA.

The flag was originally added with the note that its absence “causes outgoing email to fail on some server environments.” However, it is likely that this led to the opposite effect, as evidenced by numerous reports, plugins, and workarounds over the years.

In this patch the flag is being removed, which has the effect of letting `$phpmailer` set the Sender value, which it does by default using the domain “where the front end is accessible” and which is is likely correct.

After this change there is a chance of mail failure for sites with SPF configured but which does not allow mail to be sent on behalf of this domain and if those sites also do not have a properly configured DKIM and DMARC setup. Those sites should review their SPF policies or the `wp_mail_from` filter.

Developed in https://github.com/WordPress/wordpress-develop/pull/9412
Discussed in https://core.trac.wordpress.org/ticket/49687

Follow-up to [38286].

Props cbutlerjr, dmsnell, jamieburchell, knutsp, kub1x, lordandy1984, piskvorky, SergeyBiryukov, siliconforks, SirLouen, stankea, vbbp, websupporter.

Fixes #49687.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60346 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 08:06:29 +00:00
ellatrix
c2bd5cd429 Editor: update packages.
Updates the packages to match Gutenberg version 21.9.0 RC2.

Also updates the sync script to work with the new `package-lock.json` format.
Some reusable block tests were adjusted to work with more render arguments.
Added `core-data` to the ignore list for `verify:source-maps` because Yjs has been bundled by accident. To be removed in a follow-up. See https://core.trac.wordpress.org/ticket/64120. See https://github.com/WordPress/gutenberg/pull/72503.

See: https://github.com/WordPress/wordpress-develop/pull/10355.
See: https://core.trac.wordpress.org/ticket/64117.

Props ellatrix, dmsnell.
Fixes #64117.
Built from https://develop.svn.wordpress.org/trunk@61009


git-svn-id: http://core.svn.wordpress.org/trunk@60345 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 07:14:02 +00:00
Weston Ruter
8e6fdc7c1d Script Loader: Load block styles on demand in classic themes via the template enhancement output buffer.
* This applies in classic themes when a site has not opted out of the template enhancement buffer by filtering `wp_should_output_buffer_template_for_enhancement` off.
* Both `should_load_separate_core_block_assets` and `should_load_block_assets_on_demand` are filtered on, as otherwise they are only enabled by default in block themes.
* Any style enqueued after `wp_head` and printed via `print_late_styles()` will get hoisted up to be inserted right after the `wp-block-library` inline style in the `HEAD`.
* The result is a >10% benchmarked improvement in LCP for core classic themes due to a ~100KB reduction in the amount of CSS unconditionally being served with every page load.

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

Follow-up to [60936].

Props sjapaget, westonruter, peterwilsoncc, dmsnell, mindctrl.
See #43258.
Fixes #64099.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60344 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 06:01:35 +00:00
dmsnell
2995f8d0e3 JS Interop: Add custom data attribute name converter pair.
This patch introduces two new functions: `wp_js_dataset_name()` and `wp_html_custom_data_attribute_name()`. Together, these provide reliable mapping between the HTML attribute names for custom data attributes, and the properties found in JavaScript for a given `HTMLElement`’s `.dataset` property.

These are to be used where matching names is important, such as in the Interactivity API and when WordPress is deciding whether or not to allow an attribute as a custom data attribute.

Developed in https://github.com/WordPress/wordpress-develop/pull/9953
Discussed in https://core.trac.wordpress.org/ticket/61501

Props dmsnell, westonruter.

See #61501.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60343 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 05:12:32 +00:00
Peter Wilson
1499d5e8d2 Upgrade/Install: Revert relocation of Hello Dolly plugin.
Reverts Hello Dolly changes moving the plugin to a containing folder. Removes the `upgrade_690()` function in it's entirety as the upgrade routine is no longer required. 

Fully reverted commits: [60666], [60670], [60716], [60725]; partially reverts [60721].

Porps johnbillion, whyisjake, SirLouen, mindctrl, afragen, jorbin, Otto42, swissspidy, welcher, davidbaumwald.
See #53323.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60342 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 04:33:29 +00:00
dmsnell
7031aed06f Charset: Update docblock @param type in _wp_scan_utf8().
Add missing `|null` to optional argument `&$has_noncharacters`.

Discussed in https://core.trac.wordpress.org/ticket/63863

Follow-up to [61000].

See #63863.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60341 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 04:22:29 +00:00
dmsnell
f5ce65e2bf Charset: Update docblock comment in _wp_scan_utf8().
Rewording of comment to better clarify the purpose of the arguments as written.

Discussed in https://core.trac.wordpress.org/ticket/63863

Follow-up to [60768].

See #63863.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60340 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 04:19:26 +00:00
dmsnell
65e16daded HTML API: Replace PCRE in set_attribute() with new UTF-8 utility.
The HTML API has relied upon a single PCRE to determine whether to allow setting certain attribute names. This was because those names aren’t allowed to contain Unicode noncharacters, but detecting noncharacters without a UTF-8 parser is nontrivial.

In this change the direct PCRE has been replaced with a number of `strcpn()` calls and a call to the newer `wp_has_noncharacters()` function. Under the hood, this function will still defer to a PCRE if Unicode support is available, but otherwise will fall back to the UTF-8 pipeline in Core.

This change removes the platform variability, making the HTML API more reliable when Unicode support for PCRE is lacking.

Developed in https://github.com/WordPress/wordpress-develop/pull/9798
Discussed in https://core.trac.wordpress.org/ticket/63863

See #63863.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60339 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 03:50:28 +00:00
Peter Wilson
79199e848e REST API: Improve performance of X-WP-Total/X-WP-TotalPages queries.
Improve the performance of fallback queries to determine the total number of objects available on various REST endpoints for out of bounds queries.

The database queries are modified to return the minimum amount of data required for determining the count and bypass priming of meta a term caches where appropriate.

Props adamsilverstein, joehoyle, johnbillion, jorbin, kadamwhite, spacedmonkey, sukhendu2002, westonruter.
Fixes #62801.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60338 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 03:33:30 +00:00
desrosj
0c7b629ae6 Upgrade/Install: Indicate use of MyISAM storage engine in upgrade check.
In MySQL 5.5.5, the default storage engine was changed from `MyISAM` to `InnoDB`. While still available, usage of `MyISAM` has been discouraged since and is considered legacy due to the lack of support for more modern feature. 

The percentage of WordPress sites with `MyISAM` tables in the wild is currently unknown. This change adds a field to upgrade checks that includes a list of tables using `MyISAM` to help make more informed decisions about database features in the future.

Props johnjamesjacoby, johnbillion, dd32, desrosj, mukesh27.
Fixes #63640.
Built from https://develop.svn.wordpress.org/trunk@61001


git-svn-id: http://core.svn.wordpress.org/trunk@60337 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 02:50:27 +00:00
dmsnell
8966a3e752 Charset: wp_has_noncharacters() for more-specific Unicode handling.
Noncharacters are code points that are permanently reserved in the Unicode Standard for internal use. They are not recommended for use in open interchange of Unicode text data. However, they are valid code points and will not cause a string to return as invalid.

Still, HTML and XML both impose semantic rules on their use and it may be important for code to know whether they are present in a string. This patch introduces a new function, `wp_has_noncharacters()`, which answers this question.

See https://www.unicode.org/versions/Unicode17.0.0/core-spec/chapter-23/#G12612

Developed in https://github.com/WordPress/wordpress-develop/pull/9827
Discussed in https://core.trac.wordpress.org/ticket/63863

See #63863.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60336 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 02:35:31 +00:00
Weston Ruter
1b2a381e29 Script Loader: Add support for printing script modules at wp_footer.
This brings API parity with `WP_Scripts` by implementing opt-in support for printing in the footer via an `in_footer` argument. This argument can be supplied via the `$args` array passed to `wp_enqueue_script_module()` or `wp_register_script_module()`, alongside the existing `fetchpriority` key introduced in #61734. It can also be set for previously-registered script modules via `WP_Script_Modules::set_in_footer()`. This is not applicable to classic themes since modules are enqueued while blocks are rendered after `wp_head` has completed, so all script modules are printed in the footer anyway; the `importmap` script must be printed after all script modules have been enqueued.

Script modules used for interactive blocks (with the Interactivity API) are automatically printed in the footer. Such script modules should be deprioritized because they are not in the critical rendering path due to interactive blocks using server-side rendering. Script modules remain printed at `wp_head` by default, although this default should be revisited since they have deferred execution (and they are printed in the footer for classic themes already, as previously noted). Moving a script module to the footer ensures that its loading does not contend with the loading of critical resources, such as the LCP element's image resource, and LCP is improved as a result.

This also improves specificity of some PHP types, it ensures that script modules can't be registered with an empty ID, and it prevents printing script modules with empty `src` URLs.

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

Follow-up to [60704].

Props b1ink0, westonruter, jonsurrell, peterwilsoncc, vipulpatil, mindctrl.
See #61734.
Fixes #63486.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60335 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-21 00:45:29 +00:00
Weston Ruter
db69108462 Themes: Update Tests_Template::test_taxonomy_template_hierarchy to account for new taxonomy template.
Follow-up to [60994].

See #35326.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60334 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-20 23:50:27 +00:00
Sergey Biryukov
d8dc8f547e Coding Standards: Use more meaningful variable names in Plugin Upgrader.
Per the [https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#naming-conventions Naming Conventions]:

> Don’t abbreviate variable names unnecessarily; let the code be unambiguous and self-documenting.

This commit includes renaming of the following variables:
* `$r` to `$upgrade_data`.
* `$res` to `$connected`.
* `$pluginfiles` to `$plugin_files` — Per naming conventions, separate words via underscores.
* `$info` to `$new_plugin_data`.

Follow-up to [6779], [8550], [9141], [11005], [12157], [18618], [56525].

Props costdev, mukesh27.
See #63168.
Built from https://develop.svn.wordpress.org/trunk@60997


git-svn-id: http://core.svn.wordpress.org/trunk@60333 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-20 23:37:34 +00:00
Weston Ruter
b03a7e135c Coding Standards: Remove extra line break which caused PHPCS to cry.
Sniff: Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines

Follow-up to [60992].

See #63989.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60332 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-20 22:54:28 +00:00