Uses
Uses | Description |
---|---|
wp-includes/l10n.php: __() | Retrieve the translation of $text. |
wp-includes/class-wp-error.php: WP_Error::__construct() | Initialize the error. |
Constructor.
(array) (Optional)
Default value: ''
File: wp-admin/includes/class-wp-filesystem-ftpsockets.php
public function __construct( $opt = '' ) { $this->method = 'ftpsockets'; $this->errors = new WP_Error(); // Check if possible to use ftp functions. if ( ! include_once ABSPATH . 'wp-admin/includes/class-ftp.php' ) { return; } $this->ftp = new ftp(); if ( empty( $opt['port'] ) ) { $this->options['port'] = 21; } else { $this->options['port'] = (int) $opt['port']; } if ( empty( $opt['hostname'] ) ) { $this->errors->add( 'empty_hostname', __( 'FTP hostname is required' ) ); } else { $this->options['hostname'] = $opt['hostname']; } // Check if the options provided are OK. if ( empty( $opt['username'] ) ) { $this->errors->add( 'empty_username', __( 'FTP username is required' ) ); } else { $this->options['username'] = $opt['username']; } if ( empty( $opt['password'] ) ) { $this->errors->add( 'empty_password', __( 'FTP password is required' ) ); } else { $this->options['password'] = $opt['password']; } }
Version | Description |
---|---|
2.5.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_filesystem_ftpsockets/__construct