Commit Graph

42735 Commits

Author SHA1 Message Date
Timothy Jacobs
1e030c4062 REST API, XML-RPC: Synchronise empty comment content checks.
The REST API and XML-RPC now uses the same detection methodology for empty comment content as `wp_handle_comment_submission()`. Specifically, comments now have their content trimmed and '0' is allowed.

Props jaswrks, rmccue, dd32, rachelbaker, Cawa-93, aduth, TimothyBlynJacobs.
Fixes #43177.


git-svn-id: https://develop.svn.wordpress.org/trunk@49303 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-24 22:44:38 +00:00
Timothy Jacobs
e66f459435 REST API: Don't validate status if it hasn't changed.
In particular, this allows for sending `status=inherit` to an attachment if it's current status is `inherit`. This status would be rejected because it is an "internal" post status which isn't exposed.

As a general rule, a developer should always be able to PUT back a GET response without error.

Props dfenton, pputzer, TimothyBlynJacobs.
Fixes #40399.



git-svn-id: https://develop.svn.wordpress.org/trunk@49302 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-24 16:02:34 +00:00
Timothy Jacobs
ff989eccce REST API: Make template handling resilient against plugins setting the global post.
Plugins shouldn't be setting the global post object during a REST API request, but if they did this could cause unexpected errors when creating a post with a template.

Props Kipperlenny, TimothyBlynJacobs.
Fixes #49695.


git-svn-id: https://develop.svn.wordpress.org/trunk@49301 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-24 14:10:26 +00:00
Timothy Jacobs
84e533ab9d REST API: Reuse namespace property instead of the undeclared rest_namespace.
Props itowhid06.
Fixes #48297.


git-svn-id: https://develop.svn.wordpress.org/trunk@49300 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-24 13:52:22 +00:00
Timothy Jacobs
b8cdf1be50 REST API: Support generating comment up links to custom posts controllers.
The comments controller now uses the `rest_get_route_for_post` function introduced in WordPress 5.5 to generate the link. This function is filterable to allow for custom controllers to properly define their REST API route.

Props dsifford, TimothyBlynJacobs.
Fixes #44152.


git-svn-id: https://develop.svn.wordpress.org/trunk@49299 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-24 13:18:50 +00:00
Sergey Biryukov
9cf46a7348 Coding Standards: Remove unused $current_role variable from Add New User form.
Follow-up to [9614], [28296].

Props ravipatel.
Fixes #51619.

git-svn-id: https://develop.svn.wordpress.org/trunk@49298 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-24 12:47:50 +00:00
Sergey Biryukov
4a3a7bd041 Coding Standards: Use consistent formatting for <div class="wrap"> sections in wp-admin/update-core.php.
Follow-up to [28500], [28530].

Props ravipatel.
Fixes #51618.

git-svn-id: https://develop.svn.wordpress.org/trunk@49297 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-24 12:31:07 +00:00
Timothy Jacobs
4e0222d529 REST API: Regenerate wp-api-generated.js after [49276].
See #51583.


git-svn-id: https://develop.svn.wordpress.org/trunk@49296 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-24 04:26:46 +00:00
Timothy Jacobs
6722f3aefb REST API: Deprecate WP_REST_Meta_Fields::register_field().
This method never worked properly and cannot be fixed due to incompatible method signatures.

Props flixos90, kadamwhite, jnylen0, TimothyBlynJacobs.
Fixes #39959.


git-svn-id: https://develop.svn.wordpress.org/trunk@49295 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-24 04:25:22 +00:00
Timothy Jacobs
5e31ccfee2 App Passwords: Improve accessibility.
- Make form inputs stacked instead of inline.
- Provide a visible label for the app name.
- Add screen reader text to dismiss button.
- Make "Revoke" button label more descriptive.
- Use aria-disabled instead of disabled to avoid focus loss.
- Display password in a readonly input to assist copy and paste.
- Remove large sections of italic text.
- Use `.form-wrap` and `.form-field` to give consistent form styling.
- Improve labeling and placeholder text.

Props alexstine, georgestephanis, afercia, TimothyBlynJacobs.
Fixes #51580.


git-svn-id: https://develop.svn.wordpress.org/trunk@49294 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-24 03:32:46 +00:00
SergeyBiryukov
99b40eed6a Docs: Add missing duplicate hook references for allow_(dev|minor|major)_auto_core_updates filters.
Follow-up to [49254].

See #50907.

