WP_Filesystem_FTPext::copy( string $source, string $destination, bool $overwrite = false, string|bool $mode = false )
Parameters
- $source
-
(Required)
- $destination
-
(Required)
- $overwrite
-
(Optional)
Default value: false
- $mode
-
(Optional)
Default value: false
Return
(bool)
Source
File: wp-admin/includes/class-wp-filesystem-ftpext.php
public function copy($source, $destination, $overwrite = false, $mode = false) {
if ( ! $overwrite && $this->exists($destination) )
return false;
$content = $this->get_contents($source);
if ( false === $content )
return false;
return $this->put_contents($destination, $content, $mode);
}