Sergey Biryukov
dc305e9e0a
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 .
Built from https://develop.svn.wordpress.org/trunk@46148
git-svn-id: http://core.svn.wordpress.org/trunk@45960 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-16 09:58:56 +00:00
Sergey Biryukov
1060f7e167
Widgets: Introduce register_sidebar_defaults
filter for default arguments in register_sidebar()
.
...
Props patilvikasj, powerbuoy.
Fixes #48033 .
Built from https://develop.svn.wordpress.org/trunk@46147
git-svn-id: http://core.svn.wordpress.org/trunk@45959 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-16 09:13:54 +00:00
Sergey Biryukov
f3f1d530f4
Code Modernisation: Simplify some logic in apply_filters()
.
...
Props jrf.
See #47678 .
Built from https://develop.svn.wordpress.org/trunk@46146
git-svn-id: http://core.svn.wordpress.org/trunk@45958 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 12:04:55 +00:00
Sergey Biryukov
3b43f6dfbf
Code Modernisation: Replace call_user_func_array()
in tests/phpunit/tests/db.php
with dynamic function calls.
...
Props jrf.
See #47678 .
Built from https://develop.svn.wordpress.org/trunk@46145
git-svn-id: http://core.svn.wordpress.org/trunk@45957 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 11:56:54 +00:00
Sergey Biryukov
e6bbff13c5
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 .
Built from https://develop.svn.wordpress.org/trunk@46144
git-svn-id: http://core.svn.wordpress.org/trunk@45956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 11:53:56 +00:00
Sergey Biryukov
2a35b3e7df
Code Modernisation: Replace call_user_func_array()
in wp-includes/class-wp-walker.php
with dynamic function calls.
...
Props jrf.
See #47678 .
Built from https://develop.svn.wordpress.org/trunk@46143
git-svn-id: http://core.svn.wordpress.org/trunk@45955 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 11:50:55 +00:00
Sergey Biryukov
3daef6260b
Code Modernisation: Replace call_user_func_array()
in wp-cron.php
with a direct function call.
...
Props jrf.
See #47678 .
Built from https://develop.svn.wordpress.org/trunk@46142
git-svn-id: http://core.svn.wordpress.org/trunk@45954 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 11:48:54 +00:00
Sergey Biryukov
c32fb1dbee
Code Modernisation: Remove redundant call to func_get_arg()
in wp-includes/class-wp-rewrite.php
.
...
Props jrf.
See #47678 .
Built from https://develop.svn.wordpress.org/trunk@46141
git-svn-id: http://core.svn.wordpress.org/trunk@45953 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 11:47:54 +00:00
Sergey Biryukov
92ba2cc95d
Code Modernisation: Remove redundant calls to func_get_arg()
in wp-includes/class-wp-admin-bar.php
.
...
Props jrf.
See #47678 .
Built from https://develop.svn.wordpress.org/trunk@46140
git-svn-id: http://core.svn.wordpress.org/trunk@45952 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 11:46:54 +00:00
Sergey Biryukov
60f027a378
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 .
Built from https://develop.svn.wordpress.org/trunk@46139
git-svn-id: http://core.svn.wordpress.org/trunk@45951 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 11:45:56 +00:00
Sergey Biryukov
8ee3790851
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 .
Built from https://develop.svn.wordpress.org/trunk@46138
git-svn-id: http://core.svn.wordpress.org/trunk@45950 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 11:41:55 +00:00
Sergey Biryukov
f166554882
Code Modernisation: Replace call_user_func_array()
in wp-admin/includes/template.php
with a dynamic function call.
...
Props jrf.
See #47678 .
Built from https://develop.svn.wordpress.org/trunk@46137
git-svn-id: http://core.svn.wordpress.org/trunk@45949 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 11:35:56 +00:00
Sergey Biryukov
7c370fa9d0
Code Modernisation: Replace call_user_func_array()
in wp-admin/includes/ajax-actions.php
with a dynamic function call.
...
Props jrf.
See #47678 .
Built from https://develop.svn.wordpress.org/trunk@46136
git-svn-id: http://core.svn.wordpress.org/trunk@45948 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 11:34:57 +00:00
Sergey Biryukov
4bcec84309
Code Modernisation: Replace call_user_func_array()
in wp-includes/post-template.php
with a dynamic function call.
...
Props jrf.
See #47678 .
Built from https://develop.svn.wordpress.org/trunk@46135
git-svn-id: http://core.svn.wordpress.org/trunk@45947 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 11:32:54 +00:00
Sergey Biryukov
4b3df8e846
Code Modernisation: Replace call_user_func_array()
in wp-includes/nav-menu-template.php
with a dynamic function call.
...
Props jrf.
See #47678 .
Built from https://develop.svn.wordpress.org/trunk@46134
git-svn-id: http://core.svn.wordpress.org/trunk@45946 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 11:31:57 +00:00
Sergey Biryukov
6e39938fb5
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 .
Built from https://develop.svn.wordpress.org/trunk@46133
git-svn-id: http://core.svn.wordpress.org/trunk@45945 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 11:27:55 +00:00
Sergey Biryukov
d55f1f81c7
Code Modernisation: Replace call_user_func_array()
in wp-includes/capabilities.php
with a direct function call.
...
Props jrf.
See #47678 .
Built from https://develop.svn.wordpress.org/trunk@46132
git-svn-id: http://core.svn.wordpress.org/trunk@45944 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 11:23:56 +00:00
Sergey Biryukov
30fe3f5d4f
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 .
Built from https://develop.svn.wordpress.org/trunk@46131
git-svn-id: http://core.svn.wordpress.org/trunk@45943 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 11:12:55 +00:00
Sergey Biryukov
7093392099
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 .
Built from https://develop.svn.wordpress.org/trunk@46130
git-svn-id: http://core.svn.wordpress.org/trunk@45942 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 11:11:56 +00:00
Sergey Biryukov
efe18c3604
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 .
Built from https://develop.svn.wordpress.org/trunk@46129
git-svn-id: http://core.svn.wordpress.org/trunk@45941 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 11:09:54 +00:00
Sergey Biryukov
6a039a5731
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 .
Built from https://develop.svn.wordpress.org/trunk@46128
git-svn-id: http://core.svn.wordpress.org/trunk@45940 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 11:06:55 +00:00
Sergey Biryukov
9e2c6eb624
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 .
Built from https://develop.svn.wordpress.org/trunk@46127
git-svn-id: http://core.svn.wordpress.org/trunk@45939 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 11:04:55 +00:00
Sergey Biryukov
7a6d74e28a
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 .
Built from https://develop.svn.wordpress.org/trunk@46126
git-svn-id: http://core.svn.wordpress.org/trunk@45938 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 10:45:56 +00:00
Sergey Biryukov
340b7b53c8
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 .
Built from https://develop.svn.wordpress.org/trunk@46125
git-svn-id: http://core.svn.wordpress.org/trunk@45937 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 10:42:54 +00:00
Sergey Biryukov
300b14e1ca
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 .
Built from https://develop.svn.wordpress.org/trunk@46124
git-svn-id: http://core.svn.wordpress.org/trunk@45936 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 10:36:56 +00:00
Sergey Biryukov
654f8a8677
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 .
Built from https://develop.svn.wordpress.org/trunk@46123
git-svn-id: http://core.svn.wordpress.org/trunk@45935 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 10:33:55 +00:00
Sergey Biryukov
7322d3f35e
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 .
Built from https://develop.svn.wordpress.org/trunk@46122
git-svn-id: http://core.svn.wordpress.org/trunk@45934 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 10:31:54 +00:00
Sergey Biryukov
d46f9b4fb8
Coding Standards: Fix WPCS issue in [46120].
...
See #47820 .
Built from https://develop.svn.wordpress.org/trunk@46121
git-svn-id: http://core.svn.wordpress.org/trunk@45933 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 02:07:55 +00:00
Sergey Biryukov
7a3e224e8d
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 .
Built from https://develop.svn.wordpress.org/trunk@46120
git-svn-id: http://core.svn.wordpress.org/trunk@45932 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 01:29:54 +00:00
Sergey Biryukov
142efedee0
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 .
Built from https://develop.svn.wordpress.org/trunk@46119
git-svn-id: http://core.svn.wordpress.org/trunk@45931 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 01:18:55 +00:00
Sergey Biryukov
8988c1ce38
Mail: Add a unit test to make sure wp_mail()
does not duplicate the MIME-Version
header added automatically by PHPMailer.
...
See #43542 .
Built from https://develop.svn.wordpress.org/trunk@46118
git-svn-id: http://core.svn.wordpress.org/trunk@45930 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-14 21:35:57 +00:00
Sergey Biryukov
8e29221da4
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 .
Built from https://develop.svn.wordpress.org/trunk@46117
git-svn-id: http://core.svn.wordpress.org/trunk@45929 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-14 21:00:56 +00:00
Sergey Biryukov
c5fe7878ec
Coding Standards: Fix WPCS issue in [46115].
...
See #43542 .
Built from https://develop.svn.wordpress.org/trunk@46116
git-svn-id: http://core.svn.wordpress.org/trunk@45928 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-14 20:42:56 +00:00
Sergey Biryukov
18bf922527
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 .
Built from https://develop.svn.wordpress.org/trunk@46115
git-svn-id: http://core.svn.wordpress.org/trunk@45927 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-14 20:14:54 +00:00
Aaron Jorbin
232d97425c
Build/Test Tools: add php info to travis output
...
Fixes #48041 .
Built from https://develop.svn.wordpress.org/trunk@46114
git-svn-id: http://core.svn.wordpress.org/trunk@45926 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-14 19:28:55 +00:00
Aaron Jorbin
ecd822a880
Comment out magic quote functions
...
Follow up to r46112.
See: #47751,#47783, #48040 .
Built from https://develop.svn.wordpress.org/trunk@46113
git-svn-id: http://core.svn.wordpress.org/trunk@45925 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-14 19:23:55 +00:00
Aaron Jorbin
1ed691f574
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 .
Built from https://develop.svn.wordpress.org/trunk@46112
git-svn-id: http://core.svn.wordpress.org/trunk@45924 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-14 19:07:57 +00:00
jorgefilipecosta
b7fbf7d373
Block Editor: Backport block styles server functions from block editor.
...
This commit backports the block styles functionality added to the block editor in https://github.com/WordPress/gutenberg/pull/16356 .
Props: youknowriad, aduth, swissspidy.
Fixes #48039 .
Built from https://develop.svn.wordpress.org/trunk@46111
git-svn-id: http://core.svn.wordpress.org/trunk@45923 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-14 18:21:54 +00:00
jorgefilipecosta
099eb0578e
Block Editor: Add preloading of autosaves.
...
With the introduction of https://github.com/WordPress/gutenberg/pull/7945 , the block editor requests autosave data when the editor is loaded. This can be optimized by preloading the request server-side and then passing the request data to the client using the preloading mechanism in editor-form-blocks.php.
Props: talldanwp, aduth.
Built from https://develop.svn.wordpress.org/trunk@46110
git-svn-id: http://core.svn.wordpress.org/trunk@45922 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-14 16:47:54 +00:00
Sergey Biryukov
8316af9198
Bootstrap/Load: Allow charset to be passed to the wp_die()
function.
...
Props mohsinrasool, spacedmonkey, socalchristina.
Fixes #46666 .
Built from https://develop.svn.wordpress.org/trunk@46109
git-svn-id: http://core.svn.wordpress.org/trunk@45921 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-14 15:42:56 +00:00
Sergey Biryukov
0863695da8
Coding Standards: Fix WPCS issue in [46107].
...
See #46631 .
Built from https://develop.svn.wordpress.org/trunk@46108
git-svn-id: http://core.svn.wordpress.org/trunk@45920 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-14 15:19:54 +00:00
Sergey Biryukov
f9b87e88ba
HTTP API: Add a unit test for get_status_header_desc()
.
...
Props pbearne.
Fixes #46631 .
Built from https://develop.svn.wordpress.org/trunk@46107
git-svn-id: http://core.svn.wordpress.org/trunk@45919 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-14 14:54:56 +00:00
Sergey Biryukov
42079f34a9
Site Health: Modify the grading indicator to remove percentage score in favor of a "Good" or "Should be improved" status.
...
This removes arbitrary confusion about what the numbers mean.
Props Clorith, hedgefield, Cybr, arena, DavidAnderson, earnjam, daveshine, Otto42, azaozz, asadkn, KARTHOST, tigertech, maximejobin, johnbillion, raboodesign, ramiy, afragen.
Fixes #47046 .
Built from https://develop.svn.wordpress.org/trunk@46106
git-svn-id: http://core.svn.wordpress.org/trunk@45918 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-14 14:29:56 +00:00
Aaron Jorbin
dd3ad3ac51
GENERAL: Remove magic quote functions
...
The path to magic quote sanity took a fun and exciting turn: PHP core removed it and WordPress updated the minimum version.
For the formally external pclzip, the code is commented out to make investigating easier and in case we ever need to merge upstream (if that still exists) changes.
Props ayeshrajans, jrf, jorbin.
See #47783 .
Fixes #18322 .
Built from https://develop.svn.wordpress.org/trunk@46105
git-svn-id: http://core.svn.wordpress.org/trunk@45917 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-13 22:21:01 +00:00
desrosj
8a2bbf777a
Correct the version number specified in [46102].
...
See #45361 .
Built from https://develop.svn.wordpress.org/trunk@46104
git-svn-id: http://core.svn.wordpress.org/trunk@45916 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-13 18:55:56 +00:00
Adam Silverstein
a3eba2c201
Login and Registration: reset password - ensure submit button disabled when field empty.
...
Fix an issue where the submit button was enabled with an empty password when the user previously checked "Confirm use of weak password" for a weak password, then cleared the password field.
Props henry.wright.
Fixes #47924 .
Built from https://develop.svn.wordpress.org/trunk@46103
git-svn-id: http://core.svn.wordpress.org/trunk@45915 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-13 18:30:55 +00:00
desrosj
7bbce99655
Menus: Nav menu locations should not be integers.
...
When nav menu location slugs are integers, some hard to debug results can occur. `register_nav_menus()` utilizes `array_merge()` which renumbers numeric indexes, starting from 0. Because of this, numeric menu locations will almost always be changed.
This change introduces a `_doing_it_wrong()` notice to inform developers that nav menu locations should always be strings.
Props audrasjb, desrosj, welcher.
Fixes #45361 .
Built from https://develop.svn.wordpress.org/trunk@46102
git-svn-id: http://core.svn.wordpress.org/trunk@45914 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-13 17:58:55 +00:00
Sergey Biryukov
55378bd295
REST API: Use correct parameter name in rest_validate_value_from_schema()
error messages.
...
Props manzoorwanijk.
Fixes #47905 .
Built from https://develop.svn.wordpress.org/trunk@46101
git-svn-id: http://core.svn.wordpress.org/trunk@45913 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-13 03:06:55 +00:00
Adam Silverstein
67fd6e281f
Multisite: improve sites_pre_query
and networks_pre_query
filters, avoiding db queries.
...
Improve the `pre_query` filters in multisite classes introduced in r44983. Return (non null) values immediately,
avoiding the database queries entirely, similar to other `pre_query` filters.
Props spacedmonkey, SergeyBiryukov, felipeelia.
Fixes #47599 .
Built from https://develop.svn.wordpress.org/trunk@46100
git-svn-id: http://core.svn.wordpress.org/trunk@45912 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-12 22:17:55 +00:00
K. Adam White
c148f0aa55
REST API: Accept string path in rest_ensure_request.
...
Update `rest_ensure_request()` to accept a string path, permitting a string path to be passed to `rest_do_request()` as is indicated (previously inaccurately) in that method's PHPDoc.
Props TimothyBlynJacobs, kadamwhite.
Fixes #40614 .
Built from https://develop.svn.wordpress.org/trunk@46099
git-svn-id: http://core.svn.wordpress.org/trunk@45911 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-12 21:47:57 +00:00