WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Forms
[resolved] [Plugin: WordPress Forms] It breaks custom post-type permalinks when activ (4 posts)

  1. bfred.it
    Member
    Posted 3 years ago #

    I have More Types installed to have custom post-types, and as soon as I install this plugin my permalinks to those posts stop working: e.g. /?dog=chihuahua works while /dog/chihuahua doesn't anymore. The only fix is to click save on WP Permalinks page.

  2. Vitor Carvalho
    Member
    Plugin Author

    Posted 3 years ago #

    Its not a plugin problem its a custom post type bug that makes for any new custom post type the need to go to Permalinks page.
    Resolution expected in WordPress 3.1.
    Cheers

  3. zerfl
    Member
    Posted 3 years ago #

    Hello.

    This IS a bug in your plugin. Of course I don't mean the fact that the rewrite rules have to be flushed after registering a new custom post type, but the fact that you do SO on every single page load. That breaks all other custom content types.

    Line 224 in Forms.php

    The WP-Forms class constructor calls "flush_rewrite_rules()" everytime the class is initialized. You hook the class to "init", so on every page load it flushes the rewrite rules.

    A quick'n'dirty fix would be to remove that line, activate the plugin and visit the "Permalink"-settings once yourself. Now your other custom post types should work again.

    A proper fix would be to use register_activation_hook();

  4. Vitor Carvalho
    Member
    Plugin Author

    Posted 3 years ago #

    Hello zerfl, okay I will try that fix.
    Thank you ;)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic