WP_Filesystem_ftpsockets::move
Moves a file or directory.
After moving files or directories, OPcache will need to be invalidated.
If moving a directory fails, copy_dir() be used for a recursive copy.
Use move_dir() moving directories with OPcache invalidation and a fallback to copy_dir().
Метод класса: WP_Filesystem_ftpsockets{}
Хуков нет.
Возвращает
bool. True on success, false on failure.
Использование
$WP_Filesystem_ftpsockets = new WP_Filesystem_ftpsockets(); $WP_Filesystem_ftpsockets->move( $source, $destination, $overwrite );
- $source(строка) (обязательный)
- Path to the source file or directory.
- $destination(строка) (обязательный)
- Path to the destination file or directory.
- $overwrite(true|false)
- Whether to overwrite the destination if it exists.
По умолчанию:false
Список изменений
| С версии 2.5.0 | Введена. |
Код WP_Filesystem_ftpsockets::move() WP Filesystem ftpsockets::move WP 7.1.2
public function move( $source, $destination, $overwrite = false ) {
return (bool) $this->ftp->rename( $source, $destination );
}