On this page
WP_Recovery_Mode::store_error( array $error ): bool
Stores the given error so that the extension causing it is paused.
Parameters
$errorarray Required-
Error details from
error_get_last().
Return
bool True if the error was stored successfully, false otherwise.
Source
File: wp-includes/class-wp-recovery-mode.php. View all references
protected function store_error( $error ) {
$extension = $this->get_extension_for_error( $error );
if ( ! $extension ) {
return false;
}
switch ( $extension['type'] ) {
case 'plugin':
return wp_paused_plugins()->set( $extension['slug'], $error );
case 'theme':
return wp_paused_themes()->set( $extension['slug'], $error );
default:
return false;
}
}
Related
Uses
| Uses | Description |
|---|---|
| WP_Recovery_Mode::get_extension_for_error() wp-includes/class-wp-recovery-mode.php | Gets the extension that the error occurred in. |
| wp_paused_plugins() wp-includes/error-protection.php | Get the instance for storing paused plugins. |
| wp_paused_themes() wp-includes/error-protection.php | Get the instance for storing paused extensions. |
Used By
| Used By | Description |
|---|---|
| WP_Recovery_Mode::handle_error() wp-includes/class-wp-recovery-mode.php | Handles a fatal error occurring. |
Changelog
| Version | Description |
|---|---|
| 5.2.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_recovery_mode/store_error