Commit Graph

40304 Commits

Author SHA1 Message Date
Jake Spurlock
b8533a19b8 Accesibility: Replace wp-a11y.js with @wordpress/a11y package
Continuation of [46167]. This fixes the tests that ended up broken following the previous commit.

We've extracted wp-includes/wp-a11y.js to a reusable package wordpress/a11y which is published on NPM. Let's make sure this package is also 
used in WordPress core. Once all the JavaScript is built using webpack, we can also import this package wherever it is used and configure 
webpack to load is an external.

Props, garrett-eclipse

Fixes #45066



git-svn-id: https://develop.svn.wordpress.org/trunk@46169 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-18 22:29:53 +00:00
Andrea Fercia
9d339b4d7b Media: remove leftover test string change after [45499].
Props imath, audrasjb.
Fixes #48067.


git-svn-id: https://develop.svn.wordpress.org/trunk@46168 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-18 19:32:32 +00:00
Jake Spurlock
8029e23ffe Accessibility: Replace wp-a11y.js with @wordpress/a11y package
We've extracted wp-includes/wp-a11y.js to a reusable package wordpress/a11y which is published on NPM. Let's make sure this package is also used in WordPress core. Once all the JavaScript is built using webpack, we can also import this package wherever it is used and configure webpack to load is an external.

Props omarreiss, herregroen, desrosj, ocean90, afercia, sstoqnov



git-svn-id: https://develop.svn.wordpress.org/trunk@46167 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-18 17:40:35 +00:00
Aaron Jorbin
b7df2ea08c External Library: Update getid3 to 1.9.18
Follow up to r46112 as getid3 has tagged an official release.

Changes: 00f3fbfd77...v1.9.18

Props desrosj, jkitchen.
Fixes #47751 #40883 #43836.


git-svn-id: https://develop.svn.wordpress.org/trunk@46166 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-18 14:53:01 +00:00
SergeyBiryukov
baaaef5b63 Bundled Themes: Declare HTML5 support for scripts and styles.
Fixes #42804.

git-svn-id: https://develop.svn.wordpress.org/trunk@46165 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-18 14:50:02 +00:00
Sergey Biryukov
5fdf48c0ec Script Loader: Introduce HTML5 support for scripts and styles.
When a theme declares HTML5 support for script and styles via `add_theme_support( 'html5', array( 'script', 'style' ) )`, the `type="text/javascript"` and `type="text/css"` attributes are omitted.

These attributes are unnecessary in HTML5 and cause warnings in the W3C Markup Validation Service.

Props sasiddiqui, swissspidy, knutsp, SergeyBiryukov.
See #42804.

git-svn-id: https://develop.svn.wordpress.org/trunk@46164 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-18 14:49:30 +00:00
Andrea Fercia
0dbd752500 Accessibility: Add aria-current to the Archives, Categories, and Recent Posts widgets output.
The `aria-current` attribute is a simple, effective, way to help assistive technology users orientate themselves within a list of items.

Continues the introduction in core of the `aria-current` attribute after [41359] and following changes.

Props audrasjb, melchoyce.
Fixes #47094.


git-svn-id: https://develop.svn.wordpress.org/trunk@46163 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-18 12:24:35 +00:00
John Blackbourn
4b3eb36a5b Docs: Improve docs for upload and wp_die() related functions.
See #47110 


git-svn-id: https://develop.svn.wordpress.org/trunk@46162 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-17 21:02:22 +00:00
Jonathan Desrosiers
45f1fbbceb Docs: Add missing descriptions for functions in wp-admin/update-core.php.
Also, fix the `@since` annotation added in [45480] to include the correct version.

Props SergeyBiryukov, ajayghaghretiya1.
Fixes #47424.

git-svn-id: https://develop.svn.wordpress.org/trunk@46161 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-17 20:42:57 +00:00
Jonathan Desrosiers
65ec280a54 Posts, Post Types: Allow support arguments to be specified when registering post types.
The `add_post_type_support()` function accepts an optional third parameter that allows extra arguments to be supplied to configure post type support for a given feature. However, because of how `register_post_type()` and `WP_Post_Type->add_supports()` work, it is currently impossible to pass these additional arguments when initially registering a post type with `register_post_type()`.

