Make WordPress Core

Changeset 63395


Ignore:
Timestamp:
08/28/2026 10:28:25 PM (7 days ago)
Author:
SergeyBiryukov
Message:

Code Quality: Remove redundant closure parameter in WP_User::has_cap().

This was originally added to avoid an ArgumentCountError from the array_all() polyfill, however, that is only raised for missing required arguments. Passing extra arguments to a closure is fine in PHP — they are ignored.

Follow-up to [62553].

Props Soean.
See #65818.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-user.php

    r63383 r63395  
    833833
    834834                // Must have ALL requested caps.
    835                 return array_all( (array) $caps, fn( $cap, $key ) => ! empty( $capabilities[ $cap ] ) );
     835                return array_all( (array) $caps, fn( $cap ) => ! empty( $capabilities[ $cap ] ) );
    836836        }
    837837
Note: See TracChangeset for help on using the changeset viewer.