git-svn-id: https://develop.svn.wordpress.org/trunk@49293 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-24 00:29:01 +00:00
Sergey Biryukov
d92d1bb863 Upgrade/Install: Account for new WP_AUTO_UPDATE_CORE values in auto-updates settings form.
This updates `core_auto_updates_settings()` to account for the new `beta` and `rc` values for the `WP_AUTO_UPDATE_CORE` constant.

Additionally, recognize these new values as acceptable in Site Health tests.

Follow-up to [48804], [49245], [49254].

Fixes #51319. See #50907.

git-svn-id: https://develop.svn.wordpress.org/trunk@49292 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-24 00:24:43 +00:00
Timothy Jacobs
1e85024fb4 App Passwords: Include site_url in the success redirect payload.
Props georgestephanis.
Fixes #51602.


git-svn-id: https://develop.svn.wordpress.org/trunk@49291 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-24 00:05:15 +00:00
Sergey Biryukov
262e16b169 Toolbar: Keep IE 11 scrollbar on the side instead of overlapping the toolbar.
Props sabernhardt, shital-patel, y_kolev.
Fixes #48545.

git-svn-id: https://develop.svn.wordpress.org/trunk@49290 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-23 19:47:53 +00:00
Sergey Biryukov
c7cd21f153 Privacy: Use more appropriate verbiage when downloading personal data export file from a row action.
Props garrett-eclipse, bridgetwillard.
Fixes #49319.

git-svn-id: https://develop.svn.wordpress.org/trunk@49289 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-23 19:32:01 +00:00
Sergey Biryukov
f586f9d799 Posts, Post Types: Set better default title for custom post types without title support.
The default title is now set to "(no title supported)" instead of "Auto Draft".

Props garrett-eclipse, rajanit2000, bridgetwillard, donmhico, nrqsnchz.
Fixes #45516.

git-svn-id: https://develop.svn.wordpress.org/trunk@49288 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-23 19:07:09 +00:00
Sergey Biryukov
0634a2370d Help/About: Clarify that discouraging search engines does not prevent them from crawling the site.
Props carike, garrett-eclipse, hellofromTonya.
Fixes #51274.

git-svn-id: https://develop.svn.wordpress.org/trunk@49287 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-23 18:05:52 +00:00
Sergey Biryukov
bcc26de235 Coding Standards: Split long printf() calls for search results for better readability.
Follow-up to [49284].

See #37353.

git-svn-id: https://develop.svn.wordpress.org/trunk@49286 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-23 17:17:52 +00:00
Aaron D. Campbell
797e2bf9ff Upgrade/Install: Improve copy for opt-in to automatic major version updates.
Props marybaum, kebbet.
See #50907.


git-svn-id: https://develop.svn.wordpress.org/trunk@49285 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-23 16:34:43 +00:00
Helen Hou-Sandi
e515d61ec0 Administration: Unify search results message on list tables.
This wraps the search string in a `<strong>` tag, which makes easier to parse visually especially when your search string also contains double quotes.

Props Mista-Flo, mapk, sergeybiryukov.
Fixes #37353.


git-svn-id: https://develop.svn.wordpress.org/trunk@49284 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-23 15:59:34 +00:00
Helen Hou-Sandi
ebe858e5a7 Administration: Better targeting for required form field highlighting.
Previously, any `input` or `select` inside of a `.form-invalid` wrapper would get the red border highlighting, including submit buttons which was not visually correct. This now only applies to form elements with a class of `.form-required` inside of the `.form-invalid` wrapper. It also continues to apply the border to elements with both classes (`.form-invalid.form-required`) as that is how some of the admin markup is structured.

Plugin authors may need to do the same sort of class application seen in this commit, i.e. add `.form-required` to certain form elements.

Props sabernhardt, dilipbheda, helen.
Fixes #50686.


git-svn-id: https://develop.svn.wordpress.org/trunk@49283 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-23 15:03:37 +00:00
Sergey Biryukov
a1403240bb Coding Standards: Update some alignment in wp-admin/authorize-application.php for consistency.
Save blogs count to a variable for reusing.

Follow-up to [49270].

See #51489.

git-svn-id: https://develop.svn.wordpress.org/trunk@49282 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-23 01:17:22 +00:00
Sergey Biryukov
2252cdaa8d Docs: Document the return value of wp_prepare_attachment_for_js() using hash notation.
Props stevenlinx, Mista-Flo, johnbillion.
Fixes #50835.

git-svn-id: https://develop.svn.wordpress.org/trunk@49281 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-23 00:41:15 +00:00
Jonathan Desrosiers
6ec4cc3468 Build/Test Tools: Remove debug text included in [49267].
See #50401.

