WPDev.one

move_dir()

move_dir( mixed $from, mixed $to, mixed $overwrite = false )

Moves a directory from one location to another.

Parameters 3 required

Name / Type Description
$from
string

Source directory.

Required
$to
string

Destination directory.

Required
bool

$overwrite Optional. Whether to overwrite the destination directory if it exists. Default false.

Required

Return Value

((true)
| WP_Error) True on success, WP_Error on failure.

Function Information

Since Version
6.2.0
Source File
wp-admin/includes/file.php
Advertisement