Bug in next/prev links in calendar widget
-
I noticed that the next/prev links in the calendar widget change to
/wp-admin/admin-ajax.php...
after you click it the first time. (You can see this happen in your demo here: https://wp-event-organiser.com/demo/ )This can be fixed in
class-eo-calendar-widget.php
by changing line 274 to:add_query_arg( 'eo_month', $last_month->format( 'Y-m' ), home_url() ),
And line 277 to:
add_query_arg( 'eo_month', $next_month->format( 'Y-m' ), home_url() ),
The reason for this is because the
add_query_arg
function accepts a 3rd parameter for permalink. If no permalink is supplied (like in the current code), it uses whatever link is used to access the function to build the link (in this case, it usesadmin-ajax.php
), so if we give it thehome_url()
link, then the next/prev links will always display ashttps://www.example.com/?eo_month=2014-07
- The topic ‘Bug in next/prev links in calendar widget’ is closed to new replies.