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.
Return
(string[]) Filtered array of plugins, without any paused plugins.
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; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
5.2.0 | Introduced. |