WordPress.org

Ready to get started?Download WordPress

Forums

Event Organiser
[resolved] Event with "Reoccurrence: Custom" returns false for eo_reoccurs( (2 posts)

  1. gilomen2
    Member
    Posted 1 year ago #

    I have an event with reoccurrence set for multiple non-concurrent dates. In my single-event.php, I am trying to check if an event is recurring with eo_reoccurs(), but that event is returning false. If I set the same event to reoccur weekly, the code works as expected.

    Here is the code I'm using:

    <?php
    
    	echo '<div class="left half"><h4>Event occurs:</h4><ul>';
    									if(!eo_reoccurs()){
    										echo "This is <b>not</b> recurring";
    										if(eo_is_all_day()){
    											echo "<li>";
    											echo eo_get_the_start('F j, Y');
    											if(eo_get_the_end('F j, Y') > eo_get_the_start('F j, Y')){
    												echo " - ";
    												echo eo_get_the_end('F j, Y');
    											}
    											echo "</li>";
    										}
    										else{
    											echo "<li>";
    											echo eo_get_the_start('F j, Y');
    											echo " at ";
    											echo eo_get_the_start('g:i a');
    											if(eo_get_the_end('F j, Y') > eo_get_the_start('F j, Y')){
    												echo " - ";
    												echo eo_get_the_end('F j, Y');
    												echo " at ";
    												echo eo_get_the_end('g:i a');
    												echo "</li>";
    											}
    											else{
    												echo " - ";
    												echo eo_get_the_end('g:i a');
    												echo "</li>";
    												}
    										}
    									}
    									else{
    										echo "This is recurring";
    										$occurrences = eo_get_the_occurrences();
    										if($occurrences){
    											foreach ($occurrences as $occurrence){
    										               echo '<li>';
    										               echo $occurrence->format('F j, Y');
    										               if(!eo_is_all_day()){
    													      echo " at ";
    													      echo eo_get_the_start('g:i a');
    													      echo " - ";
    													      echo eo_get_the_end('g:i a');
    													      }
    													   else{
    														  echo eo_get_the_end('F j, Y');
    													   }
    													   echo '</li>';
    										          }
    										  }
    									}
    									echo '</ul></div>';
    								?>

    Here is the event in question: http://benfrank.statestreetdigital.com/classes-and-events/event/cake-decorating-basics/

    Here is a screenshot of the options (in case I have them configured incorrectly): https://dl.dropbox.com/u/8132517/recurrenceissue.png

    http://wordpress.org/extend/plugins/event-organiser/

  2. Stephen Harris
    Member
    Plugin Author

    Posted 1 year ago #

    Hi gilomen2 this is a minor bug with that function, and will be fixed shortly. It was raised in this thread and Andrebalza suggests an immediate work around (though using eo_reoccurs() is recommended). I've also posted the fix in case you want to make the changes yourself before the update is released.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic