Guest User

The Events Calendar PRO RSS feed dates

a guest
Jul 25th, 2013
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.72 KB | None | 0 0
  1. <?php
  2.  
  3. function action_rss2_evns() {
  4.     echo 'xmlns:ev="http://purl.org/rss/1.0/modules/event/"
  5.     xmlns:xCal="urn:ietf:params:xml:ns:xcal"';
  6. }
  7. add_action('rss2_ns', 'action_rss2_evns');
  8.  
  9. function action_rss2_eventdates() {
  10.     global $post;
  11.     if (tribe_is_event($post)) {
  12.         echo '<ev:startdate>'.tribe_get_start_date($post, false, 'D, d M Y H:i:s -0004').'</ev:startdate>';
  13.         echo '<ev:enddate>'.tribe_get_end_date($post, false, 'D, d M Y H:i:s -0004').'</ev:enddate>';
  14.         echo '<xCal:dtstart>'.tribe_get_start_date($post, false, 'D, d M Y H:i:s -0004').'</xCal:dtstart>';
  15.         echo '<xCal:dtend>'.tribe_get_end_date($post, false, 'D, d M Y H:i:s -0004').'</xCal:dtend>';
  16.     }
  17. }
  18. add_action('rss2_item', 'action_rss2_eventdates');
  19.  
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment