wp_get_plugin_error

The timeline below displays how wordpress function wp_get_plugin_error has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.5

/**
 * Gets the error that was recorded for a paused plugin.
 *
 * @since 5.2.0
 *
 * @global WP_Paused_Extensions_Storage $_paused_plugins
 *
 * @param string $plugin 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.
 */
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];
}

WordPress Version: 5.4

/**
 * Gets the error that was recorded for a paused plugin.
 *
 * @since 5.2.0
 *
 * @param string $plugin 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.
 */
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];
}

WordPress Version: 5.2

/**
 * Gets the error that was recorded for a paused plugin.
 *
 * @since 5.2.0
 *
 * @param string $plugin Path to the plugin file relative to the plugins
 *                       directory.
 * @return array|false Array of error information as it was returned by
 *                     `error_get_last()`, or false if none was recorded.
 */
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];
}