woocommerce_store_api_register_update_callback()
Add callback functions that can be executed by the cart/extensions endpoint.
No Hooks.
Returns
null. Nothing (null).
Usage
woocommerce_store_api_register_update_callback( $args );
- $args(array) (required)
- Args to pass to register_update_callback.
Notes
- See: Automattic\WooCommerce\StoreApi\Schemas[ExtendSchema::register_update_callback()](/plugin/woocommerce/function/ExtendSchema::register_update_callback)
woocommerce_store_api_register_update_callback() woocommerce store api register update callback code WC 10.7.0
function woocommerce_store_api_register_update_callback( $args ) {
try {
$extend = StoreApi::container()->get( ExtendSchema::class );
$extend->register_update_callback( $args );
} catch ( \Exception $error ) {
return new \WP_Error( 'error', $error->getMessage() );
}
return true;
}