Working code for anyone who needs it
-
Noticed function bppp_get_progression_block() didn’t work on pages outside of buddypress.
Another user posted some code which gave helped me to understand why….
I have changed the the code slightly so it will always return the current user and not the id of the profile you are viewing.
You will need to edit bppp_template.php and replace bppp_get_progression_block with the code below.
function bppp_get_progression_block($user_id=false,$args=false){ //if no user_id set, but function used on buddypress profile page, use displayed user id //if (!$user_id && bp_is_user_profile()) $user_id = bp_displayed_user_id(); - old code if (!$user_id && bp_is_user_profile()) $user_id = get_current_user_id(); //if no user_id set and function not used on buddypress profile page, stop executing //if (!$user_id && !bp_is_user_profile()) return false; - old code if (!$user_id && !bp_is_user_profile()) $user_id = get_current_user_id(); // $user_id = bp_displayed_user_id($user_id); // if(!$user_id) return false; //if user_id is set, exectute code //populate user ID bppp()->user_id = $user_id; ob_start(); bppp_locate_template( 'bppp-member.php', true ); $block = ob_get_contents(); ob_end_clean(); return apply_filters('bppp_get_progression_block',$block,$user_id); }
Also…. I changed function bppp_title so the “My Profile Progession” is always clickable to the users profile.
function bppp_title($user_id=false){ $user_id = bppp_get_user_id($user_id); $title = bppp_get_title($user_id); $title = '<a title="'.bppp_get_caption($user_id).'" href="'.bppp_get_link($user_id).'">'.$title.'</a>'; // OLD CODE // if(bp_is_my_profile()){ // $title = '<a title="'.bppp_get_caption($user_id).'" href="'.bppp_get_link($user_id).'">'.$title.'</a>'; //} echo $title; }
I hope people find this useful.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Working code for anyone who needs it’ is closed to new replies.