WP_Filesystem_ftpsockets::rmdir() WordPress Method
The WP_Filesystem_ftpsockets::rmdir() method removes a directory on the FTP server. This is a wrapper for the ftp_rmdir() function. This function requires the host, username, and password parameters. The path parameter is the directory to remove. The recursive parameter is a Boolean value that indicates whether to delete all files and subdirectories in the specified directory. The default value is FALSE. The return value is TRUE on success or FALSE on failure.
WP_Filesystem_ftpsockets::rmdir( string $path, bool $recursive = false ) #
Deletes a directory.
Parameters
- $path
(string)(Required)Path to directory.
- $recursive
(bool)(Optional) Whether to recursively remove files/directories.
Default value: false
Return
(bool) True on success, false on failure.
Source
File: wp-admin/includes/class-wp-filesystem-ftpsockets.php
public function rmdir( $path, $recursive = false ) { return $this->delete( $path, $recursive ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
2.5.0 | Introduced. |