/** * Enqueue the plugin stylesheet(s). * * @author caseypicker * @since 3.9 * @return void */ public function enqueue_styles() { //Only enqueue wootickets styles on singular event page if (is_singular(Tribe__Tickets__Main::instance()->post_types())) { $stylesheet_url = $this->pluginUrl . 'src/resources/css/wootickets.css'; // Get minified CSS if it exists $stylesheet_url = Tribe__Template_Factory::getMinFile($stylesheet_url, true); // apply filters $stylesheet_url = apply_filters('tribe_wootickets_stylesheet_url', $stylesheet_url); wp_enqueue_style('TribeEventsWooTickets', $stylesheet_url, array(), apply_filters('tribe_events_wootickets_css_version', self::VERSION)); //Check for override stylesheet $user_stylesheet_url = Tribe__Tickets__Templates::locate_stylesheet('tribe-events/wootickets/wootickets.css'); $user_stylesheet_url = apply_filters('tribe_events_wootickets_stylesheet_url', $user_stylesheet_url); //If override stylesheet exists, then enqueue it if ($user_stylesheet_url) { wp_enqueue_style('tribe-events-wootickets-override-style', $user_stylesheet_url); } } }
/** * Adds content to the embed head tag * * The embed header DOES NOT have wp_head() executed inside of it. Instead, any scripts/styles * are explicitly output */ public function embed_head() { $css_path = Tribe__Template_Factory::getMinFile($this->plugin_url . 'src/resources/css/tickets-embed.css', true); $css_path = add_query_arg('ver', self::VERSION, $css_path); ?> <link rel="stylesheet" id="tribe-tickets-embed-css" href="<?php echo esc_url($css_path); ?> " type="text/css" media="all"> <?php }
/** * Tries to make data about global stock levels and global stock-enabled ticket objects * available to frontend scripts. * * @param array $tickets */ public static function add_frontend_stock_data(array $tickets) { // Add the frontend ticket form script as needed (we do this lazily since right now // it's only required for certain combinations of event/ticket if (!self::$frontend_script_enqueued) { $url = Tribe__Tickets__Main::instance()->plugin_url . 'src/resources/js/frontend-ticket-form.js'; $url = Tribe__Template_Factory::getMinFile($url, true); wp_enqueue_script('tribe_tickets_frontend_tickets', $url, array('jquery'), Tribe__Tickets__Main::VERSION, true); add_action('wp_footer', array(__CLASS__, 'enqueue_frontend_stock_data'), 1); } self::$frontend_ticket_data += $tickets; }
/** * Enquues a script to handle live refresh of the date previews. */ public function live_refresh_script() { $url = Tribe__Template_Factory::getMinFile(tribe_resource_url('admin-date-preview.js', false, 'common'), true); wp_enqueue_script('tribe-date-live-refresh', $url, array('jquery'), false, true); }
/** * registers resources */ public function register_resources() { $main = Tribe__Tickets__Main::instance(); $stylesheet_url = $main->plugin_url . 'src/resources/css/rsvp.css'; $stylesheet_url = Tribe__Template_Factory::getMinFile($stylesheet_url, true); // apply filters $stylesheet_url = apply_filters('tribe_tickets_rsvp_stylesheet_url', $stylesheet_url); wp_register_style('event-tickets-rsvp', $stylesheet_url, array(), apply_filters('tribe_tickets_rsvp_css_version', Tribe__Tickets__Main::VERSION)); $js_url = $main->plugin_url . 'src/resources/js/rsvp.js'; $js_url = Tribe__Template_Factory::getMinFile($js_url, true); $js_url = apply_filters('tribe_tickets_rsvp_js_url', $js_url); wp_register_script('event-tickets-rsvp', $js_url, array('jquery', 'jquery-ui-datepicker'), apply_filters('tribe_tickets_rsvp_js_version', Tribe__Tickets__Main::VERSION), true); wp_localize_script('event-tickets-rsvp', 'tribe_tickets_rsvp_strings', array('attendee' => _x('Attendee %1$s', 'Attendee number', 'event-tickets'))); }