equal
deleted
inserted
replaced
101 * Retrieves all error messages, or the error messages for the given error code. |
101 * Retrieves all error messages, or the error messages for the given error code. |
102 * |
102 * |
103 * @since 2.1.0 |
103 * @since 2.1.0 |
104 * |
104 * |
105 * @param string|int $code Optional. Retrieve messages matching code, if exists. |
105 * @param string|int $code Optional. Retrieve messages matching code, if exists. |
106 * @return array Error strings on success, or empty array if there are none. |
106 * @return string[] Error strings on success, or empty array if there are none. |
107 */ |
107 */ |
108 public function get_error_messages( $code = '' ) { |
108 public function get_error_messages( $code = '' ) { |
109 // Return all messages if no code specified. |
109 // Return all messages if no code specified. |
110 if ( empty( $code ) ) { |
110 if ( empty( $code ) ) { |
111 $all_messages = array(); |
111 $all_messages = array(); |