WP_Filesystem_SSH2::exists()publicWP 2.7.0

Checks if a file or directory exists.

Method of the class: WP_Filesystem_SSH2{}

No Hooks.

Return

true|false. Whether $path exists or not.

Usage

$WP_Filesystem_SSH2 = new WP_Filesystem_SSH2();
$WP_Filesystem_SSH2->exists( $path );
$path(string) (required)
Path to file or directory.

Changelog

Since 2.7.0 Introduced.

WP_Filesystem_SSH2::exists() code WP 6.5.2

public function exists( $path ) {
	return file_exists( $this->sftp_path( $path ) );
}