Commit Graph

42732 Commits

Author SHA1 Message Date
John Blackbourn
d51fc4b06c Media: Add an audio and video player to the media manager modal.
This introduces a means of playing existing audio and video files while browsing them prior to selecting them for use.

Props antpb, Mista-Flo, garrett-eclipse, mapk

Fixes #43640


git-svn-id: https://develop.svn.wordpress.org/trunk@49195 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-18 17:37:19 +00:00
Sergey Biryukov
422a9049b5 Code Modernization: Use instanceof instead of a comparison with get_class().
Includes adjusting external libraries which are no longer maintained externally.

Props jrf.
See #50767.

git-svn-id: https://develop.svn.wordpress.org/trunk@49194 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-18 17:31:37 +00:00
Sergey Biryukov
97b2f07d2e Coding Standards: Replace alias PHP functions with the canonical names.
Using the canonical function name for PHP functions is strongly recommended, as aliases may be deprecated or removed without (much) warning.

This replaces all uses of the following:
* `join()` with `implode()`
* `sizeof()` with `count()`
* `is_writeable()` with `is_writable()`
* `doubleval()` with a `(float)` cast

In part, this is a follow-up to #47746.

Props jrf.
See #50767.

git-svn-id: https://develop.svn.wordpress.org/trunk@49193 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-18 17:25:10 +00:00
Sergey Biryukov
f124a650ba Coding Standards: Use self when appropriate.
* `WP_List_Table::get_default_primary_column_name()` is a protected method, so calling it statically with the class name is bad practice.
* Similarly, this applies when calling a private constructor in `WP_Screen::get()`.

Props jrf.
See #50767.

git-svn-id: https://develop.svn.wordpress.org/trunk@49192 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-18 17:16:33 +00:00
John Blackbourn
f41b6b4d2e Administration: Allow WP_List_Table::get_bulk_items() to receive a nested array in order to output optgroups.
The allowed format for bulk actions is now an associative array where each element represents either a top level option value and label, or an array representing an optgroup and its options.

For a standard option, the array element key is the field value and the array element value is the field label.

For an optgroup, the array element key is the label and the array element value is an associative array of options as above.

Props goldenapples, mattkeys, valentinbora, davidbaumwald

Fixes #19278


git-svn-id: https://develop.svn.wordpress.org/trunk@49190 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-18 16:20:07 +00:00
Drew Jaynes
1f1adbeee8 Docs: Clarify documentation for what the 'count' orderby argument represents in WP_Term_Query.
Props jeremyescott.
Fixes #44443.


git-svn-id: https://develop.svn.wordpress.org/trunk@49189 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-18 08:21:06 +00:00
Sergey Biryukov
2991a01f3f Formatting: Deprecate wp_slash_strings_only() in favor of wp_slash().
The reason for introducing `wp_slash_strings_only()` in [46454] was to keep non-string values untouched.

Later, `wp_slash()` itself was updated in [48433] to prevent changing non-string values.

To avoid confusion, `wp_slash_strings_only()` is now deprecated.

Props ayeshrajans, ocean90.
Fixes #50635.

git-svn-id: https://develop.svn.wordpress.org/trunk@49188 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-18 06:55:16 +00:00
Sergey Biryukov
7164e4b4c8 Comments: Hide the link to the initial parent comment in the reply heading when replying to another comment.
This ensures that the reply heading is updated correctly on single post URLs with the `?replytocom` query argument.

Follow-up to [47506], [48876], [48904].

Props mailnew2ster, wpamitkumar, audrasjb, desrosj, SergeyBiryukov.
Fixes #51175.

git-svn-id: https://develop.svn.wordpress.org/trunk@49187 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-18 06:39:21 +00:00
Sergey Biryukov
918bebfe3c Code Modernization: Remove unnecessary reference sign from PO::export_entry() definition.
This fixes a PHP 8 "argument must be passed by reference, value given" error when using `array_map()` in `PO::export_entries()`.

Object variables in PHP 5+ contain a reference to the object, and it's the reference that's passed around.

Props jrf.
See #50913.

git-svn-id: https://develop.svn.wordpress.org/trunk@49186 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-18 06:27:38 +00:00
Sergey Biryukov
2c25a1a0ca Revisions: Explicitly declare the Text_Diff::_getTempDir() method as static.
This fixes a "Non-static method cannot be called statically" fatal error on PHP 8.

