Commit Graph

41623 Commits

Author SHA1 Message Date
Sergey Biryukov eb1c55a7ac Docs: Document that `get_tags()` returns a `WP_Error` object if any of the specified taxonomies do not exist.
Props coffee2code.
Fixes #50344.

git-svn-id: https://develop.svn.wordpress.org/trunk@47930 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-09 11:12:57 +00:00
Jonathan Desrosiers ba994f6c09 Coding Standards: PHP short ternary operator syntax is not allowed.
WPCS 2.2.0 added a sniff for detecting short ternary operator syntax, which is not allowed per the Core handbook.

Follow up of [47927].
Fixes #50258.

git-svn-id: https://develop.svn.wordpress.org/trunk@47929 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-08 21:25:46 +00:00
Jonathan Desrosiers 7a64133821 Build/Test Tools: Update the `wp-coding-standards/wpcs` package.
This updates the version from 2.1.1 to 2.3.0, the latest version at this time.

Fixes #50258.

git-svn-id: https://develop.svn.wordpress.org/trunk@47927 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-08 20:09:53 +00:00
Jonathan Desrosiers f40f5885e5 General: Remove or add inline comments to `$HTTP_RAW_POST_DATA` occurrences.
The `$HTTP_RAW_POST_DATA` global was deprecated in PHP 5.6 and removed completely in PHP 7.0. In general, `php://input` should be used instead of `$HTTP_RAW_POST_DATA`.

Because WordPress Core still supports PHP 5.6, some plugins or sites may still rely on this variable being present and populated with the expected data. For that reason, occurrences of the variable will remain with updated inline documentation until support for PHP 5.6 is officially dropped in WordPress.

Props skoskie, jrf, desrosj, TimothyBlynJacobs.
See #49922.
Fixes #49810.

git-svn-id: https://develop.svn.wordpress.org/trunk@47926 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-08 19:53:19 +00:00
Jonathan Desrosiers 4e31dc573d Bundled Themes: Update several package versions in Twenty Twenty and Twenty Nineteen.
The following packages received version bumps:

Twenty Twenty
- `concurrently`
- `postcss-cli`
- `rtlcss`
- `stylelint-a11y`

Twenty Nineteen
- `node-sass`
- `postcss-cli`
- `rtlcss`

See #49768.

git-svn-id: https://develop.svn.wordpress.org/trunk@47925 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-08 18:45:08 +00:00
Sergey Biryukov 823b703fe9 Themes: Show a disabled "Activated" button instead of "Activate" for the active theme on Add Themes screen.
Additionally, switch the "Live Preview" label for the active theme to "Customize", for consistency with the Themes screen.

Props afercia, SergeyBiryukov.
Fixes #50334.

git-svn-id: https://develop.svn.wordpress.org/trunk@47924 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-08 18:14:19 +00:00
Timothy Jacobs f5dde31290 REST API: Support the (min|max)Items JSON Schema keywords.
A future commit will add support for the uniqueItems keyword.

Props sorenbronsted.
See #48821.


git-svn-id: https://develop.svn.wordpress.org/trunk@47923 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-07 22:40:16 +00:00
Sergey Biryukov d3387a2161 Posts, Post Types: Display a more specific error message when an attachment could not be inserted into the database.
Props shital-patel, Presskopp, ocean90.
Fixes #50325.

git-svn-id: https://develop.svn.wordpress.org/trunk@47922 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-07 09:22:07 +00:00
Timothy Jacobs 4fb1e58c50 REST API: Add additional fields to the themes controller.
When the themes controller was introduced it only returned a theme's supported features. This adds the majority of a theme's header information to the response.

Props ockham, spacedmonkey.
Fixes #49906.


git-svn-id: https://develop.svn.wordpress.org/trunk@47921 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-07 06:44:08 +00:00
Peter Wilson 602faebb0d Block Editor: Update `wp-includes/assets/script-loader-packages.php`.
Follow-up to [47765], [47766].
See #50094.


git-svn-id: https://develop.svn.wordpress.org/trunk@47920 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-07 01:27:39 +00:00
Sergey Biryukov 09aaa76452 Bootstrap/Load: Introduce `wp_get_environment_type()` to retrieve the current environment type.
The type can be set via the `WP_ENVIRONMENT_TYPE` global system variable, a constant of the same name, or the `wp_get_environment_type` filter.

