2712 Commits

Author SHA1 Message Date
Peter Wilson
bb6d763e64 Built/Test tools, HTTP API: Refactor test for multiple location headers.
Remove wordpress.org as an external dependency testing `WP_HTTP::handle_redirects()`.

This refactors and reenables an existing test to call the `WP_HTTP::handle_redirects()` method directly with a mocked array of HTTP headers containing multiple location headers.

The test is moved from the external-http group to the http test group as it no longer makes an HTTP request.

Follow up to [54955].

Props SergeyBiryukov, dd32, peterwilsoncc.
Merges [54968] to the 4.9 branch.
Fixes #57306.
See #56793.



git-svn-id: https://develop.svn.wordpress.org/branches/4.9@54986 602fd350-edb4-49c9-b593-d223f7449a82
2022-12-15 04:42:04 +00:00
Sergey Biryukov
1167cf4f38 Grouped backports to the 4.9 branch.
- Posts, Post types: Apply KSES to post-by-email content,
- General: Validate host on "Are you sure?" screen,
- Posts, Post types: Remove emails from post-by-email logs,
- Media: Refactor search by filename within the admin,
- Pings/trackbacks: Apply KSES to all trackbacks,
- Comments: Apply kses when editing comments,
- Customize: Escape blogname option in underscores templates,
- REST API: Lockdown post parameter of the terms endpoint,
- Mail: Reset PHPMailer properties between use,
- Query: Validate relation in `WP_Date_Query`,
- Widgets: Escape RSS error messages for display.

Merges [54521], [54522], [54523], [54524], [54525], [54526], [54527], [54528], [54529], [54530], [54541] to the 4.9 branch.
Props voldemortensen, johnbillion, paulkevan, peterwilsoncc, xknown, dd32, audrasjb, martinkrcho, vortfu, davidbaumwald, tykoted, timothyblynjacobs, johnjamesjacoby, ehtis, matveb, talldanwp.


git-svn-id: https://develop.svn.wordpress.org/branches/4.9@54569 602fd350-edb4-49c9-b593-d223f7449a82
2022-10-17 18:11:47 +00:00
Jonathan Desrosiers
850e928b34 Build/Test Tools: Support NodeJS 14.x in the 4.9 branch.
This updates the 4.9 branch to support the latest LTS version of NodeJS (currently 14.x), allowing the same version to be used across all WordPress branches that receive security updates as a courtesy.

This also replaces the `npm-shrinkwrap.json` with a `package-lock.json` file. Lock files were not supported in earlier versions of NPM, but can now be used.

In addition to backporting the package updates that happened after branching 4.9, dependencies that were removed in future releases have also been updated to their latest versions.

Props desrosj, dd32, netweb, jorbin.
Merges [42460-42461,42463,42887,43320,43323,43977,44219,44233,44728,45321,45765,46404,46408-46409,47404,47867-47869,47872-47873,48705,49636,49933,49937,49939,50017,50126,50176,50185,50192] to the 4.9 branch.
See #52341.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@50202 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-05 04:06:44 +00:00
Sergey Biryukov
8b24b94ede Tests: Skip test_readme() if the HTTP request to secure.php.net or dev.mysql.com failed on timeout.
Move `skipTestOnTimeout()` to `WP_UnitTestCase_Base` to avoid duplication.

Merges [46682] and [46996] to the 4.9 branch.
See #51669.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@50096 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-30 15:14:16 +00:00
Jonathan Desrosiers
faac54e8d0 Build/Test Tools: Backport the local Docker environment to the 4.9 branch.
This commit introduces the Docker-based local WordPress development environment to the 4.9 branch and converts the Travis test jobs to utilize this environment for easier and more consistent testing.

Until existing blockers with the PHP 5.2 Docker container can be solved, the PHP 5.2 test job will remain using the Travis `precise` image.

Merges [45745,45762,45783-45784,45800,45819,45885,46320,46999,47225,47912,48121,49335,49358,49360,49362] to the 4.9 branch.
See #48301, #47767.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@49530 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-06 17:32:00 +00:00
Jonathan Desrosiers
4608a20874 Tests: Fix an incorrect variable name in PDF tests.
This causes a PHP error when running the test suite with PDF rendering supported.

