function customized_tribe_single_event_links() { if (is_single() && post_password_required()) { return; } echo '<div class="tribe-events-cal-links">'; echo '<a class="tribe-events-ical tribe-events-button button" href="' . tribe_get_single_ical_link() . '">+ Add to Calendar </a>'; echo '<a class="tribe-events-gcal tribe-events-button button" href="' . tribe_get_gcal_link() . '" title="' . __('Add to Google', 'tribe-events-calendar-pro') . '"><i class="fa fa-google-plus"></i> Add to Google </a>'; echo '</div><!-- .tribe-events-cal-links -->'; }
/** * Generates the markup for iCal and gCal single event links * * @return void * @since 3.0 **/ public static function single_event_links() { // don't show on password protected posts if (is_single() && post_password_required()) { return; } echo '<div class="tribe-events-cal-links">'; echo '<a class="tribe-events-gcal tribe-events-button" href="' . tribe_get_gcal_link() . '" title="' . __('Add to Google Calendar', 'tribe-events-calendar-pro') . '">+ ' . __('Google Calendar', 'tribe-events-calendar-pro') . '</a>'; echo '<a class="tribe-events-ical tribe-events-button" href="' . tribe_get_single_ical_link() . '">+ ' . __('iCal Import', 'tribe-events-calendar-pro') . '</a>'; echo '</div><!-- .tribe-events-cal-links -->'; }
/** * Generates the markup for iCal and gCal single event links * * @return void **/ public static function single_event_links() { // don't show on password protected posts if (is_single() && post_password_required()) { return; } echo '<div class="tribe-events-cal-links">'; echo '<a class="tribe-events-gcal tribe-events-button" href="' . Tribe__Events__Main::instance()->esc_gcal_url(tribe_get_gcal_link()) . '" title="' . esc_attr__('Add to Google Calendar', 'tribe-events-calendar') . '">+ ' . esc_html__('Google Calendar', 'tribe-events-calendar') . '</a>'; echo '<a class="tribe-events-ical tribe-events-button" href="' . esc_url(tribe_get_single_ical_link()) . '" title="' . esc_attr__('Download .ics file', 'tribe-events-calendar') . '" >+ ' . esc_html__('iCal Export', 'tribe-events-calendar') . '</a>'; echo '</div><!-- .tribe-events-cal-links -->'; }
/** * Check to make sure that get_ical_link function works as expected * * @uses $post_example_settings */ public function test_get_ical_link_single() { global $post; $post = get_post(Tribe__Events__API::createEvent($this->post_example_settings)); $this->assertTrue($post instanceof WP_Post, 'Check that post creates properly'); $ical_link_single_via_object = Tribe__Events__iCal::get_ical_link('single'); $this->assertNotEmpty(filter_var($ical_link_single_via_object, FILTER_VALIDATE_URL), 'Checking that we get back a valid URL from object'); $ical_link_single_via_function = tribe_get_single_ical_link(); $this->assertNotEmpty(filter_var($ical_link_single_via_function, FILTER_VALIDATE_URL), 'Checking that we get back a valid URL from function'); $this->assertEquals($ical_link_single_via_object, $ical_link_single_via_function, 'Check that the function and object get the same result'); }
/** * Front-end display of widget. * * @see WP_Widget::widget() * * @param array $args Widget arguments. * @param array $instance Saved values from database. */ public function widget($args, $instance) { // nombre de boutons ? if (!empty($instance['totalbts'])) { $totalbts = $instance['totalbts']; } else { $totalbts = 0; // masque tout si pas de données } echo $args['before_widget']; echo "<div class='pbuttons_group'>"; for ($x = 1; $x <= $instance['totalbts']; $x++) { if (!empty($instance['title' . $x])) { $title = "<span class='title'>" . apply_filters('widget_title', $instance['title' . $x]) . "</span>"; } else { $title = ''; } if (!empty($instance['subtitle' . $x])) { $subtitle = "<span class='subtitle'>" . apply_filters('widget_title', $instance['subtitle' . $x]) . "</span>"; } else { $subtitle = ''; } if (!empty($instance['link' . $x])) { $hrefBlock = 'href="' . stripslashes($instance['link' . $x]) . '"'; } else { $hrefBlock = ''; } if (!empty($instance['type' . $x])) { $type = $instance['type' . $x]; } else { $type = "simple"; } if (!empty($instance['blank' . $x])) { $blank = $instance['blank' . $x] ? " target='_blank' " : ""; } else { $blank = ''; } switch ($type) { case 'simple': $addclass = "simple-btn"; $finaltitle = $title . "<br/>" . $subtitle; break; case 'telechargement': $addclass = "dl-btn"; $title = $title . "<br/>" . $subtitle; //if (preg_match("#guitare#", $title)) { $finaltitle = preg_replace('/(\\(.+\\))/i', "<span class='filetype'>\$1</span>", $title); break; case 'iCal': $addclass = "cal-btn"; $finaltitle = $title . "<br/>" . $subtitle; $hrefBlock = 'href="' . tribe_get_single_ical_link() . '"'; break; case 'googleCal': $addclass = "cal-btn"; $finaltitle = $title . "<br/>" . $subtitle; $hrefBlock = 'href="' . tribe_get_gcal_link() . '"'; break; } echo '<a ' . $hrefBlock . ' title="' . addslashes($title) . '" class="button groupe long ih-item ' . $addclass . '" ' . $blank . '>' . $finaltitle . '</a>'; } echo "</div>"; echo $args['after_widget']; }
/** * @deprecated */ function sp_get_single_ical_link() { if (function_exists('tribe_get_single_ical_link')) { _deprecated_function(__FUNCTION__, '2.0', 'tribe_get_single_ical_link()'); return tribe_get_single_ical_link(); } }
?> <p><a class="btn red" href="<?php echo $reglink; ?> ">Register Here</a></p> <?php } ?> </div> <?php if (function_exists('tribe_get_single_ical_link')) { ?> <a class="ical single" href="<?php echo tribe_get_single_ical_link(); ?> "><?php _e('iCal Import', 'tribe-events-calendar'); ?> </a> <?php } if (function_exists('tribe_get_gcal_link')) { ?> <a href="<?php echo tribe_get_gcal_link(); ?> " class="gcal-add" title="<?php _e('Add to Google Calendar', 'tribe-events-calendar'); ?>
/** * Prints links for single events */ function grve_single_event_links() { // don't show on password protected posts if (is_single() && post_password_required()) { return; } echo '<div class="grve-tribe-events-cal-links">'; echo '<a class="grve-btn grve-btn-extrasmall grve-square grve-bg-primary-1" href="' . tribe_get_gcal_link() . '" title="' . __('Add to Google Calendar', GRVE_THEME_TRANSLATE) . '"><span>' . __('Google Calendar', GRVE_THEME_TRANSLATE) . '</span></a>'; echo '<a class="grve-btn grve-btn-extrasmall grve-square grve-grey-color" href="' . tribe_get_single_ical_link() . '" title="' . __('Download .ics file', GRVE_THEME_TRANSLATE) . '" ><span>' . __('iCal Export', GRVE_THEME_TRANSLATE) . '</span></a>'; echo '</div>'; }