WP_Filesystem_FTPext::exists( string $path ): bool
Checks if a file or directory exists.
Parameters
-
$path
string Required -
Path to file or directory.
Return
bool Whether $path exists or not.
Source
File: wp-admin/includes/class-wp-filesystem-ftpext.php
.
View all references
public function exists( $path ) {
if ( $this->is_dir( $path ) ) {
return true;
}
return ! empty( ftp_rawlist( $this->link, $path ) );
}
Changelog
Version | Description |
---|---|
6.1.0 | Uses WP_Filesystem_FTPext::is_dir() to check for directory existence and ftp_rawlist() to check for file existence. |
2.5.0 | Introduced. |