Possible values include `development`, `stage`, `production'. If not set, the type defaults to `production`.

Props Clorith, krogsgard, joostdevalk, frank-klein, Maelacuna, nathanrice, grierson, jchristopher, davidvee, jackfungi, johnbillion, tabrisrp, knutsp, ev3rywh3re, Rastaban, danielbachhuber, pfefferle, audrasjb, SergeyBiryukov.
Fixes #33161.

git-svn-id: https://develop.svn.wordpress.org/trunk@47919 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-06 11:05:35 +00:00
adamsilverstein 803eab428d Media: remove any `attachment-filter` query param when switching views.
Fix an issue where the media attachment filter no longer worked after switching to list view, filtering by a media type then switching back to the grid view.

Props itzmekhokan, netsurfer2705, zodiac1978.
Fixes #43656.



git-svn-id: https://develop.svn.wordpress.org/trunk@47915 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-05 21:11:02 +00:00
Sergey Biryukov 2071347eac Networks and Sites: Update the link text for "Debugging a WordPress Network" support article in `ms_not_installed()`.
Props Presskopp.
Fixes #50326.

git-svn-id: https://develop.svn.wordpress.org/trunk@47914 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-05 09:11:20 +00:00
Sergey Biryukov d4d709856b Docs: Update the DocBlock for the `wp_media_attach_action` hook per the documentation standards.
Rename the `$att_id` variable to `$attachment_id` for clarity.

Follow-up to [47909].

See #49614.

git-svn-id: https://develop.svn.wordpress.org/trunk@47913 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-05 08:28:42 +00:00
Jonathan Desrosiers 05e1cb8b0b Docs: Fix a typo in the Docker compose file.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@47912 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-04 16:51:32 +00:00
Jake Spurlock e756de59e5 REST API: Ensure that all properties of `get_endpoint_args_for_item_schema` are listed.
* Add new var $valid_schema_properties to match rest_validate_value_from_schema()
* Unit test to ensure all valid properties exists, and non-valid properties are ignored

Fixes: #50301.
Props: pentatonicfunk, TimothyBlynJacobs.



git-svn-id: https://develop.svn.wordpress.org/trunk@47911 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-04 16:41:47 +00:00
Jonathan Desrosiers 6905846fb4 Accessibility: Add the `aria-hidden` attribute to the auto-update related icons.
`<span>` elements used for displaying icons should use the `aria-hidden` attribute as they are purely decorative.

Props audrasjb, ryokuhi.
Fixes #50293.

git-svn-id: https://develop.svn.wordpress.org/trunk@47910 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-04 15:46:00 +00:00
Jake Spurlock 5b2eaae4cf Media: Add an action for `wp_media_attach_action`.
This action fires when media is attached/detached from a post.

Fixes: #49614.
Props: jonoaldersonwp, antpb, rebasaurus, donmhico. 



git-svn-id: https://develop.svn.wordpress.org/trunk@47909 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-04 14:58:58 +00:00
Sergey Biryukov cc62b4ba1d Docs: Update type for `WP_Block_Type::$style` property.
Follow-up to [47907].

See #48529.

git-svn-id: https://develop.svn.wordpress.org/trunk@47908 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-04 10:42:51 +00:00
Greg Ziółkowski db00d908ce Blocks: Update default value for some fields in WP_Block_Type
Related to the issue with default values for the blocks registered on the server. By using null for some fields we can treat them as undefined on the client.

See: WordPress/gutenberg#22849.
Props aduth.
Fixes #48529. 



git-svn-id: https://develop.svn.wordpress.org/trunk@47907 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-04 06:05:37 +00:00
Sergey Biryukov a6b87a8f1c Docs: Add missing `@global` reference for the `$post_id` global in `wp_admin_bar_edit_menu()`.
Follow-up to [47903].

Props davidbaumwald.
See #50312.

git-svn-id: https://develop.svn.wordpress.org/trunk@47906 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-03 21:25:09 +00:00
Jonathan Desrosiers bfcd6e0750 Build/Test Tools: Revert [47901].
This is not matching branches as desired.

Unrops desrosj, jorbin, ocean90, TimothyBlynJacobs.
Fixes #50307.

git-svn-id: https://develop.svn.wordpress.org/trunk@47905 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-03 21:12:01 +00:00
Aaron Jorbin 42efaab548 Build/Test: Die with an error if populate_network fails
If you are missing WP_TESTS_EMAIL, populate_network will fail and it can be hard to debug. As populate_network can return a wp_error object, we can detect that and display the error to a user.

See: https://github.com/WordPress/gutenberg/pull/22613
Fixes: #50251
Props: TimothyBlynJacobs


git-svn-id: https://develop.svn.wordpress.org/trunk@47904 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-03 21:02:42 +00:00
Sergey Biryukov f9a4cdcb3c Toolbar: Display a "View Post" link when viewing comments for a single post on Comments screen.
Props Otto42, matt, SergeyBiryukov.
Fixes #50312.

git-svn-id: https://develop.svn.wordpress.org/trunk@47903 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-03 19:55:54 +00:00
Jonathan Desrosiers dfccba8d55 General: Continuing to work towards a passing PHP Compatibility scan.
This is a final pass to fix PHP compatibiilty issues in the codebase with code changes or adding `phpcs:ignore` comments.

With this change, all PHP compatibility warnings and errors without specific tickets have been addressed (see #49810 and #41750).

Props desrosj, johnbillion, jrf.
See #49922.

git-svn-id: https://develop.svn.wordpress.org/trunk@47902 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-03 17:38:56 +00:00
Jonathan Desrosiers 2da8918f1a Build/Test Tools: Disable Travis CI build Slack notifications for non-official branches.
When branches are unintentionally pushed to the GitHub `wordpress-develop` mirror by committers, a build is triggered in Travis and the result is reported in Slack if the criteria defined is met.

Though this is not the desired workflow (any modifications made to the mirror are erased when the repository is synced from SVN), this can cause a lot of noise if several pushes are made and raise false alarms.

This change limits builds only to the `master` branch, and branches meeting the `X.X` pattern to match each branched version.

Props desrosj, jorbin, ocean90, TimothyBlynJacobs.
Fixes #50307.

git-svn-id: https://develop.svn.wordpress.org/trunk@47901 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-03 17:01:14 +00:00
Sergey Biryukov de3fd5b242 Docs: Document the `term_order` value for the `orderby` parameter of `WP_Term_Query::__construct()`.
Props pbiron.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@47898 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-03 14:39:05 +00:00
Sergey Biryukov d57084755d Docs: Reformat the `orderby` section of `WP_Term_Query::__construct()` for better readability.
This makes it more consistent with the `fields` section.

See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@47897 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-03 14:35:31 +00:00
Sergey Biryukov 33b4f176cd File Editor: Don't verify SSL certificate when doing loopback requests for checking for fatal errors.
Previously, verification was disabled for the loopback request to the admin URL, but not to the home URL.

Follow-up to [46230].

Props munyagu.
Fixes #50309. See #47957.

git-svn-id: https://develop.svn.wordpress.org/trunk@47896 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-03 11:41:31 +00:00
Sergey Biryukov 3f0a45647e External Libraries: Update clipboard.js to 2.0.6.
This change includes some bug fixes and removal of the PhantomJS dependency.

Changelog: https://github.com/zenorocha/clipboard.js/compare/v2.0.4...v2.0.6

Props hareesh-pillai.
Fixes #50306.

git-svn-id: https://develop.svn.wordpress.org/trunk@47895 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-03 11:10:28 +00:00
Sergey Biryukov 112c2c456a Plugins: Make the message displayed when no plugins are installed more concise.
Props johnjamesjacoby, Presskopp.
Fixes #42336.

git-svn-id: https://develop.svn.wordpress.org/trunk@47894 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-03 10:49:45 +00:00
Sergey Biryukov 4ac1670efe Docs: Correct `@since` version for `available_permalink_structure_tags` filter.
Follow-up to [41182].

Props tiagohillebrandt, sabernhardt.
Fixes #42624.

git-svn-id: https://develop.svn.wordpress.org/trunk@47893 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-03 10:36:32 +00:00
Sergey Biryukov c21a340f95 Docs: Miscellaneous DocBlock corrections.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@47892 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-03 10:00:27 +00:00
Adam Silverstein fa96d59318 Formatting: add a new 'safe_style_disallowed_chars' filter.
Enable developers to change the regex used in `safecss_filter_attr` to limit characters in the parsed CSS.

Props paulschreiber, swissspidy, rmccue, bartekcholewa, miinasikk.
Fixes #37134.



git-svn-id: https://develop.svn.wordpress.org/trunk@47891 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-02 23:44:40 +00:00
Sergey Biryukov e18d6e942b Comments: Rename `Walker_Comment::comment_text()` to `::filter_comment_text()` for clarity.
Ensure the comment object is not null before checking its status.

Follow-up to [47887].

See #49956.

git-svn-id: https://develop.svn.wordpress.org/trunk@47889 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-02 20:51:34 +00:00
Jake Spurlock d232910423 Comments: Ensure that unmoderated comments won't be search indexed.
After a comment is submitted, only allow a brief window where the comment is live on the site. 

Fixes #49956.
Props: jonkolbert, ayeshrajans, Asif2BD, peterwilsoncc, imath, audrasjb, jonoaldersonwp, whyisjake.


git-svn-id: https://develop.svn.wordpress.org/trunk@47887 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-02 20:10:02 +00:00
Sergey Biryukov ffd5d37c77 Bundled Themes: Consistently check for `WP_Error` before outputting `get_the_tag_list()`.
Some themes already had these checks in place as a result of [41756], but not others.

Props sixhours, davidakennedy, SergeyBiryukov.
Fixes #39860.

git-svn-id: https://develop.svn.wordpress.org/trunk@47886 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-02 17:03:06 +00:00
Sergey Biryukov 49f03fff79 Docs: Correct `@param` type for `pre_redirect_guess_404_permalink` filter.
Improve filter documentation for consistency with other similar short-circuit filters in core.

Follow-up to [47878].

See #16557.

git-svn-id: https://develop.svn.wordpress.org/trunk@47885 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-02 16:21:49 +00:00
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