Commit Graph

41708 Commits

Author SHA1 Message Date
Jake Spurlock
8efc5321c9 Coding Standards: Change auto-update filters to be more consistent.
* send_theme_auto_update_email 👉 auto_theme_update_send_email
* wp_plugins_auto_update_enabled 👉 plugins_auto_update_enabled
* wp_themes_auto_update_enabled 👉 themes_auto_update_enabled

Want to make sure that @ronalfy gets props for his work in #50052 too.

See #50052.
Props: ronalfy, pbiron, azaozz, audrasjb, whyisjake.



git-svn-id: https://develop.svn.wordpress.org/trunk@47857 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-26 18:01:18 +00:00
Dominik Schilling
adcf5cf7a3 Posts, Post Types: Pass the post object to the delete_attachment action.
Also add the missing `$post` parameter to the `delete_post` and `deleted_post` actions in `wp_delete_attachment()`.

See #30940.

git-svn-id: https://develop.svn.wordpress.org/trunk@47856 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-26 14:47:26 +00:00
Sergey Biryukov
2c75752c88 Coding Standards: Fix instances of Generic.WhiteSpace.ArbitraryParenthesesSpacing.FoundEmpty.
See #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@47855 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-26 09:35:34 +00:00
Sergey Biryukov
6ec9c9c446 Docs: Improve documentation for add_existing_user_to_blog().
Props stevenlinx.
Fixes #50243.

git-svn-id: https://develop.svn.wordpress.org/trunk@47854 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-25 14:21:50 +00:00
Sergey Biryukov
219acea88f Coding Standards: Use strict comparison in wp-admin/network where static strings are involved.
Includes minor code layout fixes for better readability.

Follow-up to [47808].

See #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@47853 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-24 09:14:21 +00:00
Sergey Biryukov
2919961c18 Coding Standards: Use strict comparison for $wp_db_version check in wp-admin/network/upgrade.php.
Follow-up to [47787], [47788].

See #50155, #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@47852 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-24 09:13:39 +00:00
Sergey Biryukov
3e2d77ae04 Coding Standards: Use strict comparison for more count() calls.
Follow-up to [47848].

Props mukesh27.
Fixes #50232. See #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@47851 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-23 16:20:10 +00:00
Dominik Schilling
f37a28858d Role/Capability: Use meta caps edit_post, read_post, and delete_post directly.
Rather than consulting the post type object, let `map_meta_cap()` handle that for us.

Props peterwilsoncc, ocean90.
Fixes #50128.
See #23226.

git-svn-id: https://develop.svn.wordpress.org/trunk@47850 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-23 15:22:53 +00:00
Dominik Schilling
584df2a169 Rest API: Ensure rest_ensure_response() upgrades WP_HTTP_Response to WP_REST_Response.
An instance of `WP_HTTP_Response` doesn't ensure that the required methods used in `WP_REST_Server::dispatch()` exist, currently causing a fatal error.

Props ali11007, TimothyBlynJacobs, ocean90.
Fixes #49495.

git-svn-id: https://develop.svn.wordpress.org/trunk@47849 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-23 14:34:38 +00:00
Sergey Biryukov
772a11b72a Coding Standards: Use strict comparison for count() calls.
See #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@47848 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-23 11:36:36 +00:00
Jake Spurlock
a5baf8b9c6 Bundled Themes: Add missing RTL styles for to fix inconsistent margins on .alignwide and .alignfull items.
Fixes the inconsistent margins for alignwide and alignfull classes used on Cover Block when it is the first block on a page.

Props kthmd, utz119, nikhilbhansi, and sabernhardt.
Fixes #49435.


git-svn-id: https://develop.svn.wordpress.org/trunk@47846 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-23 06:21:37 +00:00
Sergey Biryukov
1ce6af5284 Coding Standards: Fix WPCS issues in wp-admin/plugin-editor.php and wp-admin/theme-editor.php.
See #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@47845 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-22 23:59:10 +00:00
Sergey Biryukov
a6cb663c13 Theme Editor: Remove unused $has_templates boolean.
The variable is a remnant from when the Theme Editor still had the "Templates" heading and is unused in the current logic.

The condition it was a part of would always evaluate to true for a child theme, regardless of the `$has_templates` value.

Props dboy1988.
Fixes #50199.