Props jrf.
Fixes #51559.

git-svn-id: https://develop.svn.wordpress.org/trunk@49185 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-17 16:34:45 +00:00
Sergey Biryukov
5bad4e7f8d Code Modernization: Use explicit visibility for class property declarations.
Using `var` or only `static` to declare a class property is PHP 4 code.

This updates the codebase to use explicit visibility modifiers introduced in PHP 5.

Props jrf.
Fixes #51557. See #22234.

git-svn-id: https://develop.svn.wordpress.org/trunk@49184 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-17 16:24:35 +00:00
John Blackbourn
5b6a20af07 Docs: Fix and upgrade various object docblock notations.
See #50768


git-svn-id: https://develop.svn.wordpress.org/trunk@49183 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-17 16:03:58 +00:00
Sergey Biryukov
b91257e97f Feeds: Fix "Only variables should be passed by reference" PHP notice in atomlib.php.
Props jrf.
Fixes #51558.

git-svn-id: https://develop.svn.wordpress.org/trunk@49182 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-17 15:43:39 +00:00
John Blackbourn
ff18031d1b Docs: Miscellaneous docblock fixes.
See #50768


git-svn-id: https://develop.svn.wordpress.org/trunk@49181 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-17 14:52:04 +00:00
John Blackbourn
b1833128fe Administration: Fix a coding standards issue after [49179].
See #50699


git-svn-id: https://develop.svn.wordpress.org/trunk@49180 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-17 12:32:45 +00:00
Andrew Ozz
6a2ef2d5b2 Fix and improve arranging of postboxes/metaboxes:
- Enable arranging only when the Screen Options tab is open.
- Prevent accidental/unintended dragging. Seen it happen mostly on laptops when using the mousepad/trackpad.
- Improve discoverability and usefulness by always showing the "drop zones" outline when postboxes are draggable/arrangeable.
- Add some (brief) explanation to the Screen Options tab helping the user understand what options are available and how to change them. This is especially helpful for screen reader users to give an idea how to use the screen options and what to expect.
- Fix/enhance some of the code in `postbox.js` and make it coding standards compliant.

See #50699.

git-svn-id: https://develop.svn.wordpress.org/trunk@49179 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-17 09:58:34 +00:00
Sergey Biryukov
14e3433b85 Administration: Wrap the list table items count to a new line on small screens.
This avoids overlapping with action buttons and brings some consistency to bottom paddings across various screens.

Props passoniate, afercia, anuj2, rolfsiebers, uxkai, ireneyoast, thijsvanloef, hellofromTonya, audrasjb, helen, SergeyBiryukov.
Fixes #49246.

git-svn-id: https://develop.svn.wordpress.org/trunk@49178 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-17 01:11:58 +00:00
Sergey Biryukov
0f6305e246 Accessibility: Widgets: Conditionally wrap the tag cloud widget in a <nav> element.
If the theme declares support for the `html5` feature `navigation-widgets`, the tag cloud widget is now wrapped in a `<nav>` element to improve semantics and accessibility.

The `<nav>` elements are native landmark regions, which helps assistive technology users to navigate through them.

Follow-up to [48349] for other widgets.

Props audrasjb, justinahinon, ravipatel.
Fixes #51455. See #48170.

git-svn-id: https://develop.svn.wordpress.org/trunk@49177 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-16 18:30:53 +00:00
Jonathan Desrosiers
f3f2aa135e External Libraries: Update the SimplePie library to version 1.5.6.
This version fixes a handful of PHP 8 compatibility issues.

A full list of changes included in this update can be found on GitHub: https://github.com/simplepie/simplepie/compare/1.5.5...1.5.6.

Props jrf, ayeshrajans.
Fixes #51521.

git-svn-id: https://develop.svn.wordpress.org/trunk@49176 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-16 17:18:11 +00:00
Jonathan Desrosiers
b52dd8a173 Build/Test Tools: Specify the full working directory for PHPCS
Props ocean90.
See #50401.

git-svn-id: https://develop.svn.wordpress.org/trunk@49175 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-16 17:12:16 +00:00
Mike Schroder
505fe2f0b8 Media: Work around use-cropbox bug in Ghostscript 8.70
Wraps `Imagick::readImage()` for PDFs with exception handling, trying again without `use-cropbox` if this fails.

Introduces `WP_Image_Editor_Imagick::pdf_load_source()`.

