Moves a file or directory.
After moving files or directories, OPcache will need to be invalidated.
If moving a directory fails, copy_dir() can be used for a recursive copy.
Use move_dir() for moving directories with OPcache invalidation and a fallback to copy_dir().
$sourcestringrequired
$destinationstringrequired
$overwritebooloptional
Default:false
public function move( $source, $destination, $overwrite = false ) {
return $this->ftp->rename( $source, $destination );
}
| Version | Description |
|---|---|
| 2.5.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_filesystem_ftpsockets/move