git-svn-id: https://develop.svn.wordpress.org/trunk@49280 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-22 17:53:47 +00:00
Timothy Jacobs
fe2053f2c1 App Passwords: Support an app_id to uniquely identify instances of an app.
Apps may now optionally include an `app_id` parameter when directing the user to the Authorize Application screen. This allows for instances of an application to be identified and potentially revoked or blocked.

Props TimothyBlynJacobs, georgestephanis.
Fixes #51583.


git-svn-id: https://develop.svn.wordpress.org/trunk@49276 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-22 15:04:23 +00:00
Sergey Biryukov
e4fadc6f4d Upgrade/Install: Add missing </form> tag in auto-updates settings form.
Props imath, ahortin, dd32, afragen.
Fixes #51598. See #50907.

git-svn-id: https://develop.svn.wordpress.org/trunk@49274 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-22 03:36:40 +00:00
Timothy Jacobs
4e58365c5c App Passwords: Fix success=false not being appended to fallback reject url.
Props TimothyBlynJacobs, georgestephanis.
Fixes #51581.


git-svn-id: https://develop.svn.wordpress.org/trunk@49272 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-22 02:41:33 +00:00
Peter Wilson
9aececb374 XML-RPC: Fix length validation of anonymous commenter's email address.
Fix the first step of validating an anonymous commenters in which the length is checked prior to running regular expressions.

Follow up to [47808].
Fixes #51595.



git-svn-id: https://develop.svn.wordpress.org/trunk@49271 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-22 02:40:06 +00:00
Timothy Jacobs
4143182d6b App Passwords: Explain that apps can access to all sites in a network.
Props georgestephanis, spacedmonkey, johnjamesjacoby, SergeyBiryukov, marybaum.
Fixes #51489.


git-svn-id: https://develop.svn.wordpress.org/trunk@49270 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-22 02:34:16 +00:00
Sergey Biryukov
cfbb2294f9 Build/Test Tools: Only define WP_PLUGIN_DIR in when running core tests.
This takes into account non-core plugins that rely on `WP_PLUGIN_DIR` being set to the expected plugin's directory in `WP_CONTENT_DIR`, or already have the constant defined.

Follow-up to [49236].

Props pierlo.
Fixes #51594.

git-svn-id: https://develop.svn.wordpress.org/trunk@49269 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-22 00:42:51 +00:00
Peter Wilson
5b5eba1b54 Tests: Use shared fixtures in XML-RPC new comment unit tests.
See #51344.



git-svn-id: https://develop.svn.wordpress.org/trunk@49268 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-22 00:17:10 +00:00
Jonathan Desrosiers
91b5e5255e Build/Test Tools: Pass GitHub Action related environment variables to the Docker container.
This ensures that `WP_UnitTestCase::skipOnAutomatedBranches()` has access to these variables so that time sensitive tests can be skipped when appropriate.

This also updates that logic to be more clear.

Follow up to [49264].

Props ocean90, johnbillion.
See #50401, #49050, #47767.

git-svn-id: https://develop.svn.wordpress.org/trunk@49267 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-21 19:55:17 +00:00
Sergey Biryukov
530493396b Docs: Add a @since note about async_direct_test key to the site_status_tests filter.
Follow-up to [49232].

See #51547.

git-svn-id: https://develop.svn.wordpress.org/trunk@49266 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-21 14:53:17 +00:00
Sergey Biryukov
325ba4b811 Coding Standards: Rename a variable in wp-login.php for consistency with other instances.
See #50767.

git-svn-id: https://develop.svn.wordpress.org/trunk@49265 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-21 14:44:58 +00:00
Jonathan Desrosiers
87ff38532d Build/Test Tools: Skip some tests when not in the primary branch.
This skips time sensitive tests when GitHub Actions workflows are not being run on `master` branch.

See #50401, #39486.

git-svn-id: https://develop.svn.wordpress.org/trunk@49264 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-21 14:05:39 +00:00
Jonathan Desrosiers
9648a29c05 Administration: Fix an invalid property in the Dashicons CSS file.
Props komagain.
Fixes #51587.

