Allow low-privileged users to use the ARIA attributes `aria-describedby`, `aria-details`, `aria-label`, `aria-labelledby` and `aria-hidden`.
Props mattheu, swissspidy, rianrietveld, afercia, GaryJ.
See #30421.
git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43731 602fd350-edb4-49c9-b593-d223f7449a82
Because WP REST API requests aren't identified until `parse_request`, it's impractical to reference the `REST_REQUEST` constant in `wp_debug_mode()`. Instead, it's more helpful to assume that a request wanting a JSON response probably doesn't want PHP errors breaking the response.
Props chrisl27, duanestorey, earnjam.
Fixes#44534.
git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43730 602fd350-edb4-49c9-b593-d223f7449a82
Object type-specific actions that should happen before or after modification of metadata have so far been part of the respective wrapper functions. By using action and filter hooks, this changeset ensures they are always executed, even when calling the lower-level Meta API functions directly, which the REST API does as a prime example.
Props flixos90, spacedmonkey.
Fixes#44467.
git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43729 602fd350-edb4-49c9-b593-d223f7449a82
In the full edit screen, CPTs that have disabled the `publicly_queryable` option will hide the slug field, as it doesn't need to be edited. This change brings the Quick Edit view into line with that behaviour.
Merges [43664] to the 5.0 branch.
Props bhargavmehta, krutidugade.
Fixes#43278.
git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43728 602fd350-edb4-49c9-b593-d223f7449a82
Add global support for HTML attributes prefixed `data-` for authors and contributors, as required by the new editor.
Props azaozz, peterwilsoncc.
Fixes#33121.
git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43727 602fd350-edb4-49c9-b593-d223f7449a82
This functionality will cause the command to be retried up to three times in case of a non-zero return value. Implementing it on commands that perform network requests means that intermittent network failures are less likely to cause a build to fail, as they'll be retried up to three times.
Merges [43645] to the 5.0 branch.
Props johnbillion.
Fixes#44858.
git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43724 602fd350-edb4-49c9-b593-d223f7449a82
This allows the packages to be consumed by plugins and core itself.
The code has been based on the work done in the Gutenberg plugin.
We've added an array with all the packages and the vendor packages to
loop through. This sets a convention so all packages will be
registered in the same way. This array can eventually be generated by
a webpack plugin.
We need to register TinyMCE explicitly. Previously TinyMCE was used
by inserting custom `<script>` tags into the relevant admin pages.
This is not suitable for the new editor, so we need to explicitly
register TinyMCE. We could, in the future, refactor the custom
`<script>` tags to use the registered TinyMCE script instead.
Polyfills are inserted into the page only when necessary using
`document.write`.
Props omarreiss, herregroen, youknowriad, gziolo.
Fixes#45065.
git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43723 602fd350-edb4-49c9-b593-d223f7449a82
In order for clients to present permalink previews, the REST API must share the computed results of `get_sample_permalink()`. These two values are now exposed as `permalink_template` and `generated_slug` for public, viewable post types, but only for `context=edit`.
Props danielbachhuber, rahulsprajapati.
Fixes#45017.
git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43720 602fd350-edb4-49c9-b593-d223f7449a82
We decided to split the media webpack config into it's own file. The
main webpack config then combines this file with the packages config.
Include vendor scripts by copying them. We copy the minified files if
they are available. If they aren't available we minify the original
files ourselves.
Props omarreiss, herregroen, gziolo, youknowriad, netweb, adamsilverstein.
See #45065.
git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43719 602fd350-edb4-49c9-b593-d223f7449a82
In addition to the merge noted below, includes important brackets added in [42343].
Props dhanendran, gnif, SergeyBiryukov.
Merges [42695] and [42702] to the 5.0 branch.
Fixes#43255.
git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43717 602fd350-edb4-49c9-b593-d223f7449a82
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 5.0 branch.
Fixes#40510.
git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43716 602fd350-edb4-49c9-b593-d223f7449a82
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 5.0 branch.
Fixes#39122.
git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43713 602fd350-edb4-49c9-b593-d223f7449a82
Adjust it to handle more types of timeouts, e.g. "Resolving timed out", "Connection timed out".
Merges [43511] to the 5.0 branch.
See #44613.
git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43695 602fd350-edb4-49c9-b593-d223f7449a82
An authorized request with the `read_private_posts` capability for a post type should be able to `GET /wp/v2/posts` for posts of `status=private`. This query is further sanity-checked by `WP_REST_Posts_Controller->check_read_permission()`, which is unchanged.
Props rachelbaker, soulseekah, twoelevenjay.
Fixes#43701.
git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43694 602fd350-edb4-49c9-b593-d223f7449a82
Requires wp-admin/includes/ms.php to make `upload_is_user_over_quota()` function available to multisite users uploading files.
Props JakePT, rachelbaker.
Merges [43603] to the 5.0 branch.
Fixes#44864.
git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43691 602fd350-edb4-49c9-b593-d223f7449a82
* Minification is done by uglify, so disable that in the media build.
* The webpack boilerplate has changed, which explains the changes in the build files.
* `ModuleConcatenationPlugin` is enable by default for production builds so we don't have to specify that ourselves.
See #45065.
git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43688 602fd350-edb4-49c9-b593-d223f7449a82
Updates package dependencies to more modern versions, also adds .nvmrc and package-lock.json as followups to [43683] and [43571].
See #44600.
Fixes#45064.
git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43684 602fd350-edb4-49c9-b593-d223f7449a82
Shrinkwraping is done to keep dependencies the same. Historically, WordPress Core has done it after a release. As the 5.0 branch was created from the 4.9.8 tag which was created from the 4.9 branch, it included it. The 5.0 branch will have some dependency updates so this shrinkwrap is not needed here.
See #45064.
git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43683 602fd350-edb4-49c9-b593-d223f7449a82
Because user capabilities can be modified at runtime, the REST API needs to expose them in some evaluated but declarative manner for clients to interpret. JSON Hyper Schema `targetSchema` provides an appropriate paradigm for doing so.
Props timothyblynjacobs.
Fixes#45014.
git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43682 602fd350-edb4-49c9-b593-d223f7449a82
In [43437], the link definition implementation caused attachment links to be unexpectedly nested under an `attributes` key. This changeset restores the prior behavior.
Props TimothyBlynJacobs.
Fixes#44750.
git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43681 602fd350-edb4-49c9-b593-d223f7449a82
For Gutenberg and other admin-type interfaces, it's
useful to be able to see the visibility settings for
taxonomies.
The original changeset was partially included in [43445].
Merges [42729], [42730], [42973] to the 5.0 branch.
Props joehoyle, TimothyBlynJacobs, pento.
Fixes#42707
git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43680 602fd350-edb4-49c9-b593-d223f7449a82