Merges [49523] to the 4.9 branch.
See #50573, #48301.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@49524 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-06 17:03:57 +00:00
Jonathan Desrosiers
961e090404 Media: Improve and fix rotate/flip image tests.
Fix off-by-one error in pixel color checks for rotate and flip image tests. Change to using PNG with single pixel to ensure that errors are caught in the future, rather than lost in JPEG noise.

Props Fuegas, mikeschroder.
Merges [45067] to the 4.9 branch.
See #46073, #48301.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@49519 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-06 16:48:28 +00:00
Jake Spurlock
5cc8ee9838 General: WordPress updates
* XML-RPC: Improve error messages for unprivileged users.
* External Libraries: Disable deserialization in Requests_Utility_FilteredIterator
* Embeds: Disable embeds on deactivated Multisite sites.
* Coding standards: Modify escaping functions to avoid potential false positives.
* XML-RPC: Return error message if attachment ID is incorrect.
* Upgrade/install: Improve logic check when determining installation status.
* Meta: Sanitize meta key before checking protection status.
* Themes: Ensure that only privileged users can set a background image when a theme is using the deprecated custom background page.

Brings the changes from [49380,49382-49388] to the 4.9 branch.

Props xknown, zieladam, peterwilsoncc, whyisjake, desrosj, dd32.


git-svn-id: https://develop.svn.wordpress.org/branches/4.9@49397 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-29 18:52:29 +00:00
Sergey Biryukov
62bccb1619 Tests: Temporarily skip PDF tests if they fail due to ImageMagick permission errors.
Merges [48338], [48341] to the 4.9 branch.

See #50573.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@48487 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-14 21:47:31 +00:00
Jake Spurlock
28a08a15c1 Customize: Add additional filters to Customizer to prevent JSON corruption.
User: Invalidate `user_activation_key` on password update.
Query: Ensure that only a single post can be returned on date/time based queries.
Cache API: Ensure proper escaping around the stats method in the cache API.
Formatting: Expand `sanitize_file_name` to have better support for utf8 characters.

Brings the changes in [47633], [47634], [47635], [47637], and [47638] to the 4.9 branch.

Props: batmoo, ehti, nickdaugherty, peterwilsoncc, sergeybiryukov, sstoqnov, westi, westonruter, whyisjake, whyisjake, xknown.


git-svn-id: https://develop.svn.wordpress.org/branches/4.9@47648 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-29 16:15:39 +00:00
Sergey Biryukov
c089cc014b Build/Test Tools: Remove unused ::assertPostHasTerms() method from tests/term.php.
The associated test was removed in [30241].

Merges [47341] to 3.7+ branches.
See #49485.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@47489 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-22 14:29:03 +00:00
Sergey Biryukov
e90e97b041 Ensure that a user can publish_posts before making a post sticky.
Props: danielbachhuber, whyisjake, peterwilson, xknown.

Brings r46893 to the 4.9 branch.

Update `wp_kses_bad_protocol()` to recognize `:` on uri attributes,

`wp_kses_bad_protocol()` makes sure to validate that uri attributes don’t contain invalid/or not allowed protocols. While this works fine in most cases, there’s a risk that by using the colon html5 named entity, one is able to bypass this function.

Brings r46895 to the 4.9 branch.

Props: xknown, nickdaugherty, peterwilsoncc.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@46918 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-12 18:56:36 +00:00
Jake Spurlock
2a6c470de6 Backporting several bug fixes.
- Query: Remove the static query property.
- HTTP API: Protect against hex interpretation.
- Filesystem API: Prevent directory travelersals when creating new folders.
- Administration: Ensure that admin referer nonce is valid.
- REST API: Send a Vary: Origin header on GET requests.

Backports [46474], [46475], [46476], [46477], [46478], [46483], [46485] to the 5.0 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.9@46493 602fd350-edb4-49c9-b593-d223f7449a82
2019-10-14 18:38:34 +00:00
Jonathan Desrosiers
f78242362b Fix for URL sanitization in wp_kses_bad_protocol_once().
Merges [45997] to the 4.9 branch.

Props irsdl, sstoqnov, whyisjake.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@46005 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-04 18:13:55 +00:00
Sergey Biryukov
4daf6f4603 Improve handling the existing rel attribute in wp_rel_nofollow_callback().
Merges [45990] to the 4.9 branch.
Props xknown, sstoqnov.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@45994 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-04 17:47:09 +00:00
Jake Spurlock
10d96ecee9 Remove _convert_urlencoded_to_entities() from the get_the_content() callback.
Merges [45937] to the 4.9 branch.

