Used By
Used By | Description |
---|---|
wp-login.php: login_header() | Output the login page header. |
wp-includes/class-wp-error.php: WP_Error::get_error_message() | Get single error message. |
Retrieve all error messages or error messages matching code.
(string|int) (Optional) Retrieve messages matching code, if exists.
Default value: ''
(array) Error strings on success, or empty array on failure (if using code parameter).
File: wp-includes/class-wp-error.php
public function get_error_messages( $code = '' ) { // Return all messages if no code specified. if ( empty( $code ) ) { $all_messages = array(); foreach ( (array) $this->errors as $code => $messages ) { $all_messages = array_merge( $all_messages, $messages ); } return $all_messages; } if ( isset( $this->errors[ $code ] ) ) { return $this->errors[ $code ]; } else { return array(); } }
Version | Description |
---|---|
2.1.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_error/get_error_messages