public function __construct() { self::$plugin_version = plugin::get_plugin_version(); parent::__construct('_bpt_widget_calendar', __('Brown Paper Tickets Calendar Widget', 'brown-paper-tickets-locale'), array('description', __('Simple widget to display events in a calendar.', 'brown-paper-tickets-locale'))); if (is_active_widget(false, false, $this->id_base, true)) { } }
/** * Shortcode stuff! */ public static function list_event_shortcode($atts) { global $post; if (is_home() || is_a($post, 'WP_Post') && has_shortcode($post->post_content, 'list-events') || is_a($post, 'WP_Post') && has_shortcode($post->post_content, 'list_events') || is_a($post, 'WP_Post') && has_shortcode($post->post_content, 'list-event') || is_a($post, 'WP_Post') && has_shortcode($post->post_content, 'list_event')) { $event_list_attributes = shortcode_atts(array('event_id' => null, 'client_id' => null, 'event-id' => null, 'client-id' => null), $atts); $localized_variables = array('ajaxurl' => admin_url('admin-ajax.php'), 'bptNonce' => wp_create_nonce('bpt-event-list-nonce'), 'postID' => $post->ID); $purchase_options = get_option('_bpt_purchase_settings'); if (isset($purchase_options['enable_sales'])) { $localized_variables['enableSales'] = $purchase_options['enable_sales']; } if ($event_list_attributes['event_id']) { $localized_variables['eventID'] = $event_list_attributes['event_id']; } if ($event_list_attributes['event-id']) { $localized_variables['eventID'] = $event_list_attributes['event-id']; } if ($event_list_attributes['client-id']) { $localized_variables['clientID'] = $event_list_attributes['client-id']; } if ($event_list_attributes['client_id']) { $localized_variables['clientID'] = $event_list_attributes['client_id']; } wp_enqueue_style('bpt_event_list_css', plugins_url('/assets/css/bpt-event-list-shortcode.css', __FILE__), array(), plugin::get_plugin_version()); wp_register_script('event_feed_js_' . $post->ID, plugins_url('/assets/js/event-feed.js', __FILE__), array('jquery', 'underscore', 'ractive_js', 'ractive_transitions_slide_js', 'moment_with_langs_min'), null, true); wp_enqueue_script('event_feed_js_' . $post->ID); wp_localize_script('event_feed_js_' . $post->ID, 'bptEventFeedAjaxPost' . $post->ID, $localized_variables); } return require __DIR__ . '/assets/templates/event-list.php'; }
<?php require_once plugin_dir_path(__FILE__) . '../src/brown-paper-tickets-plugin.php'; use BrownPaperTickets\BPTFeed; use BrownPaperTickets\BPTPlugin; $menu_slug = BPTPlugin::get_menu_slug(); $plugin_slug = BPTPlugin::get_plugin_slug(); $plugin_version = BPTPlugin::get_plugin_version(); ?> <h1> <img src="<?php echo esc_url(plugins_url('public//assets/img/bpt.png', dirname(__FILE__))); ?> "> </h1> <div class="wrap"> <div class="bpt-welcome-panel"> <div class="bpt-welcome-panel-content"> </div> <div class="bpt-welcome-panel-content"> <h2>Please be aware that this plugin is a beta release. You may encounter errors and bugs.</h2> <p> If you are having issues with your Client ID or your Developer ID, please email <a href="mailto:support@brownpapertickets.com">support@brownpapertickets.com</a>. </p> <h3> If you would like to request a new feature or if you have encountered a bug, please go <a target="_blank" href="https://github.com/BrownPaperTickets/brown-paper-tickets-wordpress/issues/new">here</a></span> to open up a new issue. </h3> </div> <span class="bpt-welcome-info-plugin-info">Plugin Info: <?php