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
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
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
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
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
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
[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
* 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
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
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
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
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
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
* 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
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
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
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
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
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
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