git-svn-id: https://develop.svn.wordpress.org/trunk@47844 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-22 23:18:47 +00:00
Jake Spurlock
3ab28fd579 REST API: Ensure proper namespacing when registering routes.
The PR will corerce routes that have a leading slash and throwing a `_doing_it_wrong` notice while ensuring a proper namespace.

Fixes #49749.
Props TimothyBlynJacobs, skarabeq, afercia.



git-svn-id: https://develop.svn.wordpress.org/trunk@47842 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-22 20:46:03 +00:00
Sergey Biryukov
3fe58b173f Coding Standards: Fix WPCS issues in wp-admin/includes/class-wp-site-health-auto-updates.php.
See #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@47841 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-22 17:54:50 +00:00
Sergey Biryukov
4d6ac487e7 Coding Standards: Fix WPCS issues in wp-admin/includes/class-wp-debug-data.php.
Follow-up to [47550], [47557], [47835].

See #50052.

git-svn-id: https://develop.svn.wordpress.org/trunk@47840 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-22 17:24:05 +00:00
Sergey Biryukov
174ead229d Customize: Move the WordPress logo with a white background to the wp-includes directory.
This ensures that the image used as a default site icon looks good on a dark background.

The image was previously changed in the `wp-admin` directory, but the site icon is now loaded from `wp-includes`.

Follow-up to [36635], [47018], [47564], [47832].

Props ocean90.
Fixes #49798.

git-svn-id: https://develop.svn.wordpress.org/trunk@47838 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-21 09:08:52 +00:00
Peter Wilson
09a6234ed3 KSES: Support the video element's playsinline attribute.
Allow users without the `unfiltered_html` capability to use the `playsinline` attribute when embedding videos.

Additionally this adds unit tests for passing the video element through kses.

Fixes #50167. See #29826.


git-svn-id: https://develop.svn.wordpress.org/trunk@47837 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-21 04:52:33 +00:00
Sergey Biryukov
e834dc8935 Docs: Add missing @since tag for auto_plugin_theme_update_email filter.
See #50052.

git-svn-id: https://develop.svn.wordpress.org/trunk@47836 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-20 19:31:50 +00:00
Jake Spurlock
eb79d7f1ee Security: Add user interface to auto-update themes and plugins.
Building on core update mechanisms, this adds the ability to enable automatic updates for themes and plugins to the WordPress admin. 

Fixes: #50052.
Props: afercia, afragen, audrasjb, azaozz, bookdude13, davidperonne, desrosj, gmays, gmays, javiercasares, karmatosed, knutsp, mapk, mukesh27, netweb, nicolaskulka, nielsdeblaauw, paaljoachim, passoniate, pbiron, pedromendonca, whodunitagency, whyisjake, wpamitkumar, and xkon.


git-svn-id: https://develop.svn.wordpress.org/trunk@47835 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-20 18:47:24 +00:00
Andrea Fercia
cdd8b92ea6 Accessibility: Media: Hide the invisible "file input" on media views from assistive technologies.
The file input button is visually hidden, but was announced by screen readers in workflows unrelated to file uploads.
It is now hidden from assistive technologies by the means of an `aria-hidden` attribute, as its CSS display property must not be changed to make sure it still works on old browsers.

See #49753.
Fixes #47611.


git-svn-id: https://develop.svn.wordpress.org/trunk@47834 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-20 13:31:32 +00:00
Sergey Biryukov
ea99b194dc Customize: Load the default site icon from the wp-includes directory.
Files inside the `wp-admin` directory may not be publicly available.

Follow-up to [36635], [47018].

Props whyisjake, finomeno, ocean90.
Fixes #50131.

git-svn-id: https://develop.svn.wordpress.org/trunk@47832 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-20 10:34:18 +00:00
Sergey Biryukov
78a308ea84 Coding Standards: Fix WPCS issues in wp-includes/class-wp-customize-manager.php.
Follow-up to [47819].

Props sorenbronsted.
See #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@47821 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-19 08:39:28 +00:00
Ian Belanger
930633096e Bundled Themes: Twenty Twenty inconsistent top and bottom margins for .alignwide and .alignfull on Chrome vs Safari.
Fixes the inconsistent margins for `alignwide` and `alignfull` classes used on Cover Block when it is the first block on a page.

Props kthmd, utz119, nikhilbhansi.
Fixes #49435.

