WordPress.org

Make WordPress Core

Ticket #47678: 47678-map_meta_cap.patch

File 47678-map_meta_cap.patch, 880 bytes (added by jrf, 9 months ago)

Use spread operator in map_meta_cap()

  • src/wp-includes/capabilities.php

    From e02450fe2cfe9363734603773e906dd436242722 Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Thu, 11 Jul 2019 11:07:42 +0200
    Subject: [PATCH] Use spread operator in map_meta_cap()
    
    ---
     src/wp-includes/capabilities.php | 3 +--
     1 file changed, 1 insertion(+), 2 deletions(-)
    
    diff --git a/src/wp-includes/capabilities.php b/src/wp-includes/capabilities.php
    index 44a12ca350..c9c91848c2 100644
    a b  
    3333 * @param mixed  ...$args Optional further parameters, typically starting with an object ID.
    3434 * @return array Actual capabilities for meta capability.
    3535 */
    36 function map_meta_cap( $cap, $user_id ) {
    37         $args = array_slice( func_get_args(), 2 );
     36function map_meta_cap( $cap, $user_id, ...$args ) {
    3837        $caps = array();
    3938
    4039        switch ( $cap ) {