WP_Filesystem_FTPext::exists

Advertisement

Summery Summery

Checks if a file or directory exists.

Syntax Syntax

WP_Filesystem_FTPext::exists( string $file )

Parameters Parameters

$file

(Required) Path to file or directory.

Return Return

(bool) Whether $file exists or not.

Source Source

File: wp-admin/includes/class-wp-filesystem-ftpext.php

		$filelist = $this->dirlist( trailingslashit( $file ) );

		if ( ! empty( $filelist ) ) {
			foreach ( $filelist as $delete_file ) {
				$this->delete( trailingslashit( $file ) . $delete_file['name'], $recursive, $delete_file['type'] );
			}
		}

		return ftp_rmdir( $this->link, $file );

Advertisement

Changelog Changelog

Changelog
Version Description
2.5.0 Introduced.

Advertisement

Leave a Reply