git-svn-id: https://develop.svn.wordpress.org/trunk@47820 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-18 19:50:22 +00:00
Sergey Biryukov
a60b30444f Themes: Prevent installation of themes that require a higher version of PHP or WordPress.
Props afragen.
Fixes #49653. See #48491.

git-svn-id: https://develop.svn.wordpress.org/trunk@47819 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-18 16:01:38 +00:00
Sergey Biryukov
581bc56b16 Themes: Remove extra whitespace from wp-admin/includes/ajax-actions.php and wp-admin/includes/theme.php.
Follow-up to [47816].

See #48491.

git-svn-id: https://develop.svn.wordpress.org/trunk@47818 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-18 12:53:34 +00:00
Sergey Biryukov
cd7d648040 Themes: Remove debug call from wp-admin/theme-install.php.
Follow-up to [47816].

See #48491.

git-svn-id: https://develop.svn.wordpress.org/trunk@47817 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-18 12:47:48 +00:00
Sergey Biryukov
b91e74d2f6 Themes: Prevent activation and live preview of themes that require a higher version of PHP or WordPress.
Props afragen, jorbin, TimothyBlynJacobs, SergeyBiryukov.
See #48491.

git-svn-id: https://develop.svn.wordpress.org/trunk@47816 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-18 12:30:04 +00:00
Sergey Biryukov
6ec559b2ba Site Health: Use WP_Theme::parent() in the inactive themes test as a more reliable check that the parent theme exists.
This is also more consistent with the other instances of directly referencing `WP_Theme::parent()` properties or methods in core.

Props mukesh27, juanlopez4691, davidbaumwald, afragen, SergeyBiryukov.
Fixes #49934.

git-svn-id: https://develop.svn.wordpress.org/trunk@47815 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-18 04:36:57 +00:00
Sergey Biryukov
5e43c07be4 Coding Standards: Fix WPCS issues in plugin and theme upgrader classes.
See #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@47814 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-17 09:37:12 +00:00
Sergey Biryukov
2a81a84e12 Accessibility: Login and Registration: Respect the prefers-reduced-motion media query for "shake" CSS animation on login failure.
This shake should not occur when the user has opted to reduce motion, for example by selecting the "Reduce motion" option in macOS' preferences or unselecting "Show animations in Windows" in Windows' preferences.

Follow-up to [47226].

Props eddystile, johnbillion, sabernhardt, afercia, audrasjb.
Fixes #49723.

git-svn-id: https://develop.svn.wordpress.org/trunk@47813 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-16 20:23:04 +00:00
Timothy Jacobs
c85005dec1 Coding Standards: Correct docblock indentation.
Fixes PHPCS failure introduced in r47811.


git-svn-id: https://develop.svn.wordpress.org/trunk@47812 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-16 19:54:20 +00:00
Timothy Jacobs
5405017564 REST API: Add @since entries for rest_validate_value_from_schema().
See #49572, #48818, #44949, #50053, #48820, #49720, #42961, #44975, #43392, #38583.


git-svn-id: https://develop.svn.wordpress.org/trunk@47811 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-16 19:31:48 +00:00
Timothy Jacobs
d8a063eabb REST API: Support the JSON Schema pattern keyword.
Props jason_the_adams, birgire, sorenbronsted.
Fixes #44949.


git-svn-id: https://develop.svn.wordpress.org/trunk@47810 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-16 19:01:49 +00:00
Timothy Jacobs
8b9823f536 REST API: Check required properties are provided when validating an object.
Previously, the WP_REST_Request object validated that top-level properties were defined, but this did not extend to those object's required properties. This adds validation to rest_validate_value_from_schema() directly.

Both the v3 and v4 JSON Schema syntax for required properties is supported.

Props sorenbronsted.
Fixes #48818.


git-svn-id: https://develop.svn.wordpress.org/trunk@47809 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-16 18:41:41 +00:00
Sergey Biryukov
6742d0d7a6 Coding Standards: Use strict comparison where static strings are involved.
This reduces the number of `WordPress.PHP.StrictComparisons.LooseComparison` issues in half, from 1897 to 890.

Includes minor code layout fixes for better readability.

See #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@47808 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-16 18:40:52 +00:00
Sergey Biryukov
36e4db6b01 Media: Expose media grid frame via wp-media-grid-ready trigger for easier customization.
Props soulseekah.
Fixes #50185.

