Finally! I find the solution for this issue. flush_rewrite_rules ()
doesn’t work if you don’t add rules before call it. So we need add our rules on plugin activation and only after this call flush_rewrite_rules ()
. I call this function and pass false
arg because we need soft flush, without .htaccess rewriting.
Github repo already updated.
@pooledge your forum http://pupyshevo.hol.es/forums/forum/9/ work perfectly with digit in links right now.
I think that add_action (‘init’, ‘bbp_permalinks_init’, 0); is bad. I attach my function with add rewrite rules on bbp_init hook.
Need to check when you call bbp_init hook.
Dear Kolya, your fix works like a charm. Still there is a plugin unrelated bug while using cyrillic forum prefixes, but hey with you plugin working I can live with that until it’s being fixed.
Thank you very much for the excellent support,
Oleg
This happens when you change bbPress settings. For example forum slug or topic slug. Right now this can be fixed by flushing rewrite rules manually. My plugin don’t add any rules and hooks on this event. I keep digging into bbPress.
@pooledge just update my super-duper plugin 🙂 now it works fine with all permalink setups. Checkout and update — https://github.com/korobochkin/bbPress-permalinks-with-id
Known issue
If permalink looks like site.com?p=123
(not pretty permalink), the topic and reply edit links looks like:
site.com/?post_type=topic&p=814&topic=TOPIC_SLUG&edit=1
// TOPIC_SLUG — I dont known right now how to delete it but works fine with this parameter.
The plugin comes to wordpress org! Checkout https://wordpress.org/plugins/bbpress-permalinks-with-id/
Right now without auto flushing rules 😭