Commit Graph

41735 Commits

Author SHA1 Message Date
Dominik Schilling
9bea5b3444 I18N: Use wp.i18n for translatable strings in wp-admin/js/updates.js.
This removes the usage of `wp_localize_script()` for passing translations to the script and instead adds the translatable strings in the script directly through the use of `wp.i18n` and its utilities.

Props swissspidy, ocean90.
See #20491.
Fixes #50235.

git-svn-id: https://develop.svn.wordpress.org/trunk@47884 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-01 21:39:30 +00:00
Andrew Ozz
5263a96a4c Plugins and Themes Auto-Updates: update the state of the auto-update link on the themes screen after successfully saving the setting.
Props desrosj, pbiron, azaozz.
Fixes #50291.

git-svn-id: https://develop.svn.wordpress.org/trunk@47883 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-01 20:51:10 +00:00
Dominik Schilling
2fed7bf581 Build/Test Tools: Avoid an empty "title" heading if no title is set in _wp_die_handler_exit() and _wp_die_handler_txt().
Fixes #50297.

git-svn-id: https://develop.svn.wordpress.org/trunk@47882 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-01 20:48:27 +00:00
Dominik Schilling
7a6b6e1153 Build/Test Tools: Add PHPUnit to Composer dev dependencies.
This helps setting up the correct version of PHPUnit to run WordPress core tests locally and for using it as source for code autocompletion in tests. Also introduces a new Composer script `test` to run the PHPUnit tests.

Props welcher, ayeshrajans, vinkla, johnbillion, Rarst, netweb, ocean90.
Fixes #46815.

git-svn-id: https://develop.svn.wordpress.org/trunk@47881 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-01 20:29:06 +00:00
Dominik Schilling
178eeaf57e Build/Test Tools: Let WP_UnitTestCase_Base extend the namespaced version of PHPUnit's test case class.
With the minimum PHP version requirement set to 5.6 we're now able to use namespaces by default. This replaces `PHPUnit_Framework_TestCase` with `PHPUnit\Framework\TestCase` for `WP_UnitTestCase_Base` to solve autocompletion issues with code editors when using more recent PHPUnit versions. `PHPUnit\Framework\TestCase` is available since PHPUnit 5.4 and now the minimum required PHPUnit version.

Fixes #50236.

git-svn-id: https://develop.svn.wordpress.org/trunk@47880 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-01 19:41:50 +00:00
Jake Spurlock
0cf715f55b Administration: Unify the date structure in list view and excerpt view.
Both views now show a full date string. Something like `Published 2020/05/27 at 10:25 pm`.

Fixes: #35391.
Props: afercia, ocean90, TimothyBlynJacobs, audrasjb, SergeyBiryukov, joedolson.



git-svn-id: https://develop.svn.wordpress.org/trunk@47879 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-01 19:13:54 +00:00
Jake Spurlock
0ad7471880 Canonical: Add the ability to disable redirect_guess_404_permalink().
This also adds a few more filters to make adding redirects easier. Notably:

1. `do_redirect_guess_404_permalink`
2. `pre_redirect_guess_404_permalink`
3. `strict_redirect_guess_404_permalink`

Fixes: #16557.
Props: msafi, nacin, simonwheatley, westi, mboynes, joostdevalk, Lex_Robinson, MikeSchinkel, haukep, paulschreiber, DrewAPicture, ravenswd, esemlabel, stevegibson12, martychc23, DrLightman, jivanpal, neonkowy, laternastudio, apedog, audrasjb, davidbaumwald, Confridin, donmhico, ryotsun. 



git-svn-id: https://develop.svn.wordpress.org/trunk@47878 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-01 18:47:41 +00:00
Dominik Schilling
44d25453b6 Build/Test Tools: Improve Travis config to pass config validation.
* Add missing `os` and `dist` with the current default values.
* Replace the alias `matrix` with `jobs`.
* Remove unsupported `on_start` for `notifications.slack`.

Fixes #50296.

git-svn-id: https://develop.svn.wordpress.org/trunk@47877 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-01 16:37:03 +00:00
Dominik Schilling
028299ac79 Editor: Fix code style for constructor arguments added in [47875].
Also revert unintended changes to `WP_Block_Type::__construct()` DocBlock.

See #48529.

git-svn-id: https://develop.svn.wordpress.org/trunk@47876 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-01 16:25:18 +00:00
Greg Ziółkowski
822ca9ebc7 Add fields to WP_Block_Type
As part of #47620 and the RFC for block registeration. Server registered blocks are missing some fields. These changeset includes them.

Props spacedmonkey, aduth.

Fixes #48529.



git-svn-id: https://develop.svn.wordpress.org/trunk@47875 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-01 12:25:34 +00:00
Sergey Biryukov
e0ede89881 Docs: Correct and clarify an inline comment about the upload_url_path and upload_path options in wp-admin/options-media.php.
Synchronize it with a similar comment in `wp-admin/options.php`.