git-svn-id: https://develop.svn.wordpress.org/trunk@49263 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-21 13:14:17 +00:00
Helen Hou-Sandi
fb28c15e3c Post-post WordPress 5.6 beta 1 version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@49262 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-20 22:21:42 +00:00
Helen Hou-Sandi
1bcf3edd59 Post-WordPress 5.6 Beta 1 version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@49261 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-20 22:17:28 +00:00
Helen Hou-Sandi
24705a129e WordPress 5.6 Beta 1.
git-svn-id: https://develop.svn.wordpress.org/trunk@49260 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-20 21:45:21 +00:00
Sergey Biryukov
a1663ce580 Coding Standards: Fix WPCS issues in [49258].
See #46619.

git-svn-id: https://develop.svn.wordpress.org/trunk@49259 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-20 21:18:59 +00:00
Helen Hou-Sandi
0d2249cc21 Privacy: Add "Mark as completed" action.
Props garrett-eclipse, ocean90, joostdevalk, mista-flo, helen.
Fixes #46619.


git-svn-id: https://develop.svn.wordpress.org/trunk@49258 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-20 21:05:34 +00:00
Timothy Jacobs
18c1ab8e89 REST API: Make sure all supported JSON Schema keywords are output in the index.
Previously, only a small subset of keywords were exposed which limited the utility of `OPTIONS` requests.

Props raubvogel, TimothyBlynJacobs.
Fixes #51020.


git-svn-id: https://develop.svn.wordpress.org/trunk@49257 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-20 20:17:20 +00:00
Sergey Biryukov
fdcff8b475 Comments: Add a filter for top level comments query arguments in comments_template().
Props hellofromTonya, Howdy_McGee, garrett-eclipse, davidbaumwald, thomaslhotta.
Fixes #38074.

git-svn-id: https://develop.svn.wordpress.org/trunk@49256 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-20 20:09:39 +00:00
Helen Hou-Sandi
27e7c718f6 Privacy: Add requester IP to password reset emails.
Props garrett-eclipse, bridgetwillard, isharis, ocean90.
Fixes #43856.


git-svn-id: https://develop.svn.wordpress.org/trunk@49255 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-20 20:01:04 +00:00
Helen Hou-Sandi
0e0781edc0 Upgrade/Install: Add UI for opting in to core auto-updates for major versions.
Props audrasjb, karmatosed, aaroncampbell, paaljoachim, davidbaumwald.
Fixes #50907.


git-svn-id: https://develop.svn.wordpress.org/trunk@49254 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-20 19:33:27 +00:00
Helen Hou-Sandi
29394d8a25 Upgrade/Install: Don't show theme update prompts on subsites.
If you are using `wp_prepare_themes_for_js()` and relying on `updates`/`no_updates` in multisite, you will need to filter that data back in using the `wp_prepare_themes_for_js` hook.

Props pbiron, afragen.
Fixes #49831.


git-svn-id: https://develop.svn.wordpress.org/trunk@49253 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-20 19:12:54 +00:00
Timothy Jacobs
9defd1fabc REST API: Introduce support for batching API requests.
A new route is introduced, `batch/v1`, that accepts a list of API requests to run. Each request runs in sequence, and the responses are returned in the order they've been received.

Optionally, the `require-all-validate` validation mode can be used to first validate each request's parameters and only proceed with processing if each request validates successfully.

By default, the batch size is limited to 25 requests. This can be controlled using the `rest_get_max_batch_size` filter. Clients are strongly encouraged to discover the maximum batch size supported by the server by making an OPTIONS request to the `batch/v1` endpoint and inspecting the described arguments.

Additionally, the two new methods, `match_request_to_handler` and `respond_to_request` introduced in [48947] now have a `protected` visibility as we don't want to expose the inner workings of the `WP_REST_Server::dispatch` API.

Batching is not currently supported for GET requests.

Fixes #50244.
Props andraganescu, zieladam, TimothyBlynJacobs.


git-svn-id: https://develop.svn.wordpress.org/trunk@49252 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-20 19:08:48 +00:00
Adam Silverstein
bf73097310 Coding Standards: Fix WPCS issues in [49248].
See #42852.


git-svn-id: https://develop.svn.wordpress.org/trunk@49251 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-20 19:05:51 +00:00
Jonathan Desrosiers
197067c477 Twenty Twenty: Use jshint exclude statements instead of eslint.
Also, exclude the `node_modules` folder within `twentytwentyone`.

See #51526.

git-svn-id: https://develop.svn.wordpress.org/trunk@49250 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-20 18:32:03 +00:00
Sergey Biryukov
ad2830f903 Coding Standards: Fix WPCS issues in [49242].
See #50774.

git-svn-id: https://develop.svn.wordpress.org/trunk@49249 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-20 18:29:26 +00:00