Created
November 2, 2015 16:04
-
-
Save justinshreve/7cf5c59883fee40efa93 to your computer and use it in GitHub Desktop.
Allows WooCommerce booking orders to be canceled by the cancel unpaid orders cron job.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Plugin Name: Cancel Unpaid Bookings | |
* Author: WooThemes | |
* Description: Allows booking orders to be canceled by the cancel unpaid orders cron job. | |
*/ | |
// woocommerce-cancel-unpaid-bookings.php | |
function woocommerce_cancel_unpaid_booking_orders_from_admin( $return, $order ) { | |
if ( 'wc-pending' === $order->post_status && '1' === get_post_meta( $order->id, '_booking_order', true ) ) { | |
return true; | |
} | |
return $return; | |
} | |
add_filter( 'woocommerce_cancel_unpaid_order', 'woocommerce_cancel_unpaid_booking_orders_from_admin', 20, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment