Changeset 28511
- Timestamp:
- 05/19/2014 05:49:22 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-error.php
r24507 r28511 27 27 * @access private 28 28 */ 29 var$errors = array();29 $errors = array(); 30 30 31 31 /** … … 36 36 * @access private 37 37 */ 38 var$error_data = array();38 $error_data = array(); 39 39 40 40 /** … … 55 55 * @return WP_Error 56 56 */ 57 function __construct($code = '', $message = '', $data = '') {57 function __construct($code = '', $message = '', $data = '') { 58 58 if ( empty($code) ) 59 59 return; … … 66 66 67 67 /** 68 69 70 71 72 73 74 75 76 77 78 68 79 * Retrieve all error codes. 69 80 * … … 73 84 * @return array List of error codes, if available. 74 85 */ 75 function get_error_codes() {86 function get_error_codes() { 76 87 if ( empty($this->errors) ) 77 88 return array(); … … 88 99 * @return string|int Empty string, if no error codes. 89 100 */ 90 function get_error_code() {101 function get_error_code() { 91 102 $codes = $this->get_error_codes(); 92 103 … … 105 116 * @return array Error strings on success, or empty array on failure (if using code parameter). 106 117 */ 107 function get_error_messages($code = '') {118 function get_error_messages($code = '') { 108 119 // Return all messages if no code specified. 109 120 if ( empty($code) ) { … … 132 143 * @return string 133 144 */ 134 function get_error_message($code = '') {145 function get_error_message($code = '') { 135 146 if ( empty($code) ) 136 147 $code = $this->get_error_code(); … … 149 160 * @return mixed Null, if no errors. 150 161 */ 151 function get_error_data($code = '') {162 function get_error_data($code = '') { 152 163 if ( empty($code) ) 153 164 $code = $this->get_error_code(); … … 168 179 * @param mixed $data Optional. Error data. 169 180 */ 170 function add($code, $message, $data = '') {181 function add($code, $message, $data = '') { 171 182 $this->errors[$code][] = $message; 172 183 if ( ! empty($data) ) … … 184 195 * @param string|int $code Error code. 185 196 */ 186 function add_data($data, $code = '') {197 function add_data($data, $code = '') { 187 198 if ( empty($code) ) 188 199 $code = $this->get_error_code();
Note: See TracChangeset
for help on using the changeset viewer.