move_dir
move_dir ( $from, $to, $overwrite = false )
Parameters:- (string) from Source directory.
- (string) to Destination directory.
- (bool) overwrite Optional. Whether to overwrite the destination directory if it exists. Default false.
Returns:- (true|WP_Error) True on success, WP_Error on failure.
Defined at: - Introduced in WordPress: 6.2.0
- Deprecated in WordPress: —
Description
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.