I´m running a wordpress/buddypess/bbpress combination and I also need to change the permalink structure, in a bit different way then eleram – I´m looking for a more logic structure in all forums: example.com/forum/name-of-forum/name-of-post/
-> replace slug “forum” by name of forum
-> replace “topic” by name of topic
I can customize the code, but I´m not sure where to look on.
@John: “WordPress handles the rewrite rules for bbPress’s content types” -> where do I have to look for (bbpress´ custom post types) to adjust the permalink logic?
Of course I will share my customization as soon a sfinished.
The BuddyPress permalink structure is hardcoded to look for specific criteria in specific positions. It doesn’t really scale well, and we’re going to change it in future versions to use proper rewrite rules, but until then it would be a huge nightmare to change; even then, your changes would end up broken when we make improvements to the API.
The rewrite rules themselves get created in register_post_type() in /wp-includes/post.php. Lots of complex logic in there, and I doubt there are many better examples on how to write your own rewrite rules completely from scratch than inside that function.
You´re right, that´s pretty deep in the core. Though from a SEO perspective it´s also a nightmare to start a project with URLs you have to rewrite later – Let me know if I can contribute in this special case, the project itsels made huge steps forward – thanks for your work.