Skip to content

Commit

Permalink
Ensure that students can request friendships on user profiles.
Browse files Browse the repository at this point in the history
The button was mistakenly excluded from users who don't have the
ability to send private messages, in #3388. See 402ca38

See #3451.
  • Loading branch information
boonebgorges committed Oct 25, 2024
1 parent 66e6b11 commit 19874b9
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions wp-content/themes/openlab/lib/member-funcs.php
Original file line number Diff line number Diff line change
Expand Up @@ -838,24 +838,27 @@ function cuny_member_profile_header() {
<a class="btn btn-default btn-block btn-primary link-btn" href="<?php echo $dud . 'profile/edit/'; ?>"><i class="fa fa-pencil" aria-hidden="true"></i> Edit Profile</a>
<a class="btn btn-default btn-block btn-primary link-btn" href="<?php echo $dud . 'profile/change-avatar/'; ?>"><i class="fa fa-camera" aria-hidden="true"></i> Change Avatar</a>
</div>
<?php elseif ( is_user_logged_in() && ! openlab_is_my_profile() && openlab_user_can_send_messages() ) : ?>
<?php elseif ( is_user_logged_in() && ! openlab_is_my_profile() ) : ?>

<?php bp_add_friend_button( openlab_fallback_user(), bp_loggedin_user_id() ); ?>

<?php
echo bp_get_button(
array(
'id' => 'private_message',
'component' => 'messages',
'must_be_logged_in' => true,
'block_self' => true,
'wrapper_id' => 'send-private-message',
'link_href' => bp_get_send_private_message_link(),
'link_title' => __( 'Send a private message to this user.', 'buddypress' ),
'link_text' => __( '<i class="fa fa-envelope" aria-hidden="true"></i> Send Message', 'buddypress' ),
'link_class' => 'send-message btn btn-default btn-block btn-primary link-btn',
<?php if ( openlab_user_can_send_messages() ) : ?>
<?php
echo bp_get_button(
array(
'id' => 'private_message',
'component' => 'messages',
'must_be_logged_in' => true,
'block_self' => true,
'wrapper_id' => 'send-private-message',
'link_href' => bp_get_send_private_message_link(),
'link_title' => __( 'Send a private message to this user.', 'buddypress' ),
'link_text' => __( '<i class="fa fa-envelope" aria-hidden="true"></i> Send Message', 'buddypress' ),
'link_class' => 'send-message btn btn-default btn-block btn-primary link-btn',
)
)
)
?>
?>
<?php endif; ?>

<?php endif ?>

Expand Down

0 comments on commit 19874b9

Please sign in to comment.