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
This uses the same cascade as tags and categories so the check will first be for the slug first, then the term ID,
In classic themes, you can now use term IDs when creating taxonomy templates. With `taxonomy-$taxonomy-{$term->term_id}.php` templates you don't need to worry about templates breaking if you rename the `Oakland Athletics` term to `Athletics` the way you do if you use slug based template names.
Props swissspidy, sebastian.pisula, jorbin, theMikeD.
Fixes#35326.
Built from https://develop.svn.wordpress.org/trunk@60994
git-svn-id: http://core.svn.wordpress.org/trunk@60330 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In [33771], is_user_member_of_blog() was optimised to improve the performance of get_blogs_of_user().
That change used $meta_key = '' to fetch all user meta, which can cause unnecessary data loading and makes it difficult to use the get_{$meta_type}_metadata filter. When all meta keys are retrieved, it’s not possible to tell which specific meta value is being requested for short-circuiting or custom handling.
This commit updates the logic to request only the meta key related to the blog’s capability check, reducing overhead and improving compatibility with metadata filters.
Props rinatkhaziev, spacedmonkey.
Fixes#63989.
Built from https://develop.svn.wordpress.org/trunk@60992
git-svn-id: http://core.svn.wordpress.org/trunk@60328 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Change the admin menu quick search to limit to searching post titles. Add filter `wp_ajax_menu_quick_search_args` to support customizing post columns in query. Clear quick search results when search query is cleared. Send announcements about search status via `wp.a11y.speak()`.
Props diebombe, afercia, audrasjb, nickjbedford, kevinlearynet, mukesh27, joedolson.
Fixes#48655.
Built from https://develop.svn.wordpress.org/trunk@60991
git-svn-id: http://core.svn.wordpress.org/trunk@60327 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In [36566], a framework for lazily loading metadata was introduced, initially supporting term and comment meta. This commit extends that support to user meta.
User meta can contain a large amount of data that is not always needed, particularly on the front end. To address this, cache_users() now calls the new function wp_lazyload_user_meta(). This function accepts an array of user IDs and adds them to the queue of metadata to be lazily loaded.
Follows on from [55671], [55747].
Props spacedmonkey, westonruter.
Fixes#63021.
Built from https://develop.svn.wordpress.org/trunk@60989
git-svn-id: http://core.svn.wordpress.org/trunk@60325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Add a notification when typing passwords on the user registration, user login, and user profile screens that notifies the user if they are typing with caps lock enabled.
This can help reduce user friction when logging in, prevent user error when creating passwords, and reduce the need for a user to use the show password button.
Props dartiss, swissspidy, johnbillion, nikunj8866, pmbaldha, mosescursor, sirlouen, westonruter, praful2111, devsabbirahmed, kawsar007, najmulsaju, yashyadav247, sajjad67, joedolson.
Fixes#48345.
Built from https://develop.svn.wordpress.org/trunk@60988
git-svn-id: http://core.svn.wordpress.org/trunk@60324 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Bring the PHP part of the new Notes feature into core for the 6.9 release. See related Gutenberg Issue: https://github.com/WordPress/gutenberg/issues/71826. These changes do not impact any user facing functionality, they simply prepare core for the JavaScript functionality that will come over in a separate sync.
Overview of changes:
- Ensure Notes are not included in comment counts
- Enable the note type (REST API)
- Adjust capabilities so edit_post cap implies ability to edit notes
- Enable empty and duplicate notes for resolve/re-open actions
- Add control over notes with post type supports check
- Register new note resolution status meta
Props: ristojovanovic, adamsilverstein, jeffpaul, wildworks, mamaduka, swissspidy, timothyblynjacobs, kadamwhite.
Fixes#64096.
Built from https://develop.svn.wordpress.org/trunk@60987
git-svn-id: http://core.svn.wordpress.org/trunk@60323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Because of a strange interaction with building Gutenberg from within the plugins directory, TypeScript was appearing to examine code for which it should have no access up the filesystem hierarchy.
This patch changes the order of building Gutenberg so that it occurs before those parent directories contain TypeScript code (by installing the `npm` dependencies) and thus frees up the builds.
This change should not serve as a workaround to avoid fixing the root issue, introduced in 8401993599. Rather, it should be seen as at least a temporary way to remove the trigger of the problem during CI builds.
See also alternative work:
- To build Gutenberg outside of the plugin directory in https://github.com/WordPress/wordpress-develop/pull/10282/files.
- To patch the broken `@wordpress/blocks` types inside of `@wordpress/core-data`.
Developed in https://github.com/WordPress/wordpress-develop/pull/10283
Props czarate, desrosj, dmsnell, ellatrix, jorbin, peterwilsoncc, ramonopoly, westonruter, youknowriad.
Built from https://develop.svn.wordpress.org/trunk@60985
git-svn-id: http://core.svn.wordpress.org/trunk@60321 1a063a9b-81f0-0310-95a4-ce76da25c4cd