Props vortfu, whyisjake, peterwilsoncc


git-svn-id: https://develop.svn.wordpress.org/branches/4.9@45946 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-04 16:34:47 +00:00
Jeremy Felt
ff58a699f0 Media: Improve verification of MIME file types.
Merges [43988] to the 4.9 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43989 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-12 23:02:11 +00:00
Sergey Biryukov
c0c6c7ab09 REST API: Revert [43648] from the 4.9 branch.
This change is out of the 4.9.x scope, and will be reintroduced in 5.0.x.

See #40510.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43715 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-11 07:15:22 +00:00
Sergey Biryukov
ad319d3c85 Taxonomy: Revert [43620] from the 4.9 branch.
This change is out of the 4.9.x scope, and will be reintroduced in 5.0.x.

See #44872.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43711 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-11 04:41:28 +00:00
Sergey Biryukov
faee134538 Privacy: Revert [43614] from the 4.9 branch.
This change is out of the 4.9.x scope, and will be reintroduced in 5.0.x.

See #43985.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43705 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-11 04:03:23 +00:00
Sergey Biryukov
b297a03020 General: PHP 7.3 throws an E_WARNING when using continue to target a switch.
Applying continue to a switch is equivalent to using break and quite possibly, a continue targeting a higher level control structure is actually intended.

To target the higher level control structure, a numeric argument has to be passed to continue. This fixes two cases in WordPress Core where this is currently happening.

See: https://github.com/php/php-src/pull/3364
See: https://wiki.php.net/rfc/continue_on_switch_deprecation

Props jrf.
Merges [43653] to the 4.9 branch.
Fixes #44543.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43656 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-24 20:04:56 +00:00
Sergey Biryukov
dc70d3e266 REST API: Support pagination, order, search and other common query parameters for revisions.
The original REST API revisions controller relied on `wp_get_post_revisions()`, getting all revisions of a post without any possibility to restrict the result. This changeset replaces that function call with a proper `WP_Query` setup, replicating how `wp_get_post_revisions()` works while offering parameters to alter the default behavior.

Props adamsilverstein, birgire, flixos90.
Merges [43584-43586], [43647] to the 4.9 branch.
Fixes #40510.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43648 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-18 03:54:20 +00:00
Sergey Biryukov
c50b216b50 Tests: Improve coverage for REST API term meta registration.
Introduce tests to validate that register_meta and register_term_meta work as expected in WP_REST_Terms_Controller.

Props timmydcrawford.
Merges [43567] to the 4.9 branch.
See #39122.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43646 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-18 03:29:41 +00:00
Sergey Biryukov
e44849ece7 REST API: Pass correct ID to meta->update_value to permit setting term meta during term creation.
Props joehoyle.
Merges [43636] to the 4.9 branch.
Fixes #44834.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43637 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-13 09:52:47 +00:00
Sergey Biryukov
4c6175e800 Tests: Introduce Tests_HTTP_Functions::skipTestOnTimeout(), mirroring the same WP_HTTP_UnitTestCase method.
Merges [43512] to the 4.9 branch.
Fixes #44613.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43626 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-03 21:55:42 +00:00
Sergey Biryukov
9e8090fcee Tests: Use WP_HTTP_UnitTestCase::skipTestOnTimeout() in more HTTP tests.
Adjust it to handle more types of timeouts, e.g. "Resolving timed out", "Connection timed out".

Merges [43511] to the 4.9 branch.
See #44613.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43625 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-03 21:52:48 +00:00
Sergey Biryukov
008a65d98d Taxonomy: Make sure wp_list_categories() correctly outputs term name of 0.
Props joyously, SergeyBiryukov.
Merges [43605] to the 4.9 branch.
Fixes #44872.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43620 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-03 21:23:26 +00:00
Sergey Biryukov
00ab86547f Privacy: Ensure the user request email is sent in the requested user's locale (or the site's default locale if they are not a registered user) when the administrator creating the request uses a different locale.
Props desrosj, Chouby, iandunn, lbenicio, birgire, earnjam, swissspidy, garrett-eclipse.
Merges [43568] to the 4.9 branch.
Fixes #43985.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43614 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-03 21:00:16 +00:00
Sergey Biryukov
90b39a69c8 Tests: Add case for wp_privacy_delete_old_export_files().
Props allendav.
Merges [43292] to the 4.9 branch.
See #43546.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43613 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-03 20:59:10 +00:00
Sergey Biryukov
1da5a8ba76 Tests: Add case for wp_privacy_send_personal_data_export_email().
Props birgire.
Merges [43291] to the 4.9 branch.
See #43546.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43612 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-03 20:58:08 +00:00
Sergey Biryukov
8880871b78 Privacy: Revert [43525].
The commenter cookies checkbox is not legally required, so should be disabled by default.

