WP_Filesystem_Base::copy()publicWP 2.5.0

Copies a file.

Method of the class: WP_Filesystem_Base{}

No Hooks.


true|false. True on success, false on failure.


$WP_Filesystem_Base = new WP_Filesystem_Base();
$WP_Filesystem_Base->copy( $source, $destination, $overwrite, $mode );
$source(string) (required)
Path to the source file.
$destination(string) (required)
Path to the destination file.
Whether to overwrite the destination file if it exists.
Default: false
The permissions as octal number, usually 0644 for files,
0755 for dirs.
Default: false


Since 2.5.0 Introduced.

WP_Filesystem_Base::copy() code WP 6.5.3

public function copy( $source, $destination, $overwrite = false, $mode = false ) {
	return false;