As I think more about this, there will be an issue, in that the plugin caches the parsed calendar data using WordPress transients, by default for one hour.
You can bypass that by adding reload="true"
to the shortcode, but that is not great for performance.
I think you’re on the right track with getting the current time in the template, because that won’t be affected by the caching. But then the event array would need to include more events than the number specified by count
, so it has something to work with as those events pass.
For now with your working change, using reload="true"
will suffice. But I think there will be potential timezone issues if you’re using the PHP time()
function. You may need to use the WordPress current_time()
function instead, which accounts for the timezone setting in WordPress.
-
This reply was modified 4 years ago by
room34.