Merges [43531] to the 4.9 branch.
Fixes #44373.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43532 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-24 17:07:19 +00:00
Sergey Biryukov
f147a718ab REST API: Ensure attachments created with WP_REST_Attachments_Controller::create_item() on Windows have a relative path.
Props ocean90, SergeyBiryukov, redcastor.
Merges [43529] to the 4.9 branch.
Fixes #40861.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43530 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-24 16:53:17 +00:00
Sergey Biryukov
ed6fe25890 Privacy: Remove the setting to enable comment cookies consent added in [43469].
This needs some more work to ensure expected behaviour.

Merges [43525] to the 4.9 branch.
See #44373.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43526 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-24 12:52:29 +00:00
Sergey Biryukov
f1e98d9609 Comments: Ensure that themes overriding default comment_form() fields still display the cookies consent checkbox.
The `comment_form_default_fields` filter can be used to remove the checkbox.

Props pross, SergeyBiryukov.
Merges [43518] to the 4.9 branch.
Fixes #44126.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43524 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-24 12:42:33 +00:00
K. Adam White
343e8d4ea3 REST API: Support meta registration for specific object subtypes.
Introduce an object_subtype argument to the args array for register_meta() which can be used to limit meta registration to a single subtype (e.g. a custom post type or taxonomy, vs all posts or taxonomies).

Introduce register_post_meta() and register_term_meta() wrapper methods for register_meta to provide a convenient interface for the common case of registering meta for a specific taxonomy or post type. These methods work the way plugin developers have often expected register_meta to function, and should be used in place of direct register_meta where possible.

Props flixos90, tharsheblows, spacedmonkey.

Merges [43378] to the 4.9 branch.
Fixes #38323.


git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43510 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-19 18:48:52 +00:00
Sergey Biryukov
9c35dcd477 Privacy: Use the actual Privacy Policy page title in get_the_privacy_policy_link().
Props desrosj, birgire, ianbelanger, Ov3rfly.
Merges [43506] to the 4.9 branch.
Fixes #44192.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43507 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-18 11:51:06 +00:00
Sergey Biryukov
2080421de2 Privacy: Add unit tests for _wp_privacy_send_request_confirmation_notification(), introduced in [43211].
Props birgire, desrosj, garrett-eclipse.
Merges [43499] to the 4.9 branch.
Fixes #43967.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43500 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 23:02:14 +00:00
Sergey Biryukov
9f2e375a48 Taxonomy: Ensure that invalid term objects are discarded in WP_Term_Query.
The `get_term()` mapping may result in term objects that are `null` or
`WP_Error` when plugins use `get_term` or a related filter. Since `null`
and error objects are not valid results for a term query, we discard
them.

Props GM_Alex.
Merges [43049] and [43491] to the 4.9 branch.
Fixes #42691.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43492 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 16:27:12 +00:00
Sergey Biryukov
26d12c9753 REST API: Attachments controller should respect upload limits.
When the REST API is in use on WordPress multisite, the `WP_REST_Attachments_Controller` should respect the "Max upload file size" and "Site upload space" site options.

Props flixos90, danielbachhuber.
Merges [43462] to the 4.9 branch.
Fixes #43751.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43489 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 16:11:48 +00:00
Andrew Ozz
f2783d5e91 Customize: Do not attempt to count uncountable value.
Props dlh.
Merges [43480] to the 4.9 branch.
Fixes #44104.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43481 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 14:39:59 +00:00
Andrew Ozz
98972bf358 Privacy: Fix tests after [43467].
Merges [43471] to the 4.9. branch.
See #44141.


