woocommerce_rest_prepare_system_status
Filter the system status returned from the REST API.
Использование
add_filter( 'woocommerce_rest_prepare_system_status', 'wp_kama_woocommerce_rest_prepare_system_status_filter', 10, 3 ); /** * Function for `woocommerce_rest_prepare_system_status` filter-hook. * * @param WP_REST_Response $response The response object. * @param mixed $system_status System status * @param WP_REST_Request $request Request object. * * @return WP_REST_Response */ function wp_kama_woocommerce_rest_prepare_system_status_filter( $response, $system_status, $request ){ // filter... return $response; }
- $response(WP_REST_Response)
- The response object.
- $system_status(разное)
- System status
- $request(WP_REST_Request)
- Request object.
Где вызывается хук
woocommerce_rest_prepare_system_status
woocommerce/includes/rest-api/Controllers/Version2/class-wc-rest-system-status-v2-controller.php 1573
return apply_filters( 'woocommerce_rest_prepare_system_status', $response, $system_status, $request );