Notifications
Clear all

wpForo 1.x.x [Closed] wpForo and Pods conflict

5 Posts
2 Users
1 Likes
1,863 Views
antonM
Posts: 131
Topic starter
(@antonm)
Estimable Member
Joined: 7 years ago

Hi guys!

I have a problem. I use Pods for create a custom post type (CPT) and after activating in Pods rewrite setting for my CPT I found that it not works. I found in file wpf-hooks.php call of function flush_rewrite_rules(). I guess that it flush Pods rewrite rules and my CPT not works. Is it possible to disable this function wpforo_do_rewrite()?

4 Replies
antonM
Posts: 131
Topic starter
(@antonm)
Estimable Member
Joined: 7 years ago
  • Flushing the rewrite rules is an expensive operation, there are tutorials and examples that suggest executing it on the 'init' hook. This is bad practice. It should be executed either on the 'shutdown' hook, or on plugin/theme (de)activation.
  • Flush rules only on activation or deactivation, or when you know that the rewrite rules need to be changed. Don't do it on any hook that will triggered on a routine basis. More detail information in the comments on WP Engineer's post: Custom Post Type and Permalink
add_action('init', 'wpforo_do_rewrite');

Is it really needed at any init?

https://codex.wordpress.org/Function_Reference/flush_rewrite_rules

Robert
Posts: 10503
Admin
(@robert)
Support Team
Joined: 8 years ago

Ok, thank you for letting us know, we'll take a look on this issue.

antonM
Posts: 131
Topic starter
(@antonm)
Estimable Member
Joined: 7 years ago

Dear Robert,

is there any information about resolve this problem?

Robert
Posts: 10503
Admin
(@robert)
Support Team
Joined: 8 years ago

We'll try to add this change in next release. It's cumming very soon.