This change makes it possible to supply additional arguments for a feature using the `supports` argument of `register_post_type()`.

Props MaximeCulea, seuser, desrosj, johnbillion.
Fixes #40413.

git-svn-id: https://develop.svn.wordpress.org/trunk@46160 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-17 19:57:18 +00:00
Jonathan Desrosiers
5e38f8219b Build/Test Tools: Improve test coverage for wp_validate_boolean().
This change also reworks the test class to use a data provider.

Props pbearne, desrosj
Fixes #39868

git-svn-id: https://develop.svn.wordpress.org/trunk@46159 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-17 18:48:27 +00:00
Adam Silverstein
5a200bdb7a Build/Test Tools: fix source map loading in Firefox.
Fix an issue that prevented source maps from loading correctly in Firefox developer tools. Matches a fix introduced in Gutenberg build in PR:17024.

Props pierlo, andraganescu.
Fixes #47870.



git-svn-id: https://develop.svn.wordpress.org/trunk@46158 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-17 17:26:38 +00:00
Adam Silverstein
823b0d2c64 External Libraries: Update Backbone.js to 1.4.0.
Upgrade Backbone to the latest stable version. Fix some issues in Media with `listenTo` which changed in this version, see https://backbonejs.org/#changelog.

Props desrosj, priyankkpatel, pierlo.
Fixes #47478.



git-svn-id: https://develop.svn.wordpress.org/trunk@46157 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-17 17:18:32 +00:00
Sergey Biryukov
ed25bc3080 Docs: Correct accepted values for search_columns parameter in WP_User_Query.
Props meloniq.
Fixes #48057.

git-svn-id: https://develop.svn.wordpress.org/trunk@46156 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-17 15:42:51 +00:00
Jonathan Desrosiers
352665d6df General: Ensure the arguments passed to implode() are in the correct order.
The `implode()` function accepts two. parameters, `$glue` and `$pieces`. For historical reasons, these parameters have been accepted in any order, though it was recommended that the documented order of `$glue, $pieces` be used.

Starting in PHP 7.4, specifying the parameters in the reverse order will trigger a deprecation notice with the plan to remove this tolerance in PHP 8.0.

This change fixes the occurrences of reversed arguments in Core with the exception of those contained in included external libraries. These will be handled separately.

Props jrf, jorbin.
See #47746.

git-svn-id: https://develop.svn.wordpress.org/trunk@46155 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-17 13:39:15 +00:00
Sergey Biryukov
5928234d05 Date/Time: Introduce get_post_datetime() to retrieve post published or modified time as a DateTimeImmutable object instance.
Introduce `get_post_timestamp()` to retrieve post published or modified time as a Unix timestamp.

Use `get_post_datetime()` in `get_post_time()` and `get_post_modified_time()` to return correct GMT time if default timezone is changed from UTC.

Props Rarst, johnregan3.
Fixes #25002.

git-svn-id: https://develop.svn.wordpress.org/trunk@46154 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-17 11:13:25 +00:00
John James Jacoby
7cbb1f32a3 Network Admin: Allow Sites to have filterable States in List Table rows.
This change introduces a new `site_states()` method to the Sites List Table class (with a new `display_site_states` filter inside of it) following the pattern popularized in other List Table classes before it (Posts, Media, etc...)

Fixes #37684. Props mnelson4, pbiron, jeremyfelt, johnjamesjacoby.

git-svn-id: https://develop.svn.wordpress.org/trunk@46153 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-16 23:33:45 +00:00
Sergey Biryukov
9218e2cc50 Docs: Improve documentation for get_bookmarks().
Props pbiron.
Fixes #48053.

