Skip to content

Instantly share code, notes, and snippets.

@lukecav
Forked from jessepearson/change_incart_bookings_expiry_minutes.php
Last active January 18, 2019 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukecav/258c29ea74fe995ee2b206c021c1aaaa to your computer and use it in GitHub Desktop.
Save lukecav/258c29ea74fe995ee2b206c021c1aaaa to your computer and use it in GitHub Desktop.
Change the amount of minutes for when an In Cart booking expires and gets deleted in WooCommerce Bookings
/**
* Will change the minutes it takes an In Cart booking to expire.
* This example reduces the number from 60 to 5.
*
* @param int $minutes 60 is the default passed
* @return int The amount of minutes you'd like to have In Cart bookings expire on.
*/
function change_incart_bookings_expiry_minutes( $minutes ) {
return 5;
}
add_filter( 'woocommerce_bookings_remove_inactive_cart_time', 'change_incart_bookings_expiry_minutes' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment