Created
May 10, 2017 16:33
-
-
Save jasontucker/bf3fc3dc8b8805697cd55e50d8a58bdd to your computer and use it in GitHub Desktop.
WordPress Display Event Time shortcode using WordTimeBuddy.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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