git-svn-id: https://develop.svn.wordpress.org/trunk@46152 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-16 19:54:15 +00:00
Sergey Biryukov
444834f5a0 Site Health: Add a link to "Debugging in WordPress" support article to fatal PHP error handler's default message.
Props garrett-eclipse, tobifjellner, dkarfa, hareesh-pillai.
Fixes #47681.

git-svn-id: https://develop.svn.wordpress.org/trunk@46151 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-16 17:22:32 +00:00
Sergey Biryukov
fd31d7f872 Docs: Improve @return value description for wp_xmlrpc_server::minimum_args().
See #47110.

git-svn-id: https://develop.svn.wordpress.org/trunk@46150 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-16 16:31:13 +00:00
Sergey Biryukov
31fa37f06d Code Modernisation: Remove redundant PHP 4 code from do_action().
As of PHP 5, objects are always passed by reference, so this has not been needed for quite some time.

Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46149 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-16 14:47:53 +00:00
Sergey Biryukov
ea350997e6 XML-RPC: Avoid a PHP warning in wp_xmlrpc_server::minimum_args() if $args is not an array.
Correct the documentation to clarify that array is the only acceptable type for `$args`.

Props bitcomplex, dkarfa.
Fixes #48046.

git-svn-id: https://develop.svn.wordpress.org/trunk@46148 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-16 09:57:30 +00:00
Sergey Biryukov
f360f879f8 Widgets: Introduce register_sidebar_defaults filter for default arguments in register_sidebar().
Props patilvikasj, powerbuoy.
Fixes #48033.

git-svn-id: https://develop.svn.wordpress.org/trunk@46147 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-16 09:13:01 +00:00
Sergey Biryukov
209666d332 Code Modernisation: Simplify some logic in apply_filters().
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46146 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 12:03:04 +00:00
Sergey Biryukov
802c23e059 Code Modernisation: Replace call_user_func_array() in tests/phpunit/tests/db.php with dynamic function calls.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46145 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:55:42 +00:00
Sergey Biryukov
1ace25088f Code Modernisation: Replace call_user_func_array() in various __call() methods with dynamic function calls.
The callback in these functions is always checked against a limited list of valid callbacks that can be safely changed to dynamic function calls.

Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46144 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:53:01 +00:00
Sergey Biryukov
1418bd0ffa Code Modernisation: Replace call_user_func_array() in wp-includes/class-wp-walker.php with dynamic function calls.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46143 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:49:51 +00:00
Sergey Biryukov
927098e5aa Code Modernisation: Replace call_user_func_array() in wp-cron.php with a direct function call.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46142 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:47:38 +00:00
Sergey Biryukov
0432a9f6b5 Code Modernisation: Remove redundant call to func_get_arg() in wp-includes/class-wp-rewrite.php.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46141 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:46:44 +00:00
Sergey Biryukov
0521e61398 Code Modernisation: Remove redundant calls to func_get_arg() in wp-includes/class-wp-admin-bar.php.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46140 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:45:45 +00:00
Sergey Biryukov
d4d853ee3f Code Modernisation: Replace call_user_func_array() in combination with an empty array in wp-includes/class-wp-hook.php with call_user_func().
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46139 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:44:09 +00:00
Sergey Biryukov
fd05ea0de9 Code Modernisation: Replace call_user_func_array() in wp-admin/includes/widgets.php and associated unit tests with a direct function call.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46138 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:40:08 +00:00
Sergey Biryukov
751f69be42 Code Modernisation: Replace call_user_func_array() in wp-admin/includes/template.php with a dynamic function call.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46137 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:34:23 +00:00
Sergey Biryukov
f16a56ca41 Code Modernisation: Replace call_user_func_array() in wp-admin/includes/ajax-actions.php with a dynamic function call.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46136 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:33:20 +00:00
SergeyBiryukov
e17d5accc3 Code Modernisation: Replace call_user_func_array() in wp-includes/post-template.php with a dynamic function call.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46135 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:31:02 +00:00
Sergey Biryukov
45827d6e7a Code Modernisation: Replace call_user_func_array() in wp-includes/nav-menu-template.php with a dynamic function call.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46134 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:30:25 +00:00
Sergey Biryukov
db2bc9a167 Code Modernisation: Replace call_user_func_array() in wp-includes/class-wp-customize-*.php with direct function calls in combination with the spread operator.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46133 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:26:16 +00:00
Sergey Biryukov
416e3d6c10 Code Modernisation: Replace call_user_func_array() in wp-includes/capabilities.php with a direct function call.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46132 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:22:51 +00:00
Sergey Biryukov
49de2b7312 Code Modernisation: Introduce the spread operator in wp-admin/includes/media.php.
Rather than relying `func_get_args()` to retrieve arbitrary function arguments, we can now use the spread operator to assign them directly to a variable.

Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46131 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:11:14 +00:00
Sergey Biryukov
752c36bbf4 Code Modernisation: Introduce the spread operator in wp-admin/includes/dashboard.php.
Rather than relying `func_get_args()` to retrieve arbitrary function arguments, we can now use the spread operator to assign them directly to a variable.

Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46130 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:10:17 +00:00
SergeyBiryukov
24a586b97f Code Modernisation: Introduce the spread operator in wp-includes/deprecated.php.
Rather than relying `func_get_args()` to retrieve arbitrary function arguments, we can now use the spread operator to assign them directly to a variable.

