• Resolved Craig F.

    (@iprogressltd)


    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 uses admin-ajax.php), so if we give it the home_url() link, then the next/prev links will always display as https://www.example.com/?eo_month=2014-07

    https://www.ads-software.com/plugins/event-organiser/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Stephen Harris

    (@stephenharris)

    Thanks, you are correct. However, the link shouldn’t really matter – the calendar is navigated by ajax. If the link is actually used (e.g. the page reloads) then you either there is a javascript bug present on the page or the theme hasn’t registered the sidebar properly (see FAQ on how to fix this).

    That said, if a page reload is happening, then the mark-up is never produced in the context of an ajax response, so the error doesn’t appear.

    I’ll fix this nonetheless (see issue #208)

    Thread Starter Craig F.

    (@iprogressltd)

    No, there’s no page reload. The widget works fine, however I don’t think it’s a good idea to be displaying wp-admin links on the front end. It’s more of a cosmetic fix than anything.

    Thanks for your response!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Bug in next/prev links in calendar widget’ is closed to new replies.