wp_get_plugin_error( string $plugin ): array|false

In this article

Gets the error that was recorded for a paused plugin.

Parameters

$pluginstringrequired
Path to the plugin file relative to the plugins directory.

Return

array|false Array of error information as returned by error_get_last(), or false if none was recorded.

Source

function wp_get_plugin_error( $plugin ) {
	if ( ! isset( $GLOBALS['_paused_plugins'] ) ) {
		return false;
	}

	list( $plugin ) = explode( '/', $plugin );

	if ( ! array_key_exists( $plugin, $GLOBALS['_paused_plugins'] ) ) {
		return false;
	}

	return $GLOBALS['_paused_plugins'][ $plugin ];
}

Changelog

VersionDescription
5.2.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.