Ready to get started?Download WordPress


[resolved] [Plugin: The Events Calendar] Seems to affect add_rewrite_rule (6 posts)

  1. ide79
    Posted 4 years ago #

    I am using my own template with a custom page. The custom page displays data from an other database by variables. I use add_rewrite_rule and add_rewrite_tag (functions.php) to make the variables look nice in the urls when displaying the custom page. When I activate this plugin the NICE urls don't work (404) in the custom page. Does this plugin affect to the add_rewrite rule?

    Btw, this is a nice plugin.


  2. Shane Pearlman
    Modern Tribe
    Posted 4 years ago #

    It sure does!

    We have actually added a patch to improve how the rewrite rules function for pretty permalinks as we had a few bugs in the current release. The patch will be out with the next release, which I am hoping to do some time this week.

    If you are in a hurry - you can use the hotfix from here: http://wordpress.org/support/topic/354580?replies=13

  3. ide79
    Posted 4 years ago #

    Ok. It did not work for me, but i tested something in the-events-calendar.php i removed the add_action( 'init' array ( $this, 'flushRewriterules')); about line 320 and now it works.

  4. Shane Pearlman
    Modern Tribe
    Posted 4 years ago #


  5. ide79
    Posted 4 years ago #

    It would be nice to know how to get add_rewrite_rule to work when this plugin is active.

    rewrite rules works nicely in the posts and the event, but when using functions.php and a custom page template it does not work (404).

    if i remove the (flushRewriterules)in the-events-calendar.php it works.

    is there anyway to use add_rewrite_rule when this plugin is active? or does the flushRewriterules override my own rewriterule in functions.php and custom page tempalte.

    I dont think that removing the flushRewriterules line in the-events-calendar.php is the right way to proceed.

  6. Shane Pearlman
    Modern Tribe
    Posted 4 years ago #

    I was chatting with kelsey and we agree that we don't really need to flush the rewrite rules every time the plugin loads, as it seems to have consequences on other people's plugins which might not expect this to happen.

    It's hard to say how to get your add_rewrite_rule() call to work without seeing the context of your code. We can probably just get away with doing a rewrite flush when the plugin is activated. We'll change how it works for the 1.6 release.

Topic Closed

This topic has been closed to new replies.

About this Topic