Explanation for recurring coding pattern in BP core
-
After the very helpful response of @hnla to an earlier question I posted I’ve been reading through more of the core files to understand what I can and can’t hook into, and there is a recurring pattern I see in how the files are set up and I’m curious as to why, if anyone is able to elucidate.
Random example, from bp-members-template.php
function bp_members_slug() { echo bp_get_members_slug(); } function bp_get_members_slug() { global $bp; return apply_filters( 'bp_get_members_slug', $bp->members->slug ); }
If all bp_members_slug() does is echo bp_get_members_slug(), why not just use bp_get_members_slug() directly?
It is such a common pattern there is obviously a good reason for it…
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Explanation for recurring coding pattern in BP core’ is closed to new replies.