While these functions are deprecated, they can still get a minor performance boost in case they are being called.

Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46129 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:08:02 +00:00
Sergey Biryukov
cb1f496cce Code Modernisation: Introduce the spread operator in wp-includes/formatting.php.
Rather than relying `func_get_args()` to retrieve arbitrary function arguments, we can now use the spread operator to assign them directly to a variable.

Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46128 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:05:31 +00:00
Sergey Biryukov
3ae54e84da Code Modernisation: Introduce the spread operator in tests/phpunit/*.
Rather than relying `func_get_args()` to retrieve arbitrary function arguments, we can now use the spread operator to assign them directly to a variable.

Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46127 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:03:45 +00:00
Sergey Biryukov
516f528421 Code Modernisation: Introduce the spread operator in wp-includes/functions.php.
Rather than relying `func_get_args()` to retrieve arbitrary function arguments, we can now use the spread operator to assign them directly to a variable.

Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46126 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 10:44:58 +00:00
Sergey Biryukov
af246a6797 Code Modernisation: Introduce the spread operator in wp-admin/includes/class-*-upgrader-skin.php.
Rather than relying `func_get_args()` to retrieve arbitrary function arguments, we can now use the spread operator to assign them directly to a variable.

Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46125 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 10:41:03 +00:00
Sergey Biryukov
1431a7a39f Code Modernisation: Introduce the spread operator in wp-includes/class-wp-dependency.php.
Rather than relying `func_get_args()` to retrieve arbitrary function arguments, we can now use the spread operator to assign them directly to a variable.

Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46124 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 10:35:03 +00:00
Sergey Biryukov
e5a17836c7 Code Modernisation: Introduce the spread operator in wp-includes/category-template.php.
Rather than relying `func_get_args()` to retrieve arbitrary function arguments, we can now use the spread operator to assign them directly to a variable.

Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46123 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 10:32:54 +00:00
Sergey Biryukov
812033f092 Code Modernisation: Use the spread operator in wp_register_sidebar_widget().
Rather than relying `func_get_args()` to retrieve arbitrary function arguments, we can now use the spread operator to assign them directly to a variable.

Missed in [45629].

Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46122 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 10:30:16 +00:00
Sergey Biryukov
355cdce6b7 Coding Standards: Fix WPCS issue in [46120].
See #47820.

git-svn-id: https://develop.svn.wordpress.org/trunk@46121 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 02:06:07 +00:00
Sergey Biryukov
7b60544cce Docs: Clarify in update_option() description that it's plugin author's responsibility to check the current user's capabilities before saving any option changes.
Props dinhtungdu, lllor.
Fixes #47820.

git-svn-id: https://develop.svn.wordpress.org/trunk@46120 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 01:28:51 +00:00