WP_Filesystem_Direct::exists()publicWP 2.5.0

Checks if a file or directory exists.

Method of the class: WP_Filesystem_Direct{}

No Hooks.

Return

true|false. Whether $path exists or not.

Usage

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

Changelog

Since 2.5.0 Introduced.

WP_Filesystem_Direct::exists() code WP 6.5.2

public function exists( $path ) {
	return @file_exists( $path );
}