Works around a known issue in Ghostscript 8.70 (fixed in 8.71) that results in a stack underflow.
While it only affects this version, it remains a common version found on hosts, and prevented some PDF thumbnails from being generated.

See this Ghostscript bug for more details: https://bugs.ghostscript.com/show_bug.cgi?id=690676

Props azaozz, joseaneto, cranewest, dantahoua, n5hzr, mikeschroder.
Fixes #48853.

git-svn-id: https://develop.svn.wordpress.org/trunk@49174 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-16 10:46:58 +00:00
Sergey Biryukov
46119b8367 Docs: Add @since tags for the fire_after_hooks parameter of wp_insert_post(), wp_update_post(), and wp_insert_attachment().
Document the parameter as optional.

Follow-up to [49172].

See #45114.

git-svn-id: https://develop.svn.wordpress.org/trunk@49173 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-16 09:38:17 +00:00
Peter Wilson
254ca903b2 REST API, Posts: Add a hook to fire once a post, its terms and meta update.
Introduces the action `wp_after_insert_post` inside a wrapper function of the same name. This hook allows plugin developers to access a posts full data (including its terms and meta data) regardless of the workflow used to save it.

A new parameter is introduced to `wp_insert_post()` to indicate whether the hook should be fired within the function call or will be fired afterward.

Props aristath, Collizo4sky, danielbachhuber, joyously, kadamwhite, kraftbj, markparnell, mikeschroder, noisysocks, peterwilsoncc, SergeyBiryukov, talldanwp, thewebprincess, TimothyBlynJacobs.
Fixes #45114.


git-svn-id: https://develop.svn.wordpress.org/trunk@49172 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-16 03:32:11 +00:00
Peter Wilson
3965584a04 Taxonomy: Fix warnings thrown by custom term count callbacks.
Add a `use` to a closure to avoid an undefined variable throwing a warning. Adds unit tests to ensure the custom callbacks run as expected when defined.

Follow up to [49141].
Props ocean90, dd32.
Fixes #40351.



git-svn-id: https://develop.svn.wordpress.org/trunk@49171 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-16 02:41:15 +00:00
Sergey Biryukov
901edbe510 Privacy: Denote removed suggested privacy policy text in a more noticeable way.
Props garrett-eclipse, sabernhardt, audrasjb.
Fixes #51435.

git-svn-id: https://develop.svn.wordpress.org/trunk@49170 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-16 01:27:14 +00:00
Jonathan Desrosiers
01e62f0cc3 Build/Test Tools: Change the event that triggers the “Welcome” workflow.
When a contributor opens their first pull request to `wordpress-develop`, the “Welcome” workflow runs and leaves a comment with guidance, helpful information, and resources.

However, because a workflow run triggered by the `pull_request` event runs against the workflow and code from the merge commit, the needed context and permissions to comment on the pull request are missing. By changing the trigger event to `pull_request_target`, the workflow runs against the workflow and code in the base of the pull request and is able to comment on when appropriate.

See #50401.

git-svn-id: https://develop.svn.wordpress.org/trunk@49169 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-16 00:37:03 +00:00
Jonathan Desrosiers
285048ed3f Build/Test Tools: Do not cancel previous workflow runs.
When a workflow is cancelled, it’s marked as a failure. This is not ideal because the commit attached to the workflow run will appear as though it introduced a problem, but this may not be true.

Because GitHub Actions work a bit differently than Travis builds, it’s unlikely that the same bottleneck will be encountered in workflows.

This change removes all workflow job steps that cancel previous workflows.

See #50401.

git-svn-id: https://develop.svn.wordpress.org/trunk@49168 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-16 00:25:18 +00:00
Sergey Biryukov
45432f4c39 Upgrade/Install: Check if plugin or theme update results are available before applying the notification filters.
This avoids a PHP notice for an undefined index of either `plugin` or `theme` in the `auto_{plugin|theme}_update_send_email` filter hook.

Props afragen, audrasjb.
Fixes #51400.

