A WordPress-centric search engine for devs and theme authors



count_paused_plugin_sites_for_network ›

Since5.1.0
Deprecatedn/a
count_paused_plugin_sites_for_network ( $plugin )
Parameters:
  • (string) $plugin Path to the plugin file relative to the plugins directory.
    Required: Yes
Returns:
  • (int) Site count.
Defined at:
Codex:

Gets the number of sites on which a specific plugin is paused.



Source

function count_paused_plugin_sites_for_network( $plugin ) {
	if ( ! is_multisite() ) {
		return is_plugin_paused( $plugin ) ? 1 : 0;
	}

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

	$query_args = array(
		'count'      => true,
		'number'     => 0,
		'network_id' => get_current_network_id(),
		'meta_query' => array(
			wp_paused_plugins()->get_site_meta_query_clause( $plugin ),
		),
	);

	return get_sites( $query_args );
}