Changeset 45623
- Timestamp:
- 07/11/2019 11:47:56 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-user.php
r45590 r45623 739 739 * the given capability for that object. 740 740 */ 741 public function has_cap( $cap ) {741 public function has_cap( $cap, ...$args ) { 742 742 if ( is_numeric( $cap ) ) { 743 743 _deprecated_argument( __FUNCTION__, '2.0.0', __( 'Usage of user levels is deprecated. Use capabilities instead.' ) ); … … 745 745 } 746 746 747 $args = array_slice( func_get_args(), 1 ); 748 $args = array_merge( array( $cap, $this->ID ), $args ); 749 $caps = call_user_func_array( 'map_meta_cap', $args ); 747 $caps = map_meta_cap( $cap, $this->ID, ...$args ); 750 748 751 749 // Multisite super admin has all caps by definition, Unless specifically denied. … … 756 754 return true; 757 755 } 756 757 // Maintain BC for the argument passed to the "user_has_cap" filter. 758 $args = array_merge( array( $cap, $this->ID ), $args ); 758 759 759 760 /**
Note: See TracChangeset
for help on using the changeset viewer.