Automattic\WooCommerce\Internal
McStats::get_group_query_args()
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-".
Метод класса: McStats{}
Хуков нет.
Возвращает
Массив
. 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
Использование
$McStats = new McStats(); $McStats->get_group_query_args( $group_name );
- $group_name(строка) (обязательный)
- The name of the group to retrieve.
Код McStats::get_group_query_args() McStats::get group query args WC 9.5.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(); }