Commit Graph

42806 Commits

Author SHA1 Message Date
Timothy Jacobs d56906f5b0 REST API: Support a broader range of JSON media types.
Previously, we only supported `application/json` which prevented using subtypes like `application/activity+json`. This allows for the REST API to `json_decode` the body of requests using a JSON subtype `Content-Type`. Additionally, `wp_die()` now properly sends the error as JSON when a JSON subtype is specified in the `Accept` header.

Props pfefferle.
Fixes #49404.


git-svn-id: https://develop.svn.wordpress.org/trunk@49329 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-27 16:42:38 +00:00
Sergey Biryukov fce8f2bf4d Posts, Post Types: Check if taxonomy is set for the `tax_input` parameter of `wp_insert_post()`.
This avoids a PHP notice when creating a post with multiple taxonomies both having a default term.

Props yakimun, szaqal21, hareesh-pillai, audrasjb.
Fixes #51320.

git-svn-id: https://develop.svn.wordpress.org/trunk@49328 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-27 16:40:35 +00:00
Sergey Biryukov 986becfd4d Tests: Rename some files and classes in `phpunit/tests/post/` per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [47780].

See #51344.

git-svn-id: https://develop.svn.wordpress.org/trunk@49327 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-27 16:07:21 +00:00
Sergey Biryukov 548d03026b Docs: Fix typo in `{$old_status}_to_{$new_status}` hook description.
See #50768.

git-svn-id: https://develop.svn.wordpress.org/trunk@49326 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-27 15:40:21 +00:00
Andrew Ozz 1a0a55df8c Revert the improvenents to arranging of postboxes/metaboxes, [49179]. The current patch fixes about half a dozen problems, but seems more general improvements are needed to how Screen Options work.
See #50699.

git-svn-id: https://develop.svn.wordpress.org/trunk@49325 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-27 10:45:36 +00:00
Riad Benguella dda3adec97 Block Editor: Update the WordPress packages for 5.6 beta 2
It contains:

- Fix drop zone indicators for non blocks.
- Fix archives block render function.
- Code block: preserve indentation on paste.
- Turn off autocomplete for token input. 
- Fix parent post selector: ensure initial value available, search performed, all results shown. 
- Fix gallery block undo issue.

Props isabel_brison.
Fixes #51640.


git-svn-id: https://develop.svn.wordpress.org/trunk@49324 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-27 09:32:50 +00:00
Sergey Biryukov 89e10133e3 Customize: Ensure the New Menu section is properly rendered.
Follow-up to [30102], [49101].

Props david.binda, boldgrid, dlh, azaozz, Clorith, westonruter, hellofromTonya.
Fixes #51592.

git-svn-id: https://develop.svn.wordpress.org/trunk@49323 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-27 02:46:27 +00:00
Sergey Biryukov fff225ed0b Bundled Themes: Update latest version for `Tested up to:` in `readme.txt` files.
Props mukesh27.
Fixes #51501.

git-svn-id: https://develop.svn.wordpress.org/trunk@49322 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-27 02:16:22 +00:00
Sergey Biryukov a23dcec496 Docs: Add a `@global` tag for `$user_id` in `WP_Application_Passwords_List_Table::prepare_items()`.
Props mukesh27.
Fixes #51633.

git-svn-id: https://develop.svn.wordpress.org/trunk@49321 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-27 02:10:12 +00:00
Jonathan Desrosiers 952860aa13 Twenty Twenty-One: Import the latest changes for 5.6 beta 2.
For a full list of changes since beta 1, see 9e34dca...e580895.

Props poena, melchoyce, luminuu, aristath, justinahinon, jffng, ryelle, kishanjasani, rolfsiebers.
See #51526.

git-svn-id: https://develop.svn.wordpress.org/trunk@49320 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-27 01:58:37 +00:00
Helen Hou-Sandi 9745a84ce8 Administration: Accommodate long translations for "Posts" in list table headers.
This stems from longer translations on the User table, but this will apply to any posts column in a list table. Hyphenation should typically just apply to the column header, as the cell contents are just a count.