git-svn-id: https://develop.svn.wordpress.org/trunk@47807 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-16 17:23:31 +00:00
Sergey Biryukov
26a527fa9f Coding Standards: Fix WPCS issues in wp-admin/includes/class-wp-screen.php.
See #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@47802 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-15 18:11:40 +00:00
Ian Belanger
7edaf9b3e3 Bundled Themes: Twenty Eleven & Twenty Twelve dropdown category widget exceeds parent div when strings are long enough.
Fixes the width of the category dropdown by limiting the width of `select` items in widgets using `max-width: 100%`.

Props gma992, karmatosed.
Fixes #37926.

git-svn-id: https://develop.svn.wordpress.org/trunk@47801 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-15 16:29:43 +00:00
Ian Belanger
9c3a5d30ab Bundled Themes: Twenty Twenty version bump.
We are releasing a new version of Twenty Twenty today thus we need to bump the version.

Props ianbelanger.
Fixes #50174.

git-svn-id: https://develop.svn.wordpress.org/trunk@47800 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-14 18:10:11 +00:00
Ian Belanger
7d94081279 Bundled Themes: Twenty Twenty custom post types that don't support authors, shows author box.
This fixes the issue where custom post types will show an author box, even if they don't support authors.

Props joyously, donmhico.
Fixes #48803.

git-svn-id: https://develop.svn.wordpress.org/trunk@47799 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-14 17:15:41 +00:00
Sergey Biryukov
25133cf3f1 Docs: Update Michael Heilemann's URL in a comment in wp-includes/theme-compat/footer.php.
Props ritterml, mukesh27.
Fixes #50171.

git-svn-id: https://develop.svn.wordpress.org/trunk@47798 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-14 15:31:34 +00:00
SergeyBiryukov
7fcb660015 Themes: Add "Block Editor Patterns" and "Full Site Editing" to the list of WordPress theme features.
Follow-up to [meta9876].

Props dingo_d.
Fixes #50164. See #meta5212.

git-svn-id: https://develop.svn.wordpress.org/trunk@47797 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-14 14:41:02 +00:00
Ian Belanger
3d68fda88f Bundled Themes: Twenty Twenty add GPLv2 compatible TikTok icon to the social icon menu.
This adds a GPLv2 compatible TikTok icon to replace the non-compatible TikTok icon and update the readme.txt file. Updates previous commit which used a non-compatible TikTok icon [47589]

Props poena, audrasjb, Emlebrun.
Fixes #49893.

git-svn-id: https://develop.svn.wordpress.org/trunk@47796 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-14 13:46:27 +00:00
Ian Belanger
c1f05c9a32 Bundled Themes: Twenty Twenty add icon for g.page links.
Adds the option to use a g.page url for the social menu.

Props argentite, mayankmajeji.
Fixes #49088.

git-svn-id: https://develop.svn.wordpress.org/trunk@47795 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-14 13:03:59 +00:00
Sergey Biryukov
783c936d68 Docs: Add @since notes for theme features added or removed in get_theme_feature_list() after its introduction in WordPress 3.1.
See #50165.

git-svn-id: https://develop.svn.wordpress.org/trunk@47794 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-14 12:49:00 +00:00
Sergey Biryukov
5adac72f47 Themes: Add "Block Editor Styles" and "Wide Blocks" to the list of WordPress theme features.
These were added to Theme Directory API in anticipation of being committed to core for WordPress 5.2+, which has not happened until now.

Follow-up to [meta8273].

See #46272.

git-svn-id: https://develop.svn.wordpress.org/trunk@47790 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-14 09:16:45 +00:00
Sergey Biryukov
d0d9c1465c Export: Use correct escaping function for term IDs in <wp:term> nodes.
Follow-up to [34333].

Props DrLightman, marcio-zebedeu.
Fixes #50113.

git-svn-id: https://develop.svn.wordpress.org/trunk@47789 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-14 07:53:57 +00:00
Sergey Biryukov
6e00150660 Coding Standards: Use strict comparison in wp-admin/upgrade.php.
Props mukesh27.
Fixes #50155.

git-svn-id: https://develop.svn.wordpress.org/trunk@47788 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-13 10:08:58 +00:00
Sergey Biryukov
6e8ab8448a Coding Standards: Correct db_version check in wp-admin/admin.php.
Follow-up to [47785].

See #49239.

git-svn-id: https://develop.svn.wordpress.org/trunk@47787 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-12 20:57:48 +00:00