register(); ( new Admin() )->register(); ( new Frontend() )->register(); ( new Notifications() )->register(); ( new Privacy() )->register(); ( new I18n() )->register(); // Any change to bookings invalidates the cached "available dates". foreach ( array( 'bookzenix_appointment_created', 'bookzenix_appointment_status_changed', 'bookzenix_appointment_rescheduled' ) as $hook ) { add_action( $hook, array( __CLASS__, 'bump_availability_cache' ) ); } } public static function bump_availability_cache() { update_option( 'bookzenix_avail_ver', (int) get_option( 'bookzenix_avail_ver', 0 ) + 1, false ); } /** Table name helper: Plugin::table('appointments') => wp_bookzenix_appointments */ public static function table( $name ) { global $wpdb; return $wpdb->prefix . 'bookzenix_' . $name; } }