On this page
wp_skip_paused_plugins( string[] $plugins ): string[]
Filters a given list of plugins, removing any paused plugins from it.
Parameters
$pluginsstring[] Required-
Array of absolute plugin main file paths.
Return
string[] Filtered array of plugins, without any paused plugins.
Source
File: wp-includes/load.php. View all references
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;
}
Related
Uses
| Uses | Description |
|---|---|
| wp_paused_plugins() wp-includes/error-protection.php | Get the instance for storing paused plugins. |
| plugin_basename() wp-includes/plugin.php | Gets the basename of a plugin. |
Used By
| Used By | Description |
|---|---|
| wp_get_active_and_valid_plugins() wp-includes/load.php | Retrieve an array of active and valid plugin files. |
Changelog
| Version | Description |
|---|---|
| 5.2.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_skip_paused_plugins