woocommerce_customer_get_total_spent_query
Filters the SQL query used to get the combined total of all the orders from a given customer.
Использование
add_filter( 'woocommerce_customer_get_total_spent_query', 'wp_kama_woocommerce_customer_get_total_spent_query_filter', 10, 2 ); /** * Function for `woocommerce_customer_get_total_spent_query` filter-hook. * * @param string $sql The SQL query to use. * @param WC_Customer $customer The customer to get the total spent for. * * @return string */ function wp_kama_woocommerce_customer_get_total_spent_query_filter( $sql, $customer ){ // filter... return $sql; }
- $sql(строка)
- The SQL query to use.
- $customer(WC_Customer)
- The customer to get the total spent for.
Где вызывается хук
woocommerce_customer_get_total_spent_query
woocommerce/includes/data-stores/class-wc-customer-data-store.php 513
$sql = apply_filters( 'woocommerce_customer_get_total_spent_query', $sql, $customer );