Commit Graph

51590 Commits

Author SHA1 Message Date
gziolo
e075f91aec Abilities API: Refactor registration for core abilities
Renames the files and adds a test cleanup so it doesn't accidentaly influence the rest of other tests.

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

Follow-up [61063].
See #64146.


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


git-svn-id: http://core.svn.wordpress.org/trunk@60404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-27 09:08:28 +00:00
gziolo
d0c71b779f Abilities API: Improve inline documentation
This was discussed in https://github.com/WordPress/wordpress-develop/pull/9410 and decided to defer until after beta1.

Fleshing out the phpdocs for the extender functions in https://core.trac.wordpress.org/browser/trunk/src/wp-includes/abilities-api.php should make it easier for people working with the abilities API

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

Follw-up [61032].

Props jorbin, gziolo, mukesh27, jason_the_adams, westonruter.
Fixes #64134.


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


git-svn-id: http://core.svn.wordpress.org/trunk@60403 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-27 08:20:36 +00:00
ramonopoly
9b65fce3f6 get_adjacent_post: modify WHERE clause to include ID-based fallback to ensure deterministic ordering
Since WordPress 2.7, where multiple posts have identical post_date values (e.g., when bulk publishing drafts), the next/previous post navigation skips posts or behaves unpredictably. This is because the WHERE clause uses strict inequality (`>` or `<`) which excludes posts with the same date.

To ensure deterministic ordering, this commit modifies the WHERE clause to include ID-based fallback for posts with identical dates.

Props ramonopoly, westonruter, andrewserong.

Fixes #8107.



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


git-svn-id: http://core.svn.wordpress.org/trunk@60402 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-26 21:21:31 +00:00
ramonopoly
9297bdec0e Media / Attachments REST API endpoint: cast args to array before sending to wp_slash > wp_insert_attachment
This commit casts the object returned by `prepare_item_for_database()` to an array. Without doing so, `wp_slash()` returns the object unchanged, meaning string values within the object wouldn't be properly escaped for database insertion.

Follow-up to [64035]

Props ramonopoly, westonruter, mukesh27, justlevine.

Fixes #64149.


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


