PATH:
home
/
letacommog
/
laindinois
/
wp-content
/
plugins
/
woocommerce-bookings
/
includes
<?php if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } /** * Handle frontend forms */ class WC_Booking_Form_Handler { /** * Hook in methods */ public static function init() { add_action( 'init', array( __CLASS__, 'cancel_booking' ), 20 ); } /** * Cancel a booking. */ public static function cancel_booking() { if ( isset( $_GET['cancel_booking'] ) && isset( $_GET['booking_id'] ) ) { $booking_id = absint( $_GET['booking_id'] ); $booking = get_wc_booking( $booking_id ); $booking_can_cancel = $booking->has_status( get_wc_booking_statuses( 'cancel' ) ); $redirect = $_GET['redirect']; if ( $booking->has_status( 'cancelled' ) ) { // Already cancelled - take no action } elseif ( $booking_can_cancel && $booking->get_id() == $booking_id && isset( $_GET['_wpnonce'] ) && wp_verify_nonce( $_GET['_wpnonce'], 'woocommerce-bookings-cancel_booking' ) ) { // Cancel the booking $booking->update_status( 'cancelled' ); WC_Cache_Helper::get_transient_version( 'bookings', true ); // Message wc_add_notice( apply_filters( 'woocommerce_booking_cancelled_notice', __( 'Your booking was cancelled.', 'woocommerce-bookings' ) ), apply_filters( 'woocommerce_booking_cancelled_notice_type', 'notice' ) ); do_action( 'woocommerce_bookings_cancelled_booking', $booking->get_id() ); } elseif ( ! $booking_can_cancel ) { wc_add_notice( __( 'Your booking can no longer be cancelled. Please contact us if you need assistance.', 'woocommerce-bookings' ), 'error' ); } else { wc_add_notice( __( 'Invalid booking.', 'woocommerce-bookings' ), 'error' ); } if ( $redirect ) { wp_safe_redirect( $redirect ); exit; } } } } WC_Booking_Form_Handler::init();
[+]
..
[-] class-wc-bookings-wc-ajax.php
[edit]
[-] class-wc-booking-coupon.php
[edit]
[+]
emails
[-] class-wc-bookings-controller.php
[edit]
[-] class-wc-booking-cron-manager.php
[edit]
[+]
compatibility
[-] class-wc-product-booking-rule-manager.php
[edit]
[+]
addons
[-] class-wc-product-class-loader.php
[edit]
[-] class-wc-booking-checkout-manager.php
[edit]
[+]
admin
[+]
data-stores
[-] class-wc-booking-order-manager.php
[edit]
[-] class-wc-booking-email-manager.php
[edit]
[+]
data-objects
[-] class-wc-booking-privacy.php
[edit]
[-] class-wc-booking-form-handler.php
[edit]
[+]
gateways
[-] wc-bookings-functions.php
[edit]
[-] class-wc-product-booking-manager.php
[edit]
[+]
integrations
[+]
booking-form
[-] class-wc-bookings-ics-exporter.php
[edit]
[-] class-wc-booking-cart-manager.php
[edit]