Disable auto-correct for the slug field on the quick/bulk edit interface. As slugs may consist of a number of words combined in to a single string, they are unlikely to pass spell checkers.
Props swb1192, SergeyBiryukov, afragen, Clorith, desrosj, JeffPaul, sabernhardt, Boniu91, costdev, hellofromTonya.
Fixes#50499.
git-svn-id: https://develop.svn.wordpress.org/trunk@52092 602fd350-edb4-49c9-b593-d223f7449a82
On user registration, the `$errors` variable is the result of `register_new_user` which contains either the newly registered user's ID on success or a `WP_Error` object on failure. This change passes that context to the `registration_redirect` filter.
Props Collizo4sky, aadilali, mukesh27, audrasjb.
Fixes#53992.
git-svn-id: https://develop.svn.wordpress.org/trunk@52091 602fd350-edb4-49c9-b593-d223f7449a82
Update svn props to ignore additional CSS, JavaScript and source map files following the package updates preparing for WordPress 5.9.
Follow up to [52042], [52046], [52069] and [52089].
See #54337, #53361.
git-svn-id: https://develop.svn.wordpress.org/trunk@52090 602fd350-edb4-49c9-b593-d223f7449a82
Update svn props to ignore additional CSS, JavaScript and source map files following the package updates preparing for WordPress 5.9.
Follow up to [52042], [52046], [52069].
See #54337, #53361.
git-svn-id: https://develop.svn.wordpress.org/trunk@52089 602fd350-edb4-49c9-b593-d223f7449a82
Clarify messaging of when `wp_nonce_ays('log-out')` is called due to an invalid log out nonce. The HTML title now describes the action being taken rather than using the generic text "something went wrong".
Props davidkryzaniak, hellofromTonya, peterwilsoncc.
Fixes#52600.
git-svn-id: https://develop.svn.wordpress.org/trunk@52088 602fd350-edb4-49c9-b593-d223f7449a82
As of November 2021, the `HTTP/3` protocol is still officially an Internet Draft, but is already supported by 74% of running web browsers and, according to W3Techs, 23% of the top 10 million websites. It has been supported by Google Chrome (including Chrome for Android, and Microsoft Edge, which is based on it) since April 2020 and by Mozilla Firefox since May 2021. Safari 14 (on macOS Big Sur and iOS 14) has also implemented the protocol but support is hidden behind a feature flag.
Based on the wide support, this change adds `HTTP/3` as a valid HTTP protocol.
Props malthert.
Fixes#54404.
git-svn-id: https://develop.svn.wordpress.org/trunk@52087 602fd350-edb4-49c9-b593-d223f7449a82
Adds an `is_array()` check before the `in_array()`. Why? `in_array()` requires a array for the haystack. Any other data type will cause a fatal error on PHP 8.0 or higher:
{{{
Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array
}}}
As this is a new filter, this type check properly guards to avoid the fatal error.
Follow-up to [52084].
See #54331.
git-svn-id: https://develop.svn.wordpress.org/trunk@52085 602fd350-edb4-49c9-b593-d223f7449a82
Adds a new filter `'http_allowed_safe_ports'` to control which ports are allowed for remote requests. By default, ports 80, 443, and 8080 are allowed for safe remote requests.
Adds tests.
Follow-up to [24480].
Props xknown, johnbillion, jorbin, costdev, dd32.
Fixes#54331.
git-svn-id: https://develop.svn.wordpress.org/trunk@52084 602fd350-edb4-49c9-b593-d223f7449a82
Adds a new `wp_mail_succeeded` action in `wp_mail` after the mail is sent. Also, adds a disclaimer to the hook's docblock, clarifying that the hook's firing doesn't necessarily mean the recipient received the mail, only that the mail was processed without any errors.
Props birgire, donmhico, johnbillion.
Fixes#53826.
git-svn-id: https://develop.svn.wordpress.org/trunk@52083 602fd350-edb4-49c9-b593-d223f7449a82
If a privacy policy is set, the page links to the footer of the site. As done in the other bundled themes, this link is added using `the_privacy_policy_link()`.
Follow-up to [49216].
Props ryelle, desrosj, kapilpaul, sabernhardt, audrasjb, justinahinon.
Fixes#53445.
git-svn-id: https://develop.svn.wordpress.org/trunk@52082 602fd350-edb4-49c9-b593-d223f7449a82
Twenty Twenty-Two arrives during an exciting time for WordPress themes. With the advent of Full Site Editing and Global Styles, themes are changing structurally and functionally to enable far more avenues for customization than users have come to expect in the past.
To take advantage of these new abilities, Twenty Twenty-Two has been designed to be the most flexible default theme ever created for WordPress.
Props sourav926, aristath, audrasjb, bgardner, briceduclos, poena, colorful-tones, dgwyer, dimadin, gregrickaby, ellenbauer, jffng, kafleg, karmatosed, kraftbj, kjellr, littlebigthing, onemaggie, matveb, mburridge, mtoensing, nickcernis, nielslange, williampatton, pgking, ribaricplusplus, scruffian, soean, utz119, youknowriad, desrosj, richtabor.
See #54318.
git-svn-id: https://develop.svn.wordpress.org/trunk@52081 602fd350-edb4-49c9-b593-d223f7449a82
This commit introduces the `/wp/v2/menus`, `/wp/v2/menu-items` and `/wp/v2/menu-locations` REST API endpoints. These endpoints are fully available to users with the `edit_theme_options` capability, but can be read by any user who can edit a REST API available post type.
The `nav_menu` taxonomy and `nav_menu_item` post type now map their capabilities to the `edit_theme_options` primitive capability. This allows developers to provide more fine-grained access control. However, if a developer is currently dynamically removing the `edit_theme_options` capability using `map_meta_cap`, they should use the `user_has_cap` filter instead.
The `wp_update_nav_menu_item()` function has been adjusted to return an error if saving the menu item post or assigning the menu item to a menu generate an error.
Lastly, a new menu item type is introduced, `block`, that can be used to store a Block as a menu item.
Props andraganescu, antonvlasenko, dingo_d, dlh, isabel_brison, kadamwhite, Mamaduka, NateWr, noisysocks, peterwilsoncc, ryelle, schlessera, soean, Spacedmonkey, talldanwp, TimothyBlynJacobs, tobifjellner, westonruter, wpscholar, zieladam.
Fixes#40878.
git-svn-id: https://develop.svn.wordpress.org/trunk@52079 602fd350-edb4-49c9-b593-d223f7449a82
This removes the use of `get_theme_file_path()` within `WP_Theme_JSON_Resolver` in favor of the similar `get_file_path_from_theme()` method.
The former is found within `wp-includes/link-template.php`, which is not currently loaded when `load-styles.php` attempts to load the necessary styles. `self::get_file_path_from_theme()` was used previously, but this was changed in [52049].
Props Mamaduka, audrasjb, hellofromTonya, jorbin, desrosj.
Fixes#54401. See #54336.
git-svn-id: https://develop.svn.wordpress.org/trunk@52077 602fd350-edb4-49c9-b593-d223f7449a82
This fixes a mix of tabs and spaces in the email template. Spaces inside a string are not considered WPCS errors, and are not required to be converted to tabs.
Follow-up to [52060], [52063].
See #43700.
git-svn-id: https://develop.svn.wordpress.org/trunk@52076 602fd350-edb4-49c9-b593-d223f7449a82
Adds the `wp_login_url()` login link to the Error message to be more helpful to users when their user email already is registered.
Improves the error message to more clearly communicate next step.
Follow-up to [16009], [22124], [31963].
Props andynick, costdev, dansoschin, sabernhardt, webcommsat.
Fixes#53631.
git-svn-id: https://develop.svn.wordpress.org/trunk@52074 602fd350-edb4-49c9-b593-d223f7449a82
Add "webp" extension to a media extension check, fixing an issue where the last used media
link type was not used for WebP images.
Props almendron, desrosj, kallookoo.
Fixes#53917.
git-svn-id: https://develop.svn.wordpress.org/trunk@52073 602fd350-edb4-49c9-b593-d223f7449a82
To avoid UI jumps when loading the page, the site-editor.php page
is marked as full screen by default.
This also matches the behavior of the post editor.
See #54337.
git-svn-id: https://develop.svn.wordpress.org/trunk@52071 602fd350-edb4-49c9-b593-d223f7449a82
- First pass at adding the site editor from the Gutenberg plugin to
wp-admin/site-editor.php.
- Adds miscellaneous PHP changes from Gutenberg 10.1 - 11.9.
Follows [52042].
See #54337.
Props youknowriad, aristath, hellofromtonya, gziolo.
git-svn-id: https://develop.svn.wordpress.org/trunk@52069 602fd350-edb4-49c9-b593-d223f7449a82
This also exposes the value of `allow_batch` in `OPTIONS` requests to a route.
A future commit will add batch support to more resources.
Props spacedmonkey, chrisvanpatten.
See #53063.
git-svn-id: https://develop.svn.wordpress.org/trunk@52068 602fd350-edb4-49c9-b593-d223f7449a82
The code in `wp_list_filter()` was a duplicate of `wp_filter_object_list()`, minus the `WP_List_Util::pluck()` (used when `$field` is configured).
In testing the wrapper, discovered an edge case (and potential bug) in `WP_List_Util::filter()` where if the operator matches an empty array was returned without resetting the output property. Without that property being set correctly, `WP_List_Util::get_output()` was not correct. This commit also fixes this by resetting the property to an empty array.
Follow-up to [15686], [17427], [38928], [51044].
Props pbearne, sergeybiryukov, hellofromTonya.
Fixes#53988.
git-svn-id: https://develop.svn.wordpress.org/trunk@52066 602fd350-edb4-49c9-b593-d223f7449a82
This changeset implements the refined lazy-loading behavior outlined in https://make.wordpress.org/core/2021/07/15/refining-wordpress-cores-lazy-loading-implementation/ in order to improve the Largest Contentful Paint metric, which can see a regression from images or iframes above the fold being lazy-loaded. Adjusting this so far has been possible for developers via filters and still is, however this enhancement brings a more accurate behavior out of the box for the majority of themes.
Specifically, this changeset skips the very first "content image or iframe" on the page from being lazy-loaded. "Content image or iframe" denotes any image or iframe that is found within content of any post in the current main query loop as well as any featured image of such a post. This applies both to "singular" as well as "archive" content: On a "singular" page the first image/iframe of the post is not lazy-loaded, while on an "archive" page the first image/iframe of the _first_ post in the query is not lazy-loaded.
This approach refines the lazy-loading behavior correctly for the majority of themes, which use a single-column layout for post content. For themes with multi-column layouts, a new `wp_omit_loading_attr_threshold` filter can be used to change how many of the first images/iframes are being skipped from lazy-loaded (default is `1`). For example, a theme using a three-column grid of latest posts for archives could use the filter to override the threshold to `3` on archive pages, so that the first three content images/iframes would not be lazy-loaded.
Props adamsilverstein, azaozz, flixos90, hellofromtonya, jonoaldersonwp, mte90, rviscomi, tweetythierry, westonruter.
Fixes#53675. See #50425.
git-svn-id: https://develop.svn.wordpress.org/trunk@52065 602fd350-edb4-49c9-b593-d223f7449a82
Introduces a new function called `wp_list_users()`. Similar to other list functions such as `wp_list_authors()`, it lists all the users of the site. Options are available to configure the HTML output.
Following the same pattern of the other list functions, the list's HTML output is rendered by default. Setting the `echo` argument to `false`, returns the list's HTML output.
A new test class is included.
Props afercia, audrasjb, chriscct7, costdev, desrosj, greenshady, hellofromTonya, mte90, nacin, rohan013, sergeybiryukov.
Fixes#15145.
git-svn-id: https://develop.svn.wordpress.org/trunk@52064 602fd350-edb4-49c9-b593-d223f7449a82
Adds the required infrastructure to render block-based themes. This is sourced
from the Gutenberg plugin.
Fixes#54335.
Props bernhard-reiter, youknowriad, ntsekouras, hellofromtonya.
git-svn-id: https://develop.svn.wordpress.org/trunk@52062 602fd350-edb4-49c9-b593-d223f7449a82
In the bookmarks walker `_walk_bookmarks()`, add a `'noopener'` to the bookmark's `rel` attribute when there's `target` attribute.
Adds a new test class for `wp_list_bookmarks()` and tests for this change.
Follow-up to [3880], [10712].
Props birgire, costdev, hellofromTonya, mukesh27 , sergeybiryukov, tw2113.
Fixes#53839.
git-svn-id: https://develop.svn.wordpress.org/trunk@52061 602fd350-edb4-49c9-b593-d223f7449a82
Changes the media library upload button to `input type="file"` for better end to end testing capabilities.
Props justinahinon, joedolson, sabernhardt, audrasjb.
Fixes#54168.
git-svn-id: https://develop.svn.wordpress.org/trunk@52059 602fd350-edb4-49c9-b593-d223f7449a82
Load a language switcher on the login and registration screens that allows users to choose any already-installed language. Set user locale on registration.
Props johnbillion, Nikschavan, afercia, sabernhardt, garrett-eclipse, keyur5, paaljoachim, Clorith, tobifjellner.
Fixes#43700.
git-svn-id: https://develop.svn.wordpress.org/trunk@52058 602fd350-edb4-49c9-b593-d223f7449a82
Fixes a crash that is happening when using an FSE theme because a function required is missing. Ports the function from the Gutenberg plugin.
Props oandregal, youknowriad.
git-svn-id: https://develop.svn.wordpress.org/trunk@52057 602fd350-edb4-49c9-b593-d223f7449a82
This commit ports the public functions to interact with the global styles & settings.
See #54336.
Props oandregal.
git-svn-id: https://develop.svn.wordpress.org/trunk@52054 602fd350-edb4-49c9-b593-d223f7449a82
This change intends to better guide users towards many of the useful resources available on WordPress.org.
* Appearance/Customizer - Add link to Customizer docs.
* Appearance/Editor - Improve link text & destination.
* Privacy Settings - Link to Privacy Settings docs.
* Site Health - Link to Site Health docs.
Props audrasjb, jdy68, webcommsat.
Fixes#54357.
git-svn-id: https://develop.svn.wordpress.org/trunk@52053 602fd350-edb4-49c9-b593-d223f7449a82
This commit adds global styles user content escaping. In addition, it ports the logic on the Gutenberg plugin implemented on WordPress/gutenberg#28061 to the core.
The logic tries to follow what was done for standard post content.
See #54336.
Props oandregal.
git-svn-id: https://develop.svn.wordpress.org/trunk@52052 602fd350-edb4-49c9-b593-d223f7449a82
This commit ports the global styles rest endpoints from the Gutenberg plugin into the core.
See #54336.
Props oandregal, aristath, timothyblynjacobs, spacedmonkey, youknowriad.
git-svn-id: https://develop.svn.wordpress.org/trunk@52051 602fd350-edb4-49c9-b593-d223f7449a82
This commit ports to core the changes to the classes that deal with theme.json code.
See #54336.
Props oandregal, spacedmonkey, noisysocks, hellofromtonya, youknowriad.
git-svn-id: https://develop.svn.wordpress.org/trunk@52049 602fd350-edb4-49c9-b593-d223f7449a82
Similar to `wp_array_slice_assoc()` or other array-related functions, this appears to be a general-purpose function unrelated to the Formatting component.
Add missing `public` visibility keyword.
Follow-up to [52037].
See #53971.
git-svn-id: https://develop.svn.wordpress.org/trunk@52048 602fd350-edb4-49c9-b593-d223f7449a82
This updates several NPM dependencies to their latest (or latest allowed) versions for bundled themes that have a `package.json` file (Twenty Nineteen and newer).
These updates did not result in any changes to the built files in Twenty Nineteen or Twenty Twenty. Some unnecessary parenthesis have been removed from `calc()` function calls within Twenty Twenty-One.
This change also contains several updates to the `package-lock.json` files made by running `npm audit fix` within each of these themes.
See #53361.
git-svn-id: https://develop.svn.wordpress.org/trunk@52047 602fd350-edb4-49c9-b593-d223f7449a82
This updates several NPM dependencies to their latest (or latest allowed) versions.
- `autoprefixer` from `9.8.6` to `9.8.8`
- `chalk` from `4.1.1` to `4.1.2`
- `grunt-contrib-concat` from `1.0.1` to `2.0.0`
- `grunt-contrib-jshint` from `3.0.0` to `3.1.1`
- `grunt-contrib-qunit` from `4.0.0` to `5.1.1`
- `qunit` from `2.16.0` to `2.17.2`
- `sass` from `1.34.1` to `1.43.4`
- `sinon` from `11.1.1` to `12.0.1`
- `sinon-test` from `3.1.0` to `3.1.1`
- `uglify-js` from `3.13.9` to `3.14.3`
- `wait-on` from `5.3.0` to `6.0.0`
This change also contains several updates to the `package-lock.json` file made by running `npm audit fix`.
See #53361.
git-svn-id: https://develop.svn.wordpress.org/trunk@52046 602fd350-edb4-49c9-b593-d223f7449a82
As a follow-up to [52024], simplifies the strict boolean type check to conserve memory and processing. Also includes an explanation of why a strict boolean is required as the returned filtered value. This commit is consistent with the implementation in [52043].
Follow-up to [33666], [36402], [52024].
Props hellofromTonya, peterwilsoncc, cybr, jrf.
Fixes#49628.
git-svn-id: https://develop.svn.wordpress.org/trunk@52045 602fd350-edb4-49c9-b593-d223f7449a82