WP_Ajax_Upgrader_Skin::error( string|WP_Error $errors )
Stores a log entry for an error.
Description Description
Parameters Parameters
- $errors
-
(string|WP_Error) (Required) Errors.
Source Source
File: wp-admin/includes/class-wp-ajax-upgrader-skin.php
public function error( $errors ) { if ( is_string( $errors ) ) { $string = $errors; if ( ! empty( $this->upgrader->strings[ $string ] ) ) { $string = $this->upgrader->strings[ $string ]; } if ( false !== strpos( $string, '%' ) ) { $args = func_get_args(); $args = array_splice( $args, 1 ); if ( ! empty( $args ) ) { $string = vsprintf( $string, $args ); } } // Count existing errors to generate an unique error code. $errors_count = count( $this->errors->get_error_codes() ); $this->errors->add( 'unknown_upgrade_error_' . $errors_count + 1, $string ); } elseif ( is_wp_error( $errors ) ) { foreach ( $errors->get_error_codes() as $error_code ) { $this->errors->add( $error_code, $errors->get_error_message( $error_code ), $errors->get_error_data( $error_code ) ); } } $args = func_get_args(); call_user_func_array( array( $this, 'parent::error' ), $args ); }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
4.6.0 | Introduced. |