Summery Summery

Tries to resume a single plugin.

Syntax Syntax

resume_plugin( string $plugin, string $redirect = '' )

Description Description

If a redirect was provided, we first ensure the plugin does not throw fatal errors anymore.

The way it works is by setting the redirection to the error before trying to include the plugin file. If the plugin fails, then the redirection will not be overwritten with the success message and the plugin will not be resumed.

Parameters Parameters


(string) (Required) Single plugin to resume.


(string) (Optional) URL to redirect to.

Default value: ''

Return Return

(bool|WP_Error) True on success, false if $plugin was not paused, WP_Error on failure.

Source Source

File: wp-admin/includes/plugin.php

function resume_plugin( $plugin, $redirect = '' ) {
	 * We'll override this later if the plugin could be resumed without
	 * creating a fatal error.
	if ( ! empty( $redirect ) ) {
				wp_create_nonce( 'plugin-resume-error_' . $plugin ),

		// Load the plugin to test whether it throws a fatal error.
		plugin_sandbox_scrape( $plugin );

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

	$result = wp_paused_plugins()->delete( $extension );

	if ( ! $result ) {
		return new WP_Error(
			__( 'Could not resume the plugin.' )

	return true;


Changelog Changelog

Version Description
5.2.0 Introduced.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

What are you looking for?