woocommerce_hold_stock_for_checkout
Filter: woocommerce_hold_stock_for_checkout Allows enable/disable hold stock functionality on checkout.
Usage
add_filter( 'woocommerce_hold_stock_for_checkout', 'wp_kama_woocommerce_hold_stock_for_checkout_filter' ); /** * Function for `woocommerce_hold_stock_for_checkout` filter-hook. * * @param bool $enabled Default to true if managing stock globally. * * @return bool */ function wp_kama_woocommerce_hold_stock_for_checkout_filter( $enabled ){ // filter... return $enabled; }
- $enabled(true|false)
- Default to true if managing stock globally.
Changelog
Since 4.3.0 | Introduced. |
Where the hook is called
woocommerce_hold_stock_for_checkout
woocommerce_hold_stock_for_checkout
woocommerce_hold_stock_for_checkout
woocommerce_hold_stock_for_checkout
woocommerce_hold_stock_for_checkout
woocommerce/includes/wc-stock-functions.php 422
if ( ! apply_filters( 'woocommerce_hold_stock_for_checkout', wc_string_to_bool( get_option( 'woocommerce_manage_stock', 'yes' ) ) ) ) {
woocommerce/includes/data-stores/class-wc-coupon-data-store-cpt.php 542
if ( ! apply_filters( 'woocommerce_hold_stock_for_checkout', true ) ) {
woocommerce/includes/data-stores/class-wc-coupon-data-store-cpt.php 641
if ( ! apply_filters( 'woocommerce_hold_stock_for_checkout', true ) ) {
woocommerce/includes/wc-stock-functions.php 446
if ( ! apply_filters( 'woocommerce_hold_stock_for_checkout', wc_string_to_bool( get_option( 'woocommerce_manage_stock', 'yes' ) ) ) ) {
woocommerce/includes/wc-stock-functions.php 473
if ( ! apply_filters( 'woocommerce_hold_stock_for_checkout', wc_string_to_bool( get_option( 'woocommerce_manage_stock', 'yes' ) ) ) ) {