git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43473 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 10:06:12 +00:00
Andrew Ozz
0f75de12c7 Privacy: Don't replace comment author URL and email with anything.
Props TZ-Media, desrosj, birgire.
Merges [43467] to the 4.9 branch.
Fixes #44141.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43468 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 09:03:33 +00:00
Sergey Biryukov
8123e2187a Privacy: Use consistent values for the site name and URL used in notification emails.
The functions `send_confirmation_on_profile_email()`, `_wp_privacy_send_request_confirmation_notification()`, `_wp_privacy_send_erasure_fulfillment_notification()`, and `wp_send_user_request()` all include a title and URL indicating the current site. However, so far they have dealt with those values inconsistently, sometimes using the site values, other times using the network values if in a multisite. This changeset ensures that only the current site is taken into account in all cases and that special characters in the site name are consistently decoded.

Props subrataemfluence, desrosj.
Merges [43388], [43390], and [43435] to the 4.9 branch.
Fixes #44396.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43459 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-16 14:23:26 +00:00
Gary Pendergast
96c83f4400 REST API: Filter responses based on the _fields parameter, before data is processed.
Historically, the REST API would generate the entire response object, including running expensive filters, then it would apply the `_fields` parameter, discarding the fields that weren't specificed.

This change causes `_fields` to be applied earlier, so that only requested fields are processed.

Merges [43087] to the 4.9 branch.

Props danielbachhuber.
See #43874.



git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43445 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-13 06:50:51 +00:00
Gary Pendergast
f364b2fa5c Emoji: Update Twemoji to version 11.0.
🦹

Backport of [43377] to the 4.9 branch.

Props kraftbj,
Fixes #44339.



git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43444 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-13 06:36:23 +00:00
Gary Pendergast
b16c8874f2 REST API: Tweak permission checks for taxonomy and term endpoints
To match behaviour in the Classic Editor, we need to slightly loosen permissions on taxonomy and term endpoints. This allows users to create terms to assign to a post that they're editing.

Merges [43440] to the 4.9 branch.

Props danielbachhuber.
Fixes #44096.



git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43443 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-13 06:28:29 +00:00
Gary Pendergast
c8d1e3f6b8 REST API: Expose revision count and last revision ID on Post response
So that REST API clients can show appropriate UI for a post's revisions, it needs to know how many revisions the post has, and what the latest revision ID is.

Merge of [43439] and [43441] to the 4.9 branch.

Props kadamwhite, danielbachhuber, birgire, TimothyBlynJacobs, pento.
Fixes #44321.



git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43442 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-13 06:13:27 +00:00
Gary Pendergast
f02581f667 REST API: Declare user capabilities using JSON Hyper Schema's "targetSchema".
There are a variety of operations a WordPress user can only perform if they have the correct capabilities. A REST API client should only display UI for one of these operations if the WordPress user can perform the operation.

Rather than requiring REST API clients to calculate whether to display UI based on potentially complicated combinations of user capabilities, `targetSchema` allows us to expose a single flag to show whether the corresponding UI should be displayed.

This change also includes flags on post objects for the following actions:

- `action-publish`: The current user can publish this post.
- `action-sticky`: The current user can make this post sticky, and the post type supports sticking.
- `action-assign-author': The current user can change the author on this post.
- `action-assign-{$taxonomy}`: The current user can assign terms from the "$taxonomy" taxonomy to this post.
- `action-create-{$taxonomy}`: The current user can create terms int the "$taxonomy" taxonomy.

Merges [43437] to the 4.9 branch.

Props TimothyBlynJacobs, danielbachhuber.
Fixes #44287.



git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43438 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-11 09:20:10 +00:00
Andrew Ozz
5ab9fcc659 Privacy: add esc_html to assertion in test_wp_comments_personal_data_exporter.
Props mermel, 1naveengiri.
Merges [43371] to the 4.9 branch.
Fixes #44113.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43372 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-18 16:12:08 +00:00
Sergey Biryukov
c4b31e3816 Community Events Dashboard: Always show a WordCamp if one is coming up.
WordCamps are celebrations of the local WordPress Community and once a local one is scheduled, people in that community should know it is coming. This adjusts the WordPress Events in the dashboard widgets to always display a WordCamp, even if there are multiple Meetups happening first.

Props iandunn, metalandcoffee, warmlaundry, alejandroxlopez, jorbin.
Merges [42726], [42728], and [43356] to the 4.9 branch.
Fixes #41112.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43357 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-16 10:42:16 +00:00