Skip to content

Instantly share code, notes, and snippets.

@jasontucker
Created May 10, 2017 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasontucker/bf3fc3dc8b8805697cd55e50d8a58bdd to your computer and use it in GitHub Desktop.
Save jasontucker/bf3fc3dc8b8805697cd55e50d8a58bdd to your computer and use it in GitHub Desktop.
WordPress Display Event Time shortcode using WordTimeBuddy.com
function display_event_time( $atts ) {
$a = shortcode_atts( array(
'day' => '12/13/2014',
'time' => '14.00',
), $atts );
$add = '<span class="wtb-ew-v1" style="width: 560px; display:inline-block">
<script src="https://www.worldtimebuddy.com/event_widget.js?h=5368361&md=' . esc_attr($a['day']) . '&mt=' . esc_attr($a['time']) . '&ml=1.00&sts=0&sln=0&wt=ew-ltc"></script>
<i><a target="_blank" href="https://www.worldtimebuddy.com/">Time converter</a> at worldtimebuddy.com</i><noscript><a href="https://www.worldtimebuddy.com/">Time converter</a> at worldtimebuddy.com</noscript><script>window[wtb_event_widgets.pop()].init()</script></span>
';
return $add;
}
add_shortcode( 'event_time', 'display_event_time' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment