A WordPress-centric search engine for devs and theme authors



wp_forget_extension_error ›

Since5.1.0
Deprecatedn/a
wp_forget_extension_error ( $type, $extension, $network_wide = false )
Parameters: (3)
  • (string) $type Type of the extension.
    Required: Yes
  • (string) $extension Relative path of the extension.
    Required: Yes
  • (bool) $network_wide Optional. Whether to resume the plugin for the entire network. Default false.
    Required: No
    Default: false
Returns:
  • (bool) Whether the extension error was successfully forgotten.
Defined at:
Codex:

Forgets a previously recorded extension error again.



Source

function wp_forget_extension_error( $type, $extension, $network_wide = false ) {
	switch ( $type ) {
		case 'plugins':
			$callback          = 'wp_paused_plugins';
			list( $extension ) = explode( '/', $extension );
			break;
		case 'themes':
			$callback          = 'wp_paused_themes';
			list( $extension ) = explode( '/', $extension );
			break;
	}

	if ( empty( $callback ) || empty( $extension ) ) {
		return false;
	}

	// Handle manually since the regular APIs do not expose this functionality.
	if ( $network_wide && is_site_meta_supported() ) {
		$site_meta_query_clause = call_user_func( $callback )->get_site_meta_query_clause( $extension );
		return delete_metadata( 'blog', 0, $site_meta_query_clause['key'], '', true );
	}

	return call_user_func( $callback )->forget( $extension );
}