git-svn-id: https://develop.svn.wordpress.org/trunk@49166 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-15 23:25:19 +00:00
Jonathan Desrosiers
805351a478 External Libraries: Update React, ReactDOM and Lodash.
This updates:
- `react` and `react-dom` from `16.9.0` to `16.13.1`.
- `lodash from `4.17.15` to `4.17.19`.

Props isabel_brison.
Fixes #51505.

git-svn-id: https://develop.svn.wordpress.org/trunk@49165 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-15 23:06:49 +00:00
Sergey Biryukov
93a325ccf8 Bootstrap/Load: Don't assume WP_CONTENT_DIR is defined.
When the `mysql` extention isn't loaded and a custom db dropin is not in place, we give folks a nice error. However, we can't assume that the `WP_CONTENT_DIR` constant is set yet since this runs before we define default constants.

This fixes a PHP 8 error.

Props jorbin.
Merges [49161] to trunk.
See #50913.

git-svn-id: https://develop.svn.wordpress.org/trunk@49163 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-15 21:14:35 +00:00
Jonathan Desrosiers
e5b9d995a8 Build/Test Tools: Introduce GitHub Action workflows.
This change introduces 6 different workflows accounting for all of the testing and analysis currently performed in Travis CI & Appveyor:

- Checking PHP & JS coding standards are followed
- Running the end-to-end test suite.
- Running QUnit tests on JavaScript files.
- Scanning for PHP compatibility issues with supported version.
- Running the PHPUnit test suite.
- Verifying NPM related tasks do not cause errors on Windows.

Additionally, a seventh workflow is included that will leave a "welcome" comment when a contributor opens their first pull request to the `wordpress-develop` mirror.

These workflows are currently in an experimental phase. For that reason, Travis CI and Appveyor will continue to run until all of the bugs can be worked out.

Props ayeshrajans, helen, ocean90, desrosj.
See #50401.

git-svn-id: https://develop.svn.wordpress.org/trunk@49162 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-15 19:40:33 +00:00
Sergey Biryukov
c0f41b5d3c Comments: Further remove unnecessary context switch in Walker_Comment.
Follow-up to [49157].

See #51533.

git-svn-id: https://develop.svn.wordpress.org/trunk@49160 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-15 15:24:57 +00:00
Sergey Biryukov
fee906ad14 Twenty Nineteen: Remove extra space from the comment link in TwentyNineteen_Walker_Comment.
Fixes #51533.

git-svn-id: https://develop.svn.wordpress.org/trunk@49159 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-15 15:22:42 +00:00
Sergey Biryukov
7bfe507dad Twenty Twenty: Remove extra space from the comment link in TwentyTwenty_Walker_Comment.
See #51533.

git-svn-id: https://develop.svn.wordpress.org/trunk@49158 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-15 15:11:43 +00:00
Sergey Biryukov
8bf847bdf4 Comments: Remove extra space from the comment link in Walker_Comment.
Props poena, mukesh27, SergeyBiryukov.
See #51533.

git-svn-id: https://develop.svn.wordpress.org/trunk@49157 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-15 15:05:09 +00:00
Timothy Jacobs
701dee26f1 REST API: Exclude custom site health capability check on multisite.
Super admins will always pass capability checks.

Follow up to [49154], [49155].
See #48105.


git-svn-id: https://develop.svn.wordpress.org/trunk@49156 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-15 02:26:33 +00:00
Timothy Jacobs
73fb2c137a REST API: Grant super admin to site health test user.
The current user needs to be a super admin to access Site Health on multisite.

Follow up to [49154].
See #48105.


git-svn-id: https://develop.svn.wordpress.org/trunk@49155 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-15 02:11:28 +00:00
Timothy Jacobs
efe06cdcea Site Health, REST API: Move async tests to REST API endpoints.
This provides more flexibility when writing tests and benefits from running in a front-end context which is necessary for some tests like checking that updates are supported. Additionally, this provides a more robust interface for developers who want to integrate with Site Health tests.

Because the `wp/v2` endpoint is reserved for modeling core entities, site health is registered in its own `wp-site-health/v1` namespace.

The existing ajax actions have been maintained for backward compatibility.

Props Clorith, chrisvanpatten, afragen, pokhriyal, TimothyBlynJacobs.
Fixes #48105.


git-svn-id: https://develop.svn.wordpress.org/trunk@49154 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-15 01:58:28 +00:00
Sergey Biryukov
50fa352cbb Docs: Improve description of the $email parameter in email_exists().
Follow-up to [49148].

Props garrett-eclipse.
See #51379.

git-svn-id: https://develop.svn.wordpress.org/trunk@49153 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-15 00:14:51 +00:00
Ian Dunn
52f2d0db81 Community Events: Update timezone-related @since tags to 5.5.2.
r49145 and r49146 were originally planned for 5.6 when they were committed, but are now planned for 5.5.2.

See #51130.


git-svn-id: https://develop.svn.wordpress.org/trunk@49152 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-14 21:33:10 +00:00
Dominik Schilling
d0ec93f293 I18N: Use wp.i18n for translatable strings in wp-admin/js/dashboard.js.
* Deprecate the `l10n` property on `communityEventsData`.
* Introduce `version` parameter for `deprecateL10nObject` and backfill the version for deprecated objects in 5.5.0.
* Add a noop version of `deprecateL10nObject` for QUnit testing.

Fixes #51498.

git-svn-id: https://develop.svn.wordpress.org/trunk@49151 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-14 21:11:09 +00:00
Helen Hou-Sandi
0aa3ade1fe Updates: Reduce secondary buttons for less visual complexity.
Props audrasjb, karmatosed.
Fixes #51523.


git-svn-id: https://develop.svn.wordpress.org/trunk@49150 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-14 20:25:17 +00:00
Helen Hou-Sandi
c8d94810d3 Admin Menu: Better wrapping for long menu item names.
Props munyagu, jagirbaheshwp, harshbarach, pratikkry, hareesh-pillai, naveenkharwar, mukesh27, chetan200891, dushanthi, worldweb, audrasjb, afercia, amolv, iqbalbary, davidbaumwald, sabernhardt, johnjamesjacoby, garrett-eclipse, garrett-eclipse.
Fixes #42201.


git-svn-id: https://develop.svn.wordpress.org/trunk@49149 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-14 19:51:12 +00:00
Sergey Biryukov
d011853b7b Users: Introduce email_exists filter, to complement username_exists.
Props garrett-eclipse, apermo, mukesh27, Mista-Flo, sebastian.pisula, mikelopez.
Fixes #51379. See #35509.

git-svn-id: https://develop.svn.wordpress.org/trunk@49148 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-14 19:02:22 +00:00
Ian Dunn
0fbe425a3e Community Events: Apply coding standards.
The previous commits intentionally didn't include these, because it would have added an unreasonable amount of diff noise.

See #51130


git-svn-id: https://develop.svn.wordpress.org/trunk@49147 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-14 18:20:40 +00:00
Ian Dunn
92aa799e89 Community Events: Display dates and times in the user's time zone.
Fixes #51130
Props sippis, hlashbrooke, audrasjb, Rarst, iandunn


git-svn-id: https://develop.svn.wordpress.org/trunk@49146 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-14 18:19:43 +00:00
Ian Dunn
92eba9720e Community Events: Trim events by Unix timestamp for accuracy.
The `date` and `end_date` fields are ''WP'' timestamps representing the venue's local time. As of meta:changeset:10270 (#meta4480), new `start_unix_timestamp` and `end_unix_timestamp` values are available, providing a proper ''Unix'' timestamp in the  UTC timezone. Using those is more precise, and removes the time window where the event has expired but still appears in the Events Widget.

To simplify the function, it now only accepts and returns the events themselves, rather than the entire response body.

See #51130
See #meta4480
Related: https://make.wordpress.org/core/2019/09/23/date-time-improvements-wp-5-3/


git-svn-id: https://develop.svn.wordpress.org/trunk@49145 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-14 18:17:55 +00:00
Sergey Biryukov
3a19ff15f9 General: Move wp_array_get() next to wp_array_slice_assoc(), for a bit more consistent placement.
Follow-up to [49135], [49143].

See #51461.

git-svn-id: https://develop.svn.wordpress.org/trunk@49144 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-14 02:14:34 +00:00
Sergey Biryukov
f3f53fb4e4 General: Move wp_array_get() from a separate file to wp-includes/functions.php, for consistency.
Add missing `@since` tag, adjust the DocBlock per the documentation standards.

Follow-up to [49135].

Props isabel_brison, ocean90.
Fixes #51461.

git-svn-id: https://develop.svn.wordpress.org/trunk@49143 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-14 02:08:54 +00:00
Sergey Biryukov
de89e7292e Administration: Make sure list table row actions in Extended view stay visible when a single row gets focus.
Follow-up to [48398], [48423], [48424], [48450], [48670].

Props ryelle.
Fixes #51516. See #49715.

git-svn-id: https://develop.svn.wordpress.org/trunk@49142 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-14 02:01:00 +00:00