Plugin Directory

Changeset 2483951


Ignore:
Timestamp:
03/02/2021 01:25:05 AM (5 years ago)
Author:
marcshowpass
Message:

new calendar widget shortcode

Location:
showpass/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • showpass/trunk/js/showpass-custom.js

    r2441871 r2483951  
    8181            }, 500);
    8282        }
     83
     84        $('body').on('click', '.open-calendar-widget', function(e) {
     85            e.preventDefault();
     86
     87            var id = $(this).attr('data-org-id');
     88            var params = {
     89                'theme-primary': $(this).attr('data-color') || $('#option_widget_color').val(),
     90            };
     91
     92            showpass.tickets.calendarWidget(id, params);
     93        });
    8394
    8495        $('body').on('click', '.open-product-widget', function(e) {
  • showpass/trunk/showpass-wordpress-plugin-shortcode.php

    r2441871 r2483951  
    922922add_shortcode('showpass_cart_button', 'wpshp_cart_button');
    923923
     924//[showpass_calendar_widget]
     925function wpshp_calendar_widget($atts, $content = null) {
     926
     927  $organization_id = get_option('option_organization_id');
     928
     929  if ($organization_id) {
     930    if (isset($atts['label'])) {
     931      $label = $atts['label'];
     932    } else {
     933      $label = 'Get Tickets';
     934    }
     935    $button = '<span data-org-id="'.$organization_id.'" class="showpass-button open-calendar-widget href="#">'.$label.'</span>';
     936    return $button;
     937  } else {
     938    return 'Please add your Showpass Organizer ID to your Wordpress Dashboard.';
     939  }
     940
     941}
     942
     943add_shortcode('showpass_calendar_widget', 'wpshp_calendar_widget');
     944
    924945function showpass_scripts(){
    925   if (!is_admin()) {
     946   /*if (!is_admin()) {*/
    926947    wp_dequeue_script('jquery');
    927948    wp_enqueue_script('showpass-sdk', plugins_url( '/js/showpass-sdk.js', __FILE__ ), array('jquery'), '1.0.0', true );
     
    939960    wp_enqueue_script('showpass-custom', plugins_url( '/js/showpass-custom.js', __FILE__ ), array('jquery'), null, false);
    940961    wp_enqueue_script('jquery-showpass');
    941   }
     962  /*}*/
    942963}
    943964
  • showpass/trunk/showpass-wordpress-plugin.php

    r2457209 r2483951  
    55     Description: List events, display event details and products. Use the Showpass purchase widget for on site ticket & product purchases all with easy to use shortcodes. See our git repo here for full documentation. https://github.com/showpass/showpass-wordpress-plugin
    66     Author: Showpass / Up In Code Inc.
    7      Version: 3.5.3
     7     Version: 3.5.4
    88     Author URI: https://www.showpass.com
    99     */
Note: See TracChangeset for help on using the changeset viewer.