public function filter_map_meta_cap( array $required_caps, $cap, $user_id, array $args ) {
		if ( ! is_multisite() ) {
			return $required_caps;
		}

		if ( ! is_super_admin( $user_id ) ) {
			return $required_caps;
		}

		$trace  = new QM_Backtrace();
		$result = ( ! in_array( 'do_not_allow', $required_caps, true ) );

		array_unshift( $args, $user_id );
		array_unshift( $args, $cap );

		$this->data['caps'][] = array(
			'args'   => $args,
			'trace'  => $trace,
			'result' => $result,
		);

		return $required_caps;
	}
public function filter_map_meta_cap( array $required_caps, $cap, $user_id, array $args ) {
		if ( ! is_multisite() ) {
			return $required_caps;
		}

		if ( ! is_super_admin( $user_id ) ) {
			return $required_caps;
		}

		$trace  = new QM_Backtrace();
		$result = ( ! in_array( 'do_not_allow', $required_caps, true ) );

		array_unshift( $args, $user_id );
		array_unshift( $args, $cap );

		$this->data['caps'][] = array(
			'args'   => $args,
			'trace'  => $trace,
			'result' => $result,
		);

		return $required_caps;
	}
public function filter_map_meta_cap ( array $ required_caps , $ cap , $ user_id , array $ args ) { if ( ! is_multisite ( ) ) { return $ required_caps ; } if ( ! is_super_admin ( $ user_id ) ) { return $ required_caps ; } $ trace = new QM_Backtrace ( ) ; $ result = ( ! in_array ( 'do_not_allow' , $ required_caps , true ) ) ; array_unshift ( $ args , $ user_id ) ; array_unshift ( $ args , $ cap ) ; $ this -> data [ 'caps' ] [ ] = array ( 'args' => $ args , 'trace' => $ trace , 'result' => $ result , ) ; return $ required_caps ; }
Logs user capability checks for Super Admins on Multisite.

This is needed because the `user_has_cap` filter doesn't fire for Super Admins.

@param string[] $required_caps Required primitive capabilities for the requested capability.
@param string   $cap           Capability or meta capability being checked.
@param int      $user_id       Concerned user ID.
@param array    $args {
Arguments that accompany the requested capability check.

@type mixed ...$0 Optional second and further parameters.
}
@return string[] Required capabilities for the requested action.
Logs user capability checks for Super Admins on Multisite .