woocommerce_rest_webhook_query
Filter arguments, before passing to WC_Webhook_Data_Store->search_webhooks, when querying webhooks via the REST API.
Использование
add_filter( 'woocommerce_rest_webhook_query', 'wp_kama_woocommerce_rest_webhook_query_filter', 10, 2 ); /** * Function for `woocommerce_rest_webhook_query` filter-hook. * * @param array $args Array of arguments for $wpdb->get_results(). * @param WP_REST_Request $request The current request. * * @return array */ function wp_kama_woocommerce_rest_webhook_query_filter( $args, $request ){ // filter... return $args; }
- $args(массив)
- Array of arguments for $wpdb->get_results().
- $request(WP_REST_Request)
- The current request.
Где вызывается хук
woocommerce_rest_webhook_query
woocommerce/includes/rest-api/Controllers/Version1/class-wc-rest-webhooks-v1-controller.php 263
$prepared_args = apply_filters( 'woocommerce_rest_webhook_query', $args, $request );