Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action('after_wcfm_load_scripts', function($endpoint) {
- if('wcfm-bookings-calendar' === $endpoint) {
- if (defined('WC_BOOKINGS_VERSION') && version_compare(WC_BOOKINGS_VERSION, '1.15.0', '>=')) {
- $admin_script_dependencies = wc_booking_get_script_dependencies( 'admin', [ 'jquery-ui-datepicker', 'jquery-ui-sortable' ] );
- wp_enqueue_script( 'wc_bookings_admin_js', WC_BOOKINGS_PLUGIN_URL . '/dist/admin.js', $admin_script_dependencies, WC_BOOKINGS_VERSION, true );
- if (WC_BOOKINGS_GUTENBERG_EXISTS) {
- $admin_calendar_gutenberg_deps = wc_booking_get_script_dependencies( 'admin-calendar-gutenberg', array( 'wc_bookings_admin_js' ) );
- wp_enqueue_script( 'wc_bookings_admin_calendar_gutenberg_js', WC_BOOKINGS_PLUGIN_URL . '/dist/admin-calendar-gutenberg.js', $admin_calendar_gutenberg_deps, WC_BOOKINGS_VERSION, true );
- }
- wp_enqueue_script( 'wc_bookings_admin_calendar_js', WC_BOOKINGS_PLUGIN_URL . '/dist/admin-calendar.js', wc_booking_get_script_dependencies( 'admin-calendar' ), WC_BOOKINGS_VERSION, true );
- }
- }
- }, 29);
- add_action( 'wp_footer', function() {
- global $wp;
- if( is_wcfm_page() && isset($wp->query_vars['wcfm-bookings-calendar']) && class_exists( 'WC_Site_Tracking' )) {
- WC_Site_Tracking::add_tracking_function();
- }
- } );
- add_action('after_wcfm_load_styles', function($endpoint) {
- if('wcfm-bookings-calendar' === $endpoint && WC_BOOKINGS_GUTENBERG_EXISTS) {
- wp_enqueue_style('wc_bookings_admin_calendar_css', WC_BOOKINGS_PLUGIN_URL.'/dist/admin-calendar-gutenberg.css', null, WC_BOOKINGS_VERSION);
- $calendar_event_popup_css = "
- .wc-bookings-calendar-popover .components-popover__content {
- background: #fff;
- border-radius: 4px;
- box-shadow: 0 0 0 1px #ccc,0 2px 3px #0000000d,0 4px 5px #0000000a,0 12px 12px #00000008,0 16px 16px #00000005;
- box-sizing: border-box;
- width: min-content;
- }";
- wp_add_inline_style( 'wc_bookings_admin_calendar_css', $calendar_event_popup_css );
- }
- }, 29);
Advertisement
Add Comment
Please, Sign In to add comment