Automattic\WooCommerce\Internal

McStats::get_group_query_argspublicWC 1.0

Return the stats from a group in an array ready to be added as parameters in a query string

Jetpack MC Stats package prefixes group names with "x_jetpack-" so we override this method to prefix group names with "x_woocommerce-".

Method of the class: McStats{}

No Hooks.

Returns

Array. Array with one item, where the key is the prefixed group and the value are all stats concatenated with a comma. If group not found, an empty array will be returned

Usage

$McStats = new McStats();
$McStats->get_group_query_args( $group_name );
$group_name(string) (required)
The name of the group to retrieve.

McStats::get_group_query_args() code WC 10.8.1

public function get_group_query_args( $group_name ) {
	$stats = $this->get_current_stats();
	if ( isset( $stats[ $group_name ] ) && ! empty( $stats[ $group_name ] ) ) {
		return array( "x_woocommerce-{$group_name}" => implode( ',', $stats[ $group_name ] ) );
	}
	return array();
}