File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2384,8 +2384,23 @@ function openlab_bp_group_site_pages( $mobile = false ) {
23842384
23852385 ?>
23862386
2387- <?php /* Abstract the displayed user id, so that this function works properly on my-* pages */ ?>
2388- <?php $ displayed_user_id = bp_is_user () ? bp_displayed_user_id () : bp_loggedin_user_id (); ?>
2387+ <?php
2388+ /*
2389+ * Determine the current user ID.
2390+ * 1. On a user page, use the displayed user ID.
2391+ * 2. On portfolio groups, use the ID of the user to whom the portfolio belongs.
2392+ * 3. Otherwise, use the logged-in user ID.
2393+ */
2394+ $ displayed_user_id = bp_loggedin_user_id ();
2395+ if ( bp_is_user () ) {
2396+ $ displayed_user_id = bp_displayed_user_id ();
2397+ } elseif ( cboxol_is_portfolio () ) {
2398+ $ group_owner_id = openlab_get_user_id_from_portfolio_group_id ( $ group_id );
2399+ if ( $ group_owner_id ) {
2400+ $ displayed_user_id = $ group_owner_id ;
2401+ }
2402+ }
2403+ ?>
23892404
23902405 <div class="sidebar-block group-site-links <?php echo esc_html ( $ responsive_class ); ?> ">
23912406
You can’t perform that action at this time.
0 commit comments