I have been studying the BuddyPress code to get some inspiration for building my own plugin. One of the things that I am struggling to understand is how exactly BuddyPress loads content on pages?
In my knowledge, it is possible to change the page template of a page using the template_redirect filter which can then be used to refer to another page template in your plugin folder.
Studying the BuddyPress code, I found that bits and portions of content that shows up on a single page is scattered between files. For instance, the Members page (which shows a list of all the members on the website) is split between activate.php, index.php, members-loop.php and register.php each of which is responsible for loading a different piece.
How does BuddyPress collaborate all these files to generate unified content?
Please give documentation references if possible.