move_dir ( $from, $to, $overwrite = false )
- (string) from Source directory.
- (string) to Destination directory.
- (bool) overwrite Optional. Whether to overwrite the destination directory if it exists. Default false.
- (true|WP_Error) True on success, WP_Error on failure.
- Introduced in WordPress: 6.2.0
- Deprecated in WordPress: —
Moves a directory from one location to another.Recursively invalidates OPcache on success.
If the renaming failed, falls back to copy_dir().
Assumes that WP_Filesystem() has already been called and setup.
This function is not designed to merge directories, copy_dir() should be used instead.