wp_skip_paused_plugins() WordPress Function

The wp_skip_paused_plugins() function is used to determine if a plugin is paused and should not be loaded. This function is useful for plugin developers who want to paused a plugin without uninstalling or deactivating it.

wp_skip_paused_plugins( string[] $plugins ) #

Filters a given list of plugins, removing any paused plugins from it.


Parameters

$plugins

(string[])(Required)Array of absolute plugin main file paths.


Top ↑

Return

(string[]) Filtered array of plugins, without any paused plugins.


Top ↑

Source

File: wp-includes/load.php

function wp_skip_paused_plugins( array $plugins ) {
	$paused_plugins = wp_paused_plugins()->get_all();

	if ( empty( $paused_plugins ) ) {
		return $plugins;
	}

	foreach ( $plugins as $index => $plugin ) {
		list( $plugin ) = explode( '/', plugin_basename( $plugin ) );

		if ( array_key_exists( $plugin, $paused_plugins ) ) {
			unset( $plugins[ $index ] );

			// Store list of paused plugins for displaying an admin notice.
			$GLOBALS['_paused_plugins'][ $plugin ] = $paused_plugins[ $plugin ];
		}
	}

	return $plugins;
}


Top ↑

Changelog

Changelog
VersionDescription
5.2.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.