equal
deleted
inserted
replaced
119 * Stores a message about the upgrade. |
119 * Stores a message about the upgrade. |
120 * |
120 * |
121 * @since 4.6.0 |
121 * @since 4.6.0 |
122 * @since 5.3.0 Formalized the existing `...$args` parameter by adding it |
122 * @since 5.3.0 Formalized the existing `...$args` parameter by adding it |
123 * to the function signature. |
123 * to the function signature. |
|
124 * @since 5.9.0 Renamed `$data` to `$feedback` for PHP 8 named parameter support. |
124 * |
125 * |
125 * @param string|array|WP_Error $data Message data. |
126 * @param string|array|WP_Error $feedback Message data. |
126 * @param mixed ...$args Optional text replacements. |
127 * @param mixed ...$args Optional text replacements. |
127 */ |
128 */ |
128 public function feedback( $data, ...$args ) { |
129 public function feedback( $feedback, ...$args ) { |
129 if ( is_wp_error( $data ) ) { |
130 if ( is_wp_error( $feedback ) ) { |
130 foreach ( $data->get_error_codes() as $error_code ) { |
131 foreach ( $feedback->get_error_codes() as $error_code ) { |
131 $this->errors->add( $error_code, $data->get_error_message( $error_code ), $data->get_error_data( $error_code ) ); |
132 $this->errors->add( $error_code, $feedback->get_error_message( $error_code ), $feedback->get_error_data( $error_code ) ); |
132 } |
133 } |
133 } |
134 } |
134 |
135 |
135 parent::feedback( $data, ...$args ); |
136 parent::feedback( $feedback, ...$args ); |
136 } |
137 } |
137 } |
138 } |