private function check_if_allowed()
    {
        $check = \wp_check_filetype_and_ext($this->data['tmp_name'], $this->client_name);

        if ($check['type'] !== false) {
            $this->guessed_type = $check['type'];
            $this->guessed_extension = $check['ext'];
        }

        if (($check['type'] === false || $check['ext'] === false)
            && !\current_user_can('unfiltered_upload')
        ) {
            return false;
        }

        $allowed_types = \get_allowed_mime_types();

        return \in_array($this->client_type, $allowed_types);
    }
private function check_if_allowed()
    {
        $check = \wp_check_filetype_and_ext($this->data['tmp_name'], $this->client_name);

        if ($check['type'] !== false) {
            $this->guessed_type = $check['type'];
            $this->guessed_extension = $check['ext'];
        }

        if (($check['type'] === false || $check['ext'] === false)
            && !\current_user_can('unfiltered_upload')
        ) {
            return false;
        }

        $allowed_types = \get_allowed_mime_types();

        return \in_array($this->client_type, $allowed_types);
    }
private function check_if_allowed ( ) { $ check = \ wp_check_filetype_and_ext ( $ this -> data [ 'tmp_name' ] , $ this -> client_name ) ; if ( $ check [ 'type' ] !== false ) { $ this -> guessed_type = $ check [ 'type' ] ; $ this -> guessed_extension = $ check [ 'ext' ] ; } if ( ( $ check [ 'type' ] === false || $ check [ 'ext' ] === false ) && ! \ current_user_can ( 'unfiltered_upload' ) ) { return false ; } $ allowed_types = \ get_allowed_mime_types ( ) ; return \ in_array ( $ this -> client_type , $ allowed_types ) ; }
Checks if the file passes WordPress upload checks.

@since 1.0.0

@return bool
Checks if the file passes WordPress upload checks .