See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@47874 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-01 11:20:16 +00:00
Sergey Biryukov
bec349c649 Build/Test Tools: Bump node-sass and webpack-dev-server versions as a result of npm audit.
Props whyisjake.
See #49768.

git-svn-id: https://develop.svn.wordpress.org/trunk@47873 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-31 09:19:05 +00:00
Sergey Biryukov
649b0724ba Build/Test Tools: Switch to Node 12.16.0 (LTS) and npm 6.14.0.
See #49768.

git-svn-id: https://develop.svn.wordpress.org/trunk@47872 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-31 09:17:35 +00:00
Sergey Biryukov
4ae8bdf8c3 Upgrade/Install: Rename wp_in_maintenance_mode() to wp_is_maintenance_mode(), for consistency with wp_is_recovery_mode().
While the former name might be a bit more accurate, the latter matches the existing naming pattern.

Follow-up to [47623].

Fixes #49959.

git-svn-id: https://develop.svn.wordpress.org/trunk@47871 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-30 15:11:02 +00:00
Sergey Biryukov
2e39930d71 Docs: Adjust the documentation for the new ID alias in get_term_by() for consistency with get_user_by().
Follow-up to [47865].

See #45163.

git-svn-id: https://develop.svn.wordpress.org/trunk@47870 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-30 10:06:49 +00:00
Jake Spurlock
c9ee3b828c Build/Test Tools: Revert some devDependency changes for 5.5.
After bumping some major updates, tests on Travis are failing. 

See: https://travis-ci.com/WordPress/wordpress-develop/builds/168839259 ##49768.
Unprops: whyisjake.



git-svn-id: https://develop.svn.wordpress.org/trunk@47869 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-30 06:08:18 +00:00
Jake Spurlock
e1993cd3fb Build/Test Tools: Bump devDependencies for WordPress 5.5.
Bumping a few more dependencies as a result of `npm audit`.

Fixes #49768.
Props whyisjake.


git-svn-id: https://develop.svn.wordpress.org/trunk@47868 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-30 05:36:28 +00:00
Jake Spurlock
5c184116bf Build/Test Tools: Bump devDependencies for WordPress 5.5
There are several other changes that need to be made for the security audit, this is just the first pass.

Fixes #49768.
Props SergeyBiryukov, whyisjake.


git-svn-id: https://develop.svn.wordpress.org/trunk@47867 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-30 04:54:28 +00:00
Jake Spurlock
38744d8bd2 Code Standards: Clean up whitespace on the end of a file.
See: #45163.
Props: whyisjake.



git-svn-id: https://develop.svn.wordpress.org/trunk@47866 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-29 23:34:00 +00:00
Jake Spurlock
7b13f5abd8 Taxonomy: Extend get_term_by to accept ID as a term parameter.
Similar to `get_user_by`, both `ID` and `id` should be able to accepted.

Fixes #45163.
Props emrikol, esoj.
 


git-svn-id: https://develop.svn.wordpress.org/trunk@47865 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-29 22:41:25 +00:00
Sergey Biryukov
64a2e8d55e Docs: Improve documentation for functions in wp-includes/category.php per the documentation standards.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@47864 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-29 10:05:36 +00:00
Sergey Biryukov
0133a78dec Docs: Document that get_category_by_slug() returns false if the category doesn't exist.
Props stevenlinx.
Fixes #50277.

git-svn-id: https://develop.svn.wordpress.org/trunk@47863 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-29 10:00:32 +00:00
Sergey Biryukov
7f73f1a1e4 Coding Standards: Use strict comparison in wp-admin/_index.php.
See #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@47862 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-28 10:00:44 +00:00
Sergey Biryukov
cfc5b94f28 Docs: Remove unused @global declarations from _WP_Editors::print_tinymce_scripts().
Follow-up to [47860].

See #45398.

git-svn-id: https://develop.svn.wordpress.org/trunk@47861 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-27 19:46:34 +00:00
Jake Spurlock
d8b8495e8e Editor: Remove TinyMCE global version.
The global variable is not being used in the `editor_settings` method. 

Fixes #45398.
Props ishitaka, noisysocks, mista-flo.



git-svn-id: https://develop.svn.wordpress.org/trunk@47860 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-27 19:26:32 +00:00
Andrea Fercia
184118c3c9 Administration and Site Health: Make information on Search engine visibility more prominent.
- makes the "Search engines discouraged" message on the Dashboard more prominent
- adds "Search engine visibility" information under Site Health > Info > WordPress 
- removes title case in favor of sentence case in all the related strings 

Props audrasjb, swissspidy, emanuel_blagonic, Presskopp, karmatosed, valentinbora, melchoyce.
Fixes #35288.


git-svn-id: https://develop.svn.wordpress.org/trunk@47859 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-27 14:32:00 +00:00
Sergey Biryukov
45d8f6b9d0 Docs: Correct @return value for WP_REST_Meta_Fields::get_value().
Props chrisvanpatten.
Fixes #50259.

git-svn-id: https://develop.svn.wordpress.org/trunk@47858 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-27 09:42:38 +00:00
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