On this page
WP_Recovery_Mode_Email_Service::get_cause( array $extension ): string
This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
Gets the description indicating the possible cause for the error.
Parameters
$extensionarray Required-
The extension that caused the error.
slugstringThe extension slug. The directory of the plugin or theme.typestringThe extension type. Either'plugin'or'theme'.
Return
string Message about which extension caused the error.
Source
File: wp-includes/class-wp-recovery-mode-email-service.php. View all references
private function get_cause( $extension ) {
if ( 'plugin' === $extension['type'] ) {
$plugin = $this->get_plugin( $extension );
if ( false === $plugin ) {
$name = $extension['slug'];
} else {
$name = $plugin['Name'];
}
/* translators: %s: Plugin name. */
$cause = sprintf( __( 'In this case, WordPress caught an error with one of your plugins, %s.' ), $name );
} else {
$theme = wp_get_theme( $extension['slug'] );
$name = $theme->exists() ? $theme->display( 'Name' ) : $extension['slug'];
/* translators: %s: Theme name. */
$cause = sprintf( __( 'In this case, WordPress caught an error with your theme, %s.' ), $name );
}
return $cause;
}
Related
Uses
| Uses | Description |
|---|---|
| WP_Recovery_Mode_Email_Service::get_plugin() wp-includes/class-wp-recovery-mode-email-service.php | Return the details for a single plugin based on the extension data from an error. |
| wp_get_theme() wp-includes/theme.php | Gets a WP_Theme object for a theme. |
| __() wp-includes/l10n.php | Retrieves the translation of $text. |
Used By
| Used By | Description |
|---|---|
| WP_Recovery_Mode_Email_Service::send_recovery_mode_email() wp-includes/class-wp-recovery-mode-email-service.php | Sends the Recovery Mode email to the site admin email address. |
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_email_service/get_cause