WordPress.org

Make WordPress Core

Ticket #47678: 47678-add_query_args.patch

File 47678-add_query_args.patch, 942 bytes (added by jrf, 7 months ago)

Use spread operator in add_query_args()

  • src/wp-includes/functions.php

    From 83b1f1e5cbc16713de925c9debb17415f9ade761 Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Thu, 18 Jul 2019 06:19:59 +0200
    Subject: [PATCH] Use spread operator in add_query_args()
    
    ---
     src/wp-includes/functions.php | 3 +--
     1 file changed, 1 insertion(+), 2 deletions(-)
    
    diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php
    index a66b3fa406..65c01532bf 100644
    a b function _http_build_query( $data, $prefix = null, $sep = null, $key = '', $urle 
    928928 * @param string       $url   Optional. A URL to act upon.
    929929 * @return string New URL query string (unescaped).
    930930 */
    931 function add_query_arg() {
    932         $args = func_get_args();
     931function add_query_arg( ...$args ) {
    933932        if ( is_array( $args[0] ) ) {
    934933                if ( count( $args ) < 2 || false === $args[1] ) {
    935934                        $uri = $_SERVER['REQUEST_URI'];