(hook_prefix)created
Fires after a single object is created via the REST API.
Usage
add_action( '(hook_prefix)created', 'wp_kama_hook_prefixcreated_action', 10, 2 );
/**
* Function for `(hook_prefix)created` action-hook.
*
* @param WC_Order_Refund $refund Inserted object.
* @param WP_REST_Request $request Request object.
*
* @return void
*/
function wp_kama_hook_prefixcreated_action( $refund, $request ){
// action...
}
- $refund(WC_Order_Refund)
- Inserted object.
- $request(WP_REST_Request)
- Request object.
Changelog
| Since 10.2.0 | Introduced. |
Where the hook is called
woocommerce/src/Internal/RestApi/Routes/V4/Refunds/Controller.php 313
do_action( $this->get_hook_prefix() . 'created', $refund, $request );
woocommerce/src/Internal/RestApi/Routes/V4/OrderNotes/Controller.php 306
do_action( $this->get_hook_prefix() . 'created', $note, $request );
woocommerce/src/Internal/RestApi/Routes/V4/Orders/Controller.php 329
do_action( $this->get_hook_prefix() . 'created', $order, $request );
woocommerce/src/Internal/RestApi/Routes/V4/Customers/Controller.php 265
do_action( $this->get_hook_prefix() . 'created', $user_data, $request );
Where the hook is used in WooCommerce
woocommerce/includes/class-wc-install.php 358
add_action( 'woocommerce_page_created', array( __CLASS__, 'page_created' ), 10, 2 );
woocommerce/includes/wc-stock-functions.php 459
add_action( 'woocommerce_checkout_order_created', 'wc_reserve_stock_for_order' );
woocommerce/src/Internal/Admin/Schedulers/OrdersScheduler.php 75
add_action( 'woocommerce_refund_created', array( __CLASS__, 'possibly_schedule_import' ) );
woocommerce/src/Internal/DataStores/Orders/DataSynchronizer.php 106
add_action( 'woocommerce_refund_created', array( $this, 'handle_updated_order' ), 100 );
woocommerce/src/Internal/Fulfillments/FulfillmentsManager.php 55
add_action( 'woocommerce_refund_created', array( $this, 'update_fulfillments_after_refund' ), 10, 1 );