git-svn-id: http://core.svn.wordpress.org/trunk@60401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-26 21:08:28 +00:00
Sergey Biryukov
4c5ee7633f Twenty Nineteen: Document the twentynineteen_content_width filter.
Includes removing an unnecessary PHPCS ignore annotation. The linked WPCS issue is not open anymore, and [https://github.com/WordPress/WordPress-Coding-Standards/pull/1773 WordPress/WordPress-Coding-Standards#1773] indicates that the test now makes an exception for `$content_width`.

Follow-up to [43808].

Props viralsampat, pmbaldha, sabernhardt.
See #63664.
Built from https://develop.svn.wordpress.org/trunk@61064


git-svn-id: http://core.svn.wordpress.org/trunk@60400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-26 16:59:32 +00:00
jorgefilipecosta
b7bf6c711f Abilities API: Include initial core abilities and categories registration.
Without this patch we would introduce the Abilities API without any core abilities being registered.
This patch includes the following initial abilities:
- core/get-bloginfo - Retrieve individual site information fields (name, description, url, wpurl, admin_email, charset, language, version).
- core/get-current-user-info - Get current authenticated user data (id, display_name, user_nicename, user_login, roles, locale).
- core/get-environment-type - Get WordPress environment type (production, staging, development, local).

Developed in #10411.

Follow-up [64098].

Props gziolo, jorgefilipecosta, mukesh27, isotropic, jorbin, justlevine, jason_the_adams.
Fixes #64146.
Built from https://develop.svn.wordpress.org/trunk@61063


git-svn-id: http://core.svn.wordpress.org/trunk@60399 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-26 10:02:34 +00:00
Sergey Biryukov
12b58d90e9 Twenty Nineteen: Document the twentynineteen_can_show_post_thumbnail filter.
Follow-up to [43808].

Props pmbaldha, sabernhardt, kishanjasani, mukesh27.
Fixes #63645.
Built from https://develop.svn.wordpress.org/trunk@61062


git-svn-id: http://core.svn.wordpress.org/trunk@60398 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-25 22:52:31 +00:00
Weston Ruter
d06036fea3 Formatting: Replace non-breaking hyphens (U+2011) with hyphens in sanitize_title_with_dashes().
Developed in https://github.com/WordPress/wordpress-develop/pull/10204

Follow-up to [18705], [36775].

Props patpiwo, westonruter, dmsnell.
See #31790, #10797.
Fixes #64089.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-25 18:24:32 +00:00
Sergey Biryukov
adb9eea7c2 Twenty Sixteen: Document the twentysixteen_author_avatar_size filter.
Follow-up to [40851].

Props pmbaldha, sabernhardt.
Fixes #63647.
Built from https://develop.svn.wordpress.org/trunk@61060


git-svn-id: http://core.svn.wordpress.org/trunk@60396 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-24 23:30:37 +00:00
gziolo
1f1e5dfdd5 Abilities API: Ensure public method is used in the codebase
Discovered when syncing code back to Abilities API repository in https://github.com/WordPress/abilities-api/pull/126.

Follow-up to [61032].
See #64098.


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


git-svn-id: http://core.svn.wordpress.org/trunk@60395 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-24 11:57:30 +00:00
Weston Ruter
d9b756760c General: Add comment explaining use of queried object in feed_links_extra() instead of global $post.
Follow-up to [61056].

Props mukesh27, westonruter.
See #63263.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-24 05:26:33 +00:00
Weston Ruter
4a409d9c75 Posts, Post Types: Update get_the_modified_author() to handle missing global $post and add (missing) $post arg.
The addition of the `$post` argument (which defaults to the global post) brings `get_the_modified_author()` in line with other similar functions, including `get_the_modified_date()` and `get_the_modified_time()`.  

Props Cornwell, jdahir0789, dhruvang21, Presskopp, mindctrl, samirmalpande, audrasjb, johnbillion, SergeyBiryukov, desrosj, costdev, mukesh27, westonruter.
Fixes #64104, #55978.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-24 04:04:26 +00:00
Weston Ruter
f3ee97de93 General: Improve resilience of feed_links_extra() when global $post is not set.
This obtains the global post via `get_queried_object()` when `is_singular()`.

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

Props westonruter, johnjamesjacoby, Presskopp, abcd95, dilipbheda, sabernhardt, awetz583, indirabiswas27.
Fixes #63263.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60392 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-24 03:32:29 +00:00
Sergey Biryukov
dc0b141f7d Twenty Sixteen: Document the twentysixteen_content_width filter.
Follow-up to [40851].

Props pmbaldha, sabernhardt.
Fixes #63646.
Built from https://develop.svn.wordpress.org/trunk@61055


git-svn-id: http://core.svn.wordpress.org/trunk@60391 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-23 23:55:32 +00:00
ellatrix
e0b9d1827f Template activation: fix unique slug filtering.
The logic introduced for the unique slug filter in [61033] is incorrect. We should return the desired slug for the `wp_template` post type. This causes any second created template targeting a certain slug to not work correctly.

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

See #62755.
Fixes #64141.
Props ntsekouras, priethor.
Built from https://develop.svn.wordpress.org/trunk@61054


git-svn-id: http://core.svn.wordpress.org/trunk@60390 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-23 15:00:36 +00:00
Sergey Biryukov
95d6d51e13 Coding Standards: Use Yoda conditions consistently in wp-includes/formatting.php.
While Yoda conditions are mostly relevant for variables and not required if neither side is a variable, this commit aims to make the order more consistent throughout the file.

Follow-up to [1636], [4990], [6974], [10322], [10769], [11048], [42770], [47219], [56325].

Props subrataemfluence, sabernhardt, ishikaatxecurify, callumbw95, peterwilsoncc, SergeyBiryukov.
Fixes #46846.
Built from https://develop.svn.wordpress.org/trunk@61053


git-svn-id: http://core.svn.wordpress.org/trunk@60389 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-22 23:25:36 +00:00
Weston Ruter
ef01f4281c Script Loader: Fix logic inversion with $html5_script_support in wp_sanitize_script_attributes().
The value was actually whether HTML5 was ''not'' supported.

Follow-up to [50167].

Props jamieburchell, sabernhardt.
See #39941.
Fixes #64128.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60388 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-22 22:33:32 +00:00
Weston Ruter
9b0c8e3cf7 Editor: Allow name attribute on the details element in KSES.
The `details` element supports the exclusive accordion behavior among multiple `details` elements by setting a common `name` attribute. The ability to set the `name` attribute in the Details block was added in of Gutenberg 20.2. However, when a user without `unfiltered_html` attempts to save the post, the `name` attribute gets erroneously stripped out. This prevents that. 

See [https://github.com/WordPress/gutenberg/issues/56969 Details block: Exclusive accordions].

Follow-up to [14406], [59775].

Props soean.
See #12835, #62887.
Fixes #64127.

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


git-svn-id: http://core.svn.wordpress.org/trunk@60387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-22 21:02:35 +00:00
desrosj
fb83096774 Build/Test Tools: Remove Dependabot-specific workflow conditions.
Since the bot has been disabled, these conditions are no longer necessary.

Follow up to [61049].
See #64140.
Built from https://develop.svn.wordpress.org/trunk@61050


git-svn-id: http://core.svn.wordpress.org/trunk@60386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-22 18:07:29 +00:00
desrosj
425c6633dc Build/Test Tools: Remove the dependabot.yml configuration file.
Despite having worked reliably for a few years (first configured in [52241]), the branches and pull requests created by Dependabot are now being deleted and closed after every Git mirror event since early 2024. Since this happens after every commit, the bot is essentially useless in this repository. 

This removes the configuration file to avoid unnecessarily creating pull requests and consuming GitHub Actions resources when they will just be closed shortly after.

If the root cause for this change in behavior is discovered and addressed, then re-adding a `dependabot.yml` file can be considered. For now, you’re just somebody that I used to know.

Props johnbillion, dd32, swissspidy.
Fixes #64140.
Built from https://develop.svn.wordpress.org/trunk@61049


git-svn-id: http://core.svn.wordpress.org/trunk@60385 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-22 17:22:30 +00:00
johnjamesjacoby
0f229a6b73 Query: Prevent querying for all terms in WP_Term_Query when include is set to [0].
This change brings the `include` parameter of `WP_Term_Query` up-to-speed with the `include` and `__in` parameters of other `_Query` classes, so that sending a value of `[0]` will not unintentionally perform an unbound query that returns all Terms.

It also introduces 3 new unit tests (for the Post, Term, and User query classes) to compare this behavior between them and ensure they remain consistent going forward.

Props audrasjb, hareesh-pillai, hellofromTonya, johnjamesjacoby, mukesh27.

Fixes #47719.
Built from https://develop.svn.wordpress.org/trunk@61048


git-svn-id: http://core.svn.wordpress.org/trunk@60384 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-22 16:30:31 +00:00
gziolo
7aa1b7ef5b Abilities API: Normalize input from schema
Without this patch REST API would require a weird empty `?input` field for optional input given how the current controller works with input schema when it defines the expected shape. This patch normalizes the input for the ability, applying the default value from the input schema when needed.

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

Follow-up [61032], [61045].

Props gziolo, jorgefilipecosta, mukesh27.
Fixes #64139.



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


git-svn-id: http://core.svn.wordpress.org/trunk@60383 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-22 15:04:30 +00:00
davidbaumwald
606cdfb2c9 Editor: Re-add support for text inputs to theme.json.
Re-adds support for text input elements to theme.json originally included in [61023] that was accidently removed in a subsequent commit. 

This change also include the updated docblock for `@since 6.9.0`.

Follow-up to [61023], [61031].

Props leemon, wildworks, ella, scruffian, cbravobernal, desrosj, davidbaumwald.
Fixes #63878. 
Built from https://develop.svn.wordpress.org/trunk@61046


git-svn-id: http://core.svn.wordpress.org/trunk@60382 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-22 13:49:33 +00:00
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