Group Extension API – Getting group info in constructor
-
I’m trying to have a function that will process a form upload then redirect to another page. I thought of doing this in the constructor, but the current group information is not available there. ie:
class My_Group_Extension extends BP_Group_Extension {
function my_group_extension() {
global $bp;// Do stuff, needing group info, like the current group ID
wp_redirect($bp->root_domain .’/’. $bp->current_component .’/’. bp_get_group_slug() .’/’);
// The bp_get_group_slug is also not available
}None of the group info is available here, but it is in any functions after this. However, after this function the headers have already been sent and I cannot redirect. How can I accomplish this, or what is the proper way to do it?
Thanks!!
- The topic ‘Group Extension API – Getting group info in constructor’ is closed to new replies.