Gets the description indicating the possible cause for the error.
Parameters
$extensionarrayrequired- The extension that caused the error.
slugstringThe extension slug. The directory of the plugin or theme.typestringThe extension type. Either'plugin'or'theme'.
Source
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;
}
Changelog
| Version | Description |
|---|---|
| 5.2.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.