WP_Filesystem_FTPext::exists()
Checks if a file or directory exists.
{} Это метод класса: WP_Filesystem_FTPext{}
Хуков нет.
Возвращает
true|false
. Whether $file exists or not.
Использование
$WP_Filesystem_FTPext = new WP_Filesystem_FTPext(); $WP_Filesystem_FTPext->exists( $file );
- $file(строка) (обязательный)
- Path to file or directory.
Список изменений
С версии 2.5.0 | Введена. |
Код WP_Filesystem_FTPext::exists() WP Filesystem FTPext::exists WP 6.0
public function exists( $file ) { $list = ftp_nlist( $this->link, $file ); if ( empty( $list ) && $this->is_dir( $file ) ) { return true; // File is an empty directory. } return ! empty( $list ); // Empty list = no file, so invert. }