A WordPress-centric search engine for devs and theme authors



count_paused_theme_sites_for_network ›

Since5.1.0
Deprecatedn/a
count_paused_theme_sites_for_network ( $theme )
Parameters:
  • (string) $theme Path to the theme directory relative to the themes directory.
    Required: Yes
Returns:
  • (int) Site count.
Defined at:
Codex:

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



Source

function count_paused_theme_sites_for_network( $theme ) {
	if ( ! is_multisite() ) {
		return is_theme_paused( $theme ) ? 1 : 0;
	}

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

	return get_sites( $query_args );
}