This more accurately describes the behavior of the function, and is more consistent with the documentation for other post and attachment functions.
Follow-up to [50039].
Props Mista-Flo.
See #52196.
git-svn-id: https://develop.svn.wordpress.org/trunk@50051 602fd350-edb4-49c9-b593-d223f7449a82
Update @wordpress npm packages to the latest published versions. This means that
the block editor includes functionality that exists in Gutenberg 9.8.
See #52334.
Props isabel_brison.
git-svn-id: https://develop.svn.wordpress.org/trunk@50048 602fd350-edb4-49c9-b593-d223f7449a82
In [49084] (for #50679), wp_get_attachment_metadata() was changed to improve performance, but it had the side effect of eliminating the ability to call it with no arguments and have it default to using the global $post.
This change restores that ability, while keeping the performance improvements from the original change.
Fixes#52196.
Props cfinke, hellofromTonya, mukesh27, dilipbheda, Mista-Flo, audrasjb, SergeyBiryukov, whyisjake.
git-svn-id: https://develop.svn.wordpress.org/trunk@50039 602fd350-edb4-49c9-b593-d223f7449a82
By moving from `.html` to `.php` files, we can prevent directory listings, and ensure that WordPress can load.
Fixes#52299.
Props lucasbustamante, xkon, freewebmentor, SergeyBiryukov, whyisjake.
git-svn-id: https://develop.svn.wordpress.org/trunk@50037 602fd350-edb4-49c9-b593-d223f7449a82
The version checks that are setup in `wp-includes/update.php` do set up the action, but only for the main site.
Fixes#52135.
Props audrasjb, SergeyBiryukov, maxpertici, aaribaud.
git-svn-id: https://develop.svn.wordpress.org/trunk@50035 602fd350-edb4-49c9-b593-d223f7449a82
The function `wp_text_diff` generated an invalid table structure if the $args parameter contained any values. This patch corrects the structure generated by `wp_text_diff` and related usages so that the column count matches the data generated. Additionally, this patch passes arguments to the Revisions screen so that the screen has column headings that reflect the content in each column. Improves the accessibility and usability of the Revisions table.
Props joedolson, mehulkaklotar, afercia, adamsilverstein, zodiac1978, jeremyfelt
Fixes#25473
git-svn-id: https://develop.svn.wordpress.org/trunk@50034 602fd350-edb4-49c9-b593-d223f7449a82
The Twenty Twenty search modal uses aria-expanded correctly on the Search button, but toggles the aria-expanded value on the 'close' button. The close button is a different control, however, so the attribute value toggling is uneven. The close button does not toggle any behavior; it only closes a control that has already been opened.
Props alexstine, audrasjb
Fixes#52355
git-svn-id: https://develop.svn.wordpress.org/trunk@50033 602fd350-edb4-49c9-b593-d223f7449a82
Italicized text can be difficult to read for some people with dyslexia or related forms of reading disorders. This removes italics on a number of larger blocks onpm run grunt rpf text in the admin. This has been a task 5.3; this commit closes the task. Further instances of italicized text should be addressed individually.
Props afercia, xkon, audrasjb
Fixes#47327
git-svn-id: https://develop.svn.wordpress.org/trunk@50032 602fd350-edb4-49c9-b593-d223f7449a82
Application names are now required to be unique and cannot contain solely whitespace characters. Additionally, invalid characters are now stripped from the application name using `sanitize_text_field()`.
Props Boniu91, hellofromTonya, engahmeds3ed, xkon, francina.
Fixes#51941.
git-svn-id: https://develop.svn.wordpress.org/trunk@50030 602fd350-edb4-49c9-b593-d223f7449a82
In [50021], caching was removed causing unintended classic block media flows to fail.
Reverts [50021].
See #50025.
git-svn-id: https://develop.svn.wordpress.org/trunk@50029 602fd350-edb4-49c9-b593-d223f7449a82
The update icon rotation should not occur when the user has opted to reduce motion, for example by selecting the "Reduce motion" option in macOS' preferences or unselecting "Show animations in Windows" in Windows' preferences.
Follow-up to [47813], [50027].
Props xkon, audrasjb, johnbillion.
Fixes#52263. See #51476.
git-svn-id: https://develop.svn.wordpress.org/trunk@50028 602fd350-edb4-49c9-b593-d223f7449a82
This provides better indication within the viewport about ongoing processes on the page when updating several plugins at the same time, but without using the bulk updater.
Props ravipatel, audrasjb, johnjamesjacoby, paaljoachim, hellofromTonya, sabernhardt, mdwolinski, karmatosed, SergeyBiryukov.
Fixes#51476.
git-svn-id: https://develop.svn.wordpress.org/trunk@50027 602fd350-edb4-49c9-b593-d223f7449a82
As per design, the background should be transparent and the text should be dark grey, not vice versa.
Follow-up to [49987].
Props poena.
Fixes#52374. See #51927.
git-svn-id: https://develop.svn.wordpress.org/trunk@50026 602fd350-edb4-49c9-b593-d223f7449a82
This is part of a larger project in cleaning up core's admin CSS. This collapses all colors used in the CSS to one of 12 blues, greens, reds, and yellows, 13 grays, pure black, and pure white. The colors are perceptually uniform from light to dark, half of each range has a 4.5 or higher contrast against white, the other half has a 4.5 or higher contrast against black.
Standardizing on this set of colors will help contributors make consistent, accessible design decisions. The full color palette can be seen here: https://codepen.io/ryelle/full/WNGVEjw
Props notlaura, danfarrow, kburgoine, drw158, audrasjb, Joen, hedgefield, ibdz, melchoyce.
See #49999.
git-svn-id: https://develop.svn.wordpress.org/trunk@50025 602fd350-edb4-49c9-b593-d223f7449a82
These parameters work just the same as `before` and `after` except they operate on the post modified date instead of the post published date.
Props claytoncollie, TimothyBlynJacobs, hellofromTonya
Fixes#50617
git-svn-id: https://develop.svn.wordpress.org/trunk@50024 602fd350-edb4-49c9-b593-d223f7449a82
Previously, newly uploaded media attachments were missing when filtering media items by date due to lack of cache invalidation.
Props adamsilverstein, teamdnk, afercia, Mista-Flo, joedolson.
Fixes#50025.
git-svn-id: https://develop.svn.wordpress.org/trunk@50021 602fd350-edb4-49c9-b593-d223f7449a82
This updates `autoprefixer` from version `9.6.2` to `9.8.6`. This includes changes as a result of running `npm run grunt precommit:css`.
See #51801.
git-svn-id: https://develop.svn.wordpress.org/trunk@50017 602fd350-edb4-49c9-b593-d223f7449a82
This replaces the Codex URL in the "WordPress" section of the admin bar with the HelpHub URL, and updates the Support link to point to the forums.
Follow-up to [45140], [45412].
Props audrasjb.
Fixes#52352. See #46790, #47239.
git-svn-id: https://develop.svn.wordpress.org/trunk@50015 602fd350-edb4-49c9-b593-d223f7449a82
This allows a menu item `post_date` to be set to particular value, rather than only allowing it to be set to "now". In particular, the WordPress Importer can use this to perform faster, more accurate duplicate checks.
Props jmdodd.
Fixes#52189.
git-svn-id: https://develop.svn.wordpress.org/trunk@50013 602fd350-edb4-49c9-b593-d223f7449a82
`wp_insert_post()` has a few checks using `post_date` and `post_date_gmt`, to determine the correct post date. This functionality is now extracted out into a new `wp_resolve_post_date()` function, allowing the checks to be reused elsewhere.
Props jmdodd.
Fixes#52187.
git-svn-id: https://develop.svn.wordpress.org/trunk@50012 602fd350-edb4-49c9-b593-d223f7449a82
Since WordPress 2.5 and 2.6, `post_content` and `post_excerpt` have both had export-specific filters: `the_content_export`, and `the_excerpt_export`, respectively. `post_title`, however, has used `the_title_rss`, which behaves differently in two important ways:
- It strips HTML tags from the string.
- It HTML-encodes the title string.
These behaviours are not ideal for exports, since it changes the post title, resulting in data loss in export files, and incorrect post duplicate matching on import. This changes replaces the usage of `the_title_rss` with a new filter, `the_title_export`. The new filter is intended to be used in the same as `the_content_export` and `the_excerpt_export`.
Props jmdodd, audrasjb.
Fixes#52250.
git-svn-id: https://develop.svn.wordpress.org/trunk@50011 602fd350-edb4-49c9-b593-d223f7449a82
Previously, the `enum` keyword was validated by perform a strict equality check. For `string` types this is generally ok, but it prevented using alternative types like `number` when rich type support isn't available.
Now the same level of type coercion/sanitization is applied when validating `enum` as all other validation checks. This means that a value of `"1"` will be accepted for an `enum` of `[ 0, 1 ]`. Additionally, `object` types now properly ignore key order when checking for equality.
Props yakimun.
Fixes#51911.
git-svn-id: https://develop.svn.wordpress.org/trunk@50010 602fd350-edb4-49c9-b593-d223f7449a82
Previously, the majority of JSON Schema validation errors returned a generic `rest_invalid_param` error code. In preparation for #46191, where the underlying validation error code will be exposed, this commit adds specific error codes for each failure scenario.
Fixes#52317.
git-svn-id: https://develop.svn.wordpress.org/trunk@50007 602fd350-edb4-49c9-b593-d223f7449a82
In [49752] a check was added to prevent creating new Application Passwords if Basic Auth credentials were detected to prevent conflicts. This check takes place in WP-Admin, though a conflict would only arise if Basic Auth was used on the website's front-end.
This commit extracts the Basic Auth check into a reusable function, `wp_is_site_protected_by_basic_auth()`, which can be adjusted using a filter of the same name. This way, a site that uses Basic Auth to protect WP-Admin can still use the Application Passwords feature.
In the future, instead of requiring the use of a filter, WordPress could make a loopback request and check for a `WWW-Authenticate` header to make this detection more robust out of the box.
Props SeBsZ, archon810, aaroncampbell, ocean90, SergeyBiryukov, TimothyBlynJacobs.
Fixes#52066.
git-svn-id: https://develop.svn.wordpress.org/trunk@50006 602fd350-edb4-49c9-b593-d223f7449a82
To be able to disable jQuery Migrate as step 3 of updating the jQuery version shipped with WordPress, all `JQMIGRATE` warnings in the browser console will have to be addressed.
This includes many minor adjustments to a wide array of core files.
Follow-up to:
* Step 1: Disabling jQuery Migrate 1.4.1 in WordPress 5.5: [48323], [48324]
* Step 2: Updating jQuery to 3.5.1 and adding jQuery Migrate 3.3.x in WordPress 5.6: [49101], [49338], [49615], [49649]
Props Clorith, azaozz.
See #51812.
git-svn-id: https://develop.svn.wordpress.org/trunk@50001 602fd350-edb4-49c9-b593-d223f7449a82
This brings some consistency to closing `</header>` tags in theme templates and ensures they all have an associated HTML comment.
Props freewebmentor, mukesh27.
Fixes#52328.
git-svn-id: https://develop.svn.wordpress.org/trunk@49993 602fd350-edb4-49c9-b593-d223f7449a82
This changeset introduces a filter-based Robots API, providing central control over the `robots` meta tag.
* Introduces `wp_robots()` function which should be called anywhere a `robots` meta tag should be included.
* Introduces `wp_robots` filter which allows adding or modifying directives for the `robots` meta tag. The `wp_robots()` function is entirely filter-based, i.e. if no filter is added to `wp_robots`, no directives will be present, and therefore the entire `robots` meta tag will be omitted.
* Introduces the following `wp_robots` filter functions which replace similar existing functions that were manually rendering a `robots` meta tag:
* `wp_robots_noindex()` replaces `noindex()`, which has been deprecated.
* `wp_robots_no_robots()` replaces `wp_no_robots()`, which has been deprecated.
* `wp_robots_sensitive_page()` replaces `wp_sensitive_page_meta()`, which has been deprecated. Its rendering of the `referrer` meta tag has been moved to another new function `wp_strict_cross_origin_referrer()`.
Migration to the new functions is straightforward. For example, a call to `add_action( 'wp_head', 'wp_no_robots' )` should be replaced with `add_filter( 'wp_robots', 'wp_robots_no_robots' )`.
Plugins and themes that render their own `robots` meta tags are encouraged to switch to rely on the `wp_robots` filter in order to use the central management layer now provided by WordPress core.
Props adamsilverstein, flixos90, timothyblynjacobs, westonruter.
See #51511.
git-svn-id: https://develop.svn.wordpress.org/trunk@49992 602fd350-edb4-49c9-b593-d223f7449a82
This removes instances of the `-moz-user-select` property, which was required until Firefox 68.
Firefox is currently in version 84, so these can safely be removed.
Fixes#52332.
git-svn-id: https://develop.svn.wordpress.org/trunk@49991 602fd350-edb4-49c9-b593-d223f7449a82
This updates two NPM packages:
- `qunit` from `2.13.0` to `2.14.0`.
- `sinon` from `9.2.2` to `9.2.3`.
See #51801.
git-svn-id: https://develop.svn.wordpress.org/trunk@49990 602fd350-edb4-49c9-b593-d223f7449a82
This change restructures the Button element styles for better a11y and expected color behaviors. Here what has changed:
- The `button-style()` mixin is now the ''single source or truth'' for how Button should look site-wide.
- Button Block, File Block, and Search form Blocks all rely on this one mixin.
- The same styles is also applied to the `<button>` element which appears in widgets, the 404 search form and comments form.
- Improves expected button styles for various conditions and contexts as follows:
- User color palette selections for Buttons are retained regardless of a parent block’s color settings or dark-mode.
- Supports both Default/Filled styles and Outline styles.
- More consistent `:hover` and `:active` styles.
- `:focus` styles are now always visible and legible.
- Adds a `--local-color` color variable to scope color relationships to nested blocks.
- Reduces selectors in `style.css` output.
- 1:1 experience between editor and front end button styles.
- Properly supports Dark-mode.
Props allancole, poena, scruffian, megphillips91.
Fixes#51927.
git-svn-id: https://develop.svn.wordpress.org/trunk@49987 602fd350-edb4-49c9-b593-d223f7449a82
Prevent `get_post_status()` returning `false` for attachments if the parent post has been deleted. The returned attachment post status is now passed through the `get_post_status` filter.
Add tests for `get_post_status()`.
Props peterwilsoncc, timothyblynjacobs for review.
Fixes#52326.
git-svn-id: https://develop.svn.wordpress.org/trunk@49985 602fd350-edb4-49c9-b593-d223f7449a82
This makes the button label more clear and allows for removing unnecessary description.
Props afragen, audrasjb.
Fixes#51774.
git-svn-id: https://develop.svn.wordpress.org/trunk@49984 602fd350-edb4-49c9-b593-d223f7449a82
Related Gutenberg issue: https://github.com/WordPress/gutenberg/pull/28274
With this change it is going to be possible to use the same pattern that wp_style_add_data uses for RTL handling. If the block style file with "-rtl.css" is included in addition to the regular style referenced in "block.json" file then it is going to be automatically registered.
Props swisspidy, aristath.
See #52301.
git-svn-id: https://develop.svn.wordpress.org/trunk@49982 602fd350-edb4-49c9-b593-d223f7449a82