Only add the `notice-` prefix for `error`, `success`, `warning`, `info` CSS classes, keep other classes as is.
Add unit tests for `settings_errors()`.
Props afercia, SergeyBiryukov.
Fixes#44941.
git-svn-id: https://develop.svn.wordpress.org/trunk@45873 602fd350-edb4-49c9-b593-d223f7449a82
Only use the legacy WP timestamp approach (a sum of timestamp and timezone offset) for `timestamp` and `U` formats without the `$gmt` flag.
Otherwise, make sure the function returns correct local time for any format.
Props Rarst, jdgrimes.
Fixes#40653.
git-svn-id: https://develop.svn.wordpress.org/trunk@45856 602fd350-edb4-49c9-b593-d223f7449a82
* `wp_timezone_string()` retrieves the timezone from current settings as a string. Uses the `timezone_string` option to get a proper timezone if available, otherwise falls back to an offset.
* `wp_timezone()` retrieves the timezone from current settings as a `DateTimeZone` object. Timezone can be based on a PHP timezone string or a `±HH:MM` offset.
Props Rarst, remcotolsma, johnjamesjacoby, rmccue.
Fixes#24730.
git-svn-id: https://develop.svn.wordpress.org/trunk@45853 602fd350-edb4-49c9-b593-d223f7449a82
Previously the sites were truncated which meant longer names but with ending identifications were unable to be seen as different. This shows the full site name to allow easier understanding.
Props tferry, melinedo, afercia, jeremyfelt
Fixes: 47112
git-svn-id: https://develop.svn.wordpress.org/trunk@45826 602fd350-edb4-49c9-b593-d223f7449a82
Account for these new values in `settings_errors()`, resulting in `notice-warning` and `notice-info` CSS classes.
Map legacy `error` and `updated` CSS classes to `notice-error` and `notice-success`.
Props donmhico, toddhalfpenny, flixos90, desrosj, javorszky, SergeyBiryukov.
Fixes#44640, #44941.
git-svn-id: https://develop.svn.wordpress.org/trunk@45814 602fd350-edb4-49c9-b593-d223f7449a82
Prevents a non-sequential post type array such as [ 0 => 'post', 2 => 'page' ] from being improperly converted to an object in the taxonomy endpoint's response JSON.
Props TimothyBlynJacobs, birgire, spectacula.
Fixes#42209.
git-svn-id: https://develop.svn.wordpress.org/trunk@45813 602fd350-edb4-49c9-b593-d223f7449a82
Allowing the client to delete revisions breaks the "audit trail" functionality. This is not allowed in WordPress and shouldn't be allowed through the API.
While not recommended, a plugin may opt-in to the previous behavior by setting a custom 'delete_post' capability for the revisions post type.
Props dlh, danielbachhuber, TimothyBlynJacobs, azaozz, kadamwhite.
Fixes#43709.
git-svn-id: https://develop.svn.wordpress.org/trunk@45812 602fd350-edb4-49c9-b593-d223f7449a82
Caches the output of get_item_schema() to avoid redundant recomputation of translatable strings and other computed values. This method is called many times per item in each REST request, and the results of the method should not vary between calls.
Additional schema fields are not cached.
Props kadamwhite, joehoyle, TimothyBlynJacobs.
Fixes#47871.
git-svn-id: https://develop.svn.wordpress.org/trunk@45811 602fd350-edb4-49c9-b593-d223f7449a82
Update doc block argument definitions to clarify that the REST API always passes an array to the `get_callback` and always passes an entity object to the `update_callback`.
Props TimothyBlynJacobs, salzano.
Fixes#44432.
git-svn-id: https://develop.svn.wordpress.org/trunk@45810 602fd350-edb4-49c9-b593-d223f7449a82
Status code 204 should indicate no response body is sent. Previously, a "null" string was sent, which MacOS Safari would try to parse as JSON and thereby fail to complete the request.
Props TimothyBlynJacobs, andizer, matthias.thiel.
Fixes#43691.
git-svn-id: https://develop.svn.wordpress.org/trunk@45809 602fd350-edb4-49c9-b593-d223f7449a82
Extends meta registration to support complex schema values, mirroring the functionality in the settings controller.
Error when trying to modify a meta key containing schema-nonconformant data.
Props @TimothyBlynJacobs, @birgire, @mnelson4, @flixos90.
Fixes#43392.
git-svn-id: https://develop.svn.wordpress.org/trunk@45807 602fd350-edb4-49c9-b593-d223f7449a82
The current user cannot be deleted, so the check is redundant in that context and should only be done for other users.
Props mt8.biz, SergeyBiryukov.
Fixes#47851.
git-svn-id: https://develop.svn.wordpress.org/trunk@45806 602fd350-edb4-49c9-b593-d223f7449a82
Most sites will be unaffected by this change, but those with a large number of rows in `wp_options`, only a small number of which have `autoload` set, will see a significant performance improvement.
Sites with a large number of rows in `wp_options`, with many of them having `autoload` set will unfortunately see a performance penalty on top of the already very slow queries they're running, but this should be the minority of cases.
Props DanBUK.
Fixes#24044.
git-svn-id: https://develop.svn.wordpress.org/trunk@45805 602fd350-edb4-49c9-b593-d223f7449a82
Introduces `WP_Site_Health::has_late_cron()` for late wp-cron jobs and extends the time allowance before a job is considered missed.
In a standard configuration using loopback requests, a job is considered late once past due and missed over five minutes past due.
Late and missed time frames are extended if `DISABLE_WP_CRON` is defined as `true` to allow for crontab tasks running less frequently. A job is considered late once it's 15 minutes past due and missed over one hour past due.
A file for site health unit tests has been introduced with tests for cron in critical, late and missed states.
Props rockfire, afragen, peterwilsoncc.
Fixes#47223.
git-svn-id: https://develop.svn.wordpress.org/trunk@45801 602fd350-edb4-49c9-b593-d223f7449a82
In `switch_to_blog()`:
* Rename `$blog_id` to `$prev_blog_id` for clarity.
* Rename `$new_blog` to `$new_blog_id` for consistency.
* Pass `$prev_blog_id` as a second parameter to `switch_blog` action, instead of the duplicated `$new_blog_id`. This only clarifies documentation and does not affect functionality, since the values are equal in the context where the DocBlock is located.
In `restore_current_blog()`:
* Rename `$blog` to `$new_blog_id` for clarity.
* Rename `$blog_id` to `$prev_blog_id` for clarity.
Props ChriCo, jeremyfelt, SergeyBiryukov.
Fixes#45594.
git-svn-id: https://develop.svn.wordpress.org/trunk@45794 602fd350-edb4-49c9-b593-d223f7449a82
Add a key handler on the comment form that detects the cmd/ctrl-enter key press and submits the comment form.
Props xyfi, Lindstromer, helen, splitti.
Fixes#41545.
git-svn-id: https://develop.svn.wordpress.org/trunk@45790 602fd350-edb4-49c9-b593-d223f7449a82
- Add the `admin_email_lifespan` option when installing. Fixes a bug where the verification screen is shown right after installation.
- Reset the same option when upgrading and the user doing the DB upgrade is not an admin. This will ensure the email verification is shown next time an admin logs in.
- Use `site_url()` instead of `network_site_url()` for the form action. The latter seems needed only for password reset.
See #46349.
git-svn-id: https://develop.svn.wordpress.org/trunk@45788 602fd350-edb4-49c9-b593-d223f7449a82
Include the post's permalink when generating reply links in `get_comment_reply_link()` to account for comments displayed on index and archive pages.
This reapplies [32786] which was inadvertently reverted in [42360].
Props justinahinon, donmhico.
See #33383.
Fixes#47174.
git-svn-id: https://develop.svn.wordpress.org/trunk@45787 602fd350-edb4-49c9-b593-d223f7449a82
The existing placeholder can make the user think that they must use http. We should encourage the use of https.
Also, the block editor uses https for its placeholders. Let's add some consistency.
Props Chaton666, audrasjb, mukesh27.
Fixes#46320.
git-svn-id: https://develop.svn.wordpress.org/trunk@45777 602fd350-edb4-49c9-b593-d223f7449a82
Corresponds to the `self_link()` template function.
This matches other feed template functions, using one function to get the value, and a different function to echo it.
Props jojotjebaby, mobeen-abdullah, donmhico, audrasjb, dshanske.
Fixes#44838.
git-svn-id: https://develop.svn.wordpress.org/trunk@45772 602fd350-edb4-49c9-b593-d223f7449a82
This upgrade adds support for the transgender flag: 🏳️⚧️
There's some additional housekeeping in this commit:
- Twemoji recently rearranged their repository and package, so `Gruntfile.js` needed tweaking to allow for that.
- As only new files were added in this Twemoji release, the CDN version didn't need updating.
Fixes#47852.
git-svn-id: https://develop.svn.wordpress.org/trunk@45769 602fd350-edb4-49c9-b593-d223f7449a82
The attributes are added via `TwentyNineteen_SVG_Icons::get_svg()`, there's no need to have them separately in SVG sources.
Props mukesh27, albertomake.
Fixes#47128.
git-svn-id: https://develop.svn.wordpress.org/trunk@45760 602fd350-edb4-49c9-b593-d223f7449a82
This brings consistency with the other instances where the file is included, and allows for reusing its functions in custom code.
Props engelen, desrosj.
Fixes#38874.
git-svn-id: https://develop.svn.wordpress.org/trunk@45751 602fd350-edb4-49c9-b593-d223f7449a82
PHP used to allow both square brackets and curly braces to be used interchangeably for accessing array elements and string offsets. The curly bracket syntax is only allowed in a limited set of cases and can be confusing for people not used to it.
PHP 7.4 will deprecate the curly brace syntax for accessing array elements and string offsets and it is expected that support will be completely removed in PHP 8.0.
Ref: https://wiki.php.net/rfc/deprecate_curly_braces_array_access
See #47751.
Props jrf.
git-svn-id: https://develop.svn.wordpress.org/trunk@45730 602fd350-edb4-49c9-b593-d223f7449a82
Color alone is not sufficient to visually communicate differences.
- adds `plus` and `minus` icons to the changed lines
- adds visually hidden text: `Added`, `Deleted`, and `Unchanged` to clarify the differences to assistive technologies users
Props birgire, audrasjb, kjellr, adamsilverstein.
Fixes#43532.
git-svn-id: https://develop.svn.wordpress.org/trunk@45729 602fd350-edb4-49c9-b593-d223f7449a82
- removes the `Powered by WordPress, state-of-the-art semantic personal publishing platform.` title attribute
- removes the title attribute from the abbreviations: contrary to a common belief, title attributes on abbreviations are only available to a minority of users, see https://developer.paciellogroup.com/blog/2019/03/short-note-the-abbreviation-appreciation-society/
- changes the term `RSS` to `feed`, as `RSS` is a technical term not all users are supposed to be familiar with
- improves the `widget_meta_poweredby` filter documentation
Props nishitlangaliya, chetan200891, audrasjb.
See #46980, #24766.
Fixes#46978.
git-svn-id: https://develop.svn.wordpress.org/trunk@45728 602fd350-edb4-49c9-b593-d223f7449a82
When adding a Custom Link and leaving the "Link Text" field empty, WordPress used to set a default fallback text: "Menu Item".
The changes in [36379] broke this behavior making the fallback text: ` (Pending)`, with a leading space.
Pending major refactoring of the Menus page (which is going to use a block-based user interface) this change just restores the original behavior by adding the fallback text to the related AJAX response.
Props christophherr, Fencer04, thakkarhardik, backermann1978, audrasjb.
Fixes#38415.
git-svn-id: https://develop.svn.wordpress.org/trunk@45727 602fd350-edb4-49c9-b593-d223f7449a82