This does appear to have some browser inconsistencies, so may need further adjustment in the future.

Props audrasjb, justinahinon.
Fixes #50838.


git-svn-id: https://develop.svn.wordpress.org/trunk@49317 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-26 23:14:06 +00:00
Peter Wilson db2a1ba75d Taxonomy: Fix values passed to actions in `wp_modify_term_count_by_now()`.
Replace the `WP_Taxonomy` object with the taxonomy slug in the values passed to the actions `edit_term_taxonomy` and `edited_term_taxonomy` within `wp_modify_term_count_by_now()`.

Follow up to [49141], [49171].
Props Chouby, lcyh78.
Fixes #40351.



git-svn-id: https://develop.svn.wordpress.org/trunk@49316 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-26 23:05:22 +00:00
Sergey Biryukov f108962185 Docs: Correct description for `wp_pre_insert_user_data` filter.
Props audrasjb.
Fixes #51637.

git-svn-id: https://develop.svn.wordpress.org/trunk@49314 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-26 22:51:51 +00:00
Sergey Biryukov 430320e905 Docs: Correct DocBlock formatting for `render_block()`.
Follow-up to [49310].

See #51606.

git-svn-id: https://develop.svn.wordpress.org/trunk@49312 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-26 21:53:43 +00:00
Sergey Biryukov f09b69c410 Docs: Add missing `@since` tags for properties in some block editor classes:
* `WP_Block_Pattern_Categories_Registry`
* `WP_Block_Patterns_Registry`
* `WP_Block_Supports`

Follow-up to [48156], [49226].

See #50768.

git-svn-id: https://develop.svn.wordpress.org/trunk@49311 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-26 21:49:26 +00:00
Riad Benguella 7be4701404 Block Editor: Fix WP_Block_Supports class compatibility with Gutenberg-provided class.
When using WordPress trunk with Gutenberg master, there's an incompatibility causing 
the dynamic block generated classes to be omitted.
This commit refactors the block supports to fix that problem.

Props nosolosw.
Fixes #51606.


git-svn-id: https://develop.svn.wordpress.org/trunk@49310 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-26 08:29:04 +00:00
Sergey Biryukov f13776cd8d General: Use correct value for the `speak` property in various CSS files.
Follow-up to [49263].

Props hareesh-pillai.
Fixes #51622.

git-svn-id: https://develop.svn.wordpress.org/trunk@49309 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-26 02:23:24 +00:00
Timothy Jacobs 3646dd2e9f REST API: Prevent PHP warning when metadata schema is missing properties.
This switches to the new `rest_default_additional_properties_to_false()` function which doesn't have this issue and deprecates the `WP_REST_Meta_Fields::default_additional_properties_to_false()` method.

Props austin880625.
Fixes #51389.


git-svn-id: https://develop.svn.wordpress.org/trunk@49308 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-25 20:28:50 +00:00
Timothy Jacobs 9eed4bc352 Build Tools: Fix running installing composer dependencies using composer 2.0.
This updates the `dealerdirect/phpcodesniffer-composer-installer` package to allow installing version `0.7.0` which supports composer 2.0.

Props itowhid06, jrf.
Fixes #51624.


git-svn-id: https://develop.svn.wordpress.org/trunk@49306 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-25 01:12:13 +00:00
Sergey Biryukov 111ebad65e Tests: Correct newly introduced `@covers` tags.
When global functions are covered, they need to be prefixed with `::` (double colon) to distinguish them from class name.

See https://phpunit.readthedocs.io/en/7.0/annotations.html#covers for more details.

Follow-up to [49000], [49171].

Props jrf.
See #39265.

git-svn-id: https://develop.svn.wordpress.org/trunk@49305 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-25 00:31:12 +00:00
Sergey Biryukov 715bfc8664 Docs: Correct an example in `wp_kses_normalize_entities()` description.
Props ediamin.
Fixes #51620.

git-svn-id: https://develop.svn.wordpress.org/trunk@49304 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-25 00:12:40 +00:00
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