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
This commit is contained in:
Sergey Biryukov 2019-09-15 10:45:56 +00:00
parent 340b7b53c8
commit 7a6d74e28a
2 changed files with 2 additions and 3 deletions

View File

@ -1040,8 +1040,7 @@ function _http_build_query( $data, $prefix = null, $sep = null, $key = '', $urle
* @param string $url Optional. A URL to act upon.
* @return string New URL query string (unescaped).
*/
function add_query_arg() {
$args = func_get_args();
function add_query_arg( ...$args ) {
if ( is_array( $args[0] ) ) {
if ( count( $args ) < 2 || false === $args[1] ) {
$uri = $_SERVER['REQUEST_URI'];

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.3-alpha-46125';
$wp_version = '5.3-alpha-46126';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.