Commit Graph

40346 Commits

Author SHA1 Message Date
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
Sergey Biryukov
317da56a37 Site Health: Show a more specific fatal error message when in Recovery Mode with headers already sent.
Props garrett-eclipse, TimothyBlynJacobs, mukesh27, marybaum, afragen, Clorith, mdwolinski, SergeyBiryukov.
Fixes #47321.

git-svn-id: https://develop.svn.wordpress.org/trunk@46119 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 01:17:24 +00:00
Sergey Biryukov
7b8c666b72 Mail: Add a unit test to make sure wp_mail() does not duplicate the MIME-Version header added automatically by PHPMailer.
See #43542.

git-svn-id: https://develop.svn.wordpress.org/trunk@46118 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-14 21:34:51 +00:00
Sergey Biryukov
3ac6f6a8f8 Bundled Themes: Update the message shown when a comment is awaiting moderation.
If the commenter doesn't have cookies set, they won't see the comment preview again. Showing an expanded message will help offset any confusion if they revisit the site later, and their comment is still in moderation, but they can't see it anymore.

Props birgire, superpoincare.
Fixes #47461. See #43857.

git-svn-id: https://develop.svn.wordpress.org/trunk@46117 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-14 20:59:29 +00:00
Sergey Biryukov
65b4c64440 Coding Standards: Fix WPCS issue in [46115].
See #43542.

git-svn-id: https://develop.svn.wordpress.org/trunk@46116 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-14 20:41:48 +00:00
Sergey Biryukov
848a329478 Mail: Avoid setting duplicate MIME-Version and X-Mailer headers in wp_mail(), they are added automatically by PHPMailer.
Props lbenicio, junktrunk, danieltj, studyboi, bennemann.
Fixes #43542.

git-svn-id: https://develop.svn.wordpress.org/trunk@46115 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-14 20:13:37 +00:00
Aaron Jorbin
4a0f1f2a5a Build/Test Tools: add php info to travis output
Fixes #48041.


git-svn-id: https://develop.svn.wordpress.org/trunk@46114 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-14 19:27:46 +00:00
Aaron Jorbin
926bcf1278 Comment out magic quote functions
Follow up to r46112.

See: #47751,#47783, #48040.


git-svn-id: https://develop.svn.wordpress.org/trunk@46113 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-14 19:22:50 +00:00
Aaron Jorbin
43fd102495 Update getID3 library to fix issues with PHP7.4
Updates to trunk version that includes fixes for PHP7.4

Changelog:
https://github.com/JamesHeinrich/getID3/compare/v1.9.14...00f3fbfd77e583099ca70a3cf0bc092e113d2b20

See: #47751,#47783.
Fixes: #48040.



git-svn-id: https://develop.svn.wordpress.org/trunk@46112 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-14 19:06:09 +00:00