woocommerce_analytics_(context)_select_query
Called after the data is fetched. The results can be modified here.
Использование
add_filter( 'woocommerce_analytics_(context)_select_query', 'wp_kama_woocommerce_analytics_context_select_query_filter', 10, 2 );
/**
* Function for `woocommerce_analytics_(context)_select_query` filter-hook.
*
* @param stdClass|WP_Error $results The results of the query.
* @param $args
*
* @return stdClass|WP_Error
*/
function wp_kama_woocommerce_analytics_context_select_query_filter( $results, $args ){
// filter...
return $results;
}
- $results(stdClass|WP_Error)
- The results of the query.
- $args
- -
Список изменений
| С версии 9.3.0 | Введена. |
Где вызывается хук
woocommerce_analytics_(context)_select_query
woocommerce/src/Admin/API/Reports/FilteredGetDataTrait.php 56
return apply_filters( "woocommerce_analytics_{$this->context}_select_query", $results, $args );
Где используется хук в WooCommerce
woocommerce/src/Admin/API/Reports/Products/Stats/Controller.php 47
add_filter( 'woocommerce_analytics_products_stats_select_query', array( $this, 'set_default_report_data' ) );
woocommerce/src/Admin/API/Reports/Taxes/Stats/Controller.php 36
add_filter( 'woocommerce_analytics_taxes_stats_select_query', array( $this, 'set_default_report_data' ) );
woocommerce/src/Admin/API/Reports/Variations/Stats/Controller.php 45
add_filter( 'woocommerce_analytics_variations_stats_select_query', array( $this, 'set_default_report_data' ) );