Skip to content

Commit

Permalink
Use bp_get_group_url() instead of bp_get_group_permalink.
Browse files Browse the repository at this point in the history
  • Loading branch information
boonebgorges committed Nov 15, 2024
1 parent b2ac241 commit f0658d4
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion classes/Upgrades/NavMenus.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function process( $item ) {
$site_id = cboxol_get_group_site_id( $group_id );
$group = groups_get_group( $group_id );
$group_type = cboxol_get_group_group_type( $group_id );
$home_url = bp_get_group_permalink( $group );
$home_url = bp_get_group_url( $group );
} else {
$site_id = $item->get_value( 'site_id' );
$group_type = cboxol_get_group_type( $item->get_value( 'group_type' ) );
Expand Down
2 changes: 1 addition & 1 deletion includes/clone.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ function openlab_get_group_data_for_clone_history( $source_id ) {

$source_data = array(
'group_id' => $source_id,
'group_url' => bp_get_group_permalink( $source_group ),
'group_url' => bp_get_group_url( $source_group ),
'group_name' => $course_code ? $course_code : $group_type_label,
'group_admins' => $admins,
'group_creator_id' => $source_group->creator_id,
Expand Down
10 changes: 5 additions & 5 deletions includes/group-sites.php
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ function openlab_group_blog_activity( $activity ) {
__( '%1$s wrote a new blog post %2$s in the group %3$s', 'commons-in-a-box' ),
bp_core_get_userlink( $activity->user_id ),
'<a href="' . get_permalink( $post->ID ) . '">' . esc_html( $post->post_title ) . '</a>',
'<a href="' . bp_get_group_permalink( $group ) . '">' . esc_html( $group->name ) . '</a>'
'<a href="' . esc_url( bp_get_group_url( $group ) ) . '">' . esc_html( $group->name ) . '</a>'
);
} else {
$userlink = '';
Expand All @@ -545,7 +545,7 @@ function openlab_group_blog_activity( $activity ) {
__( '%1$s commented on %2$s in the group %3$s', 'commons-in-a-box' ),
$userlink,
'<a href="' . get_permalink( $post->ID ) . '">' . esc_html( $post->post_title ) . '</a>',
'<a href="' . bp_get_group_permalink( $group ) . '">' . esc_html( $group->name ) . '</a>'
'<a href="' . esc_url( bp_get_group_url( $group ) ) . '">' . esc_html( $group->name ) . '</a>'
);
}

Expand Down Expand Up @@ -1165,7 +1165,7 @@ function openlab_convert_feed_to_activity( $items = array(), $item_type = 'posts

$group = groups_get_current_group();
$group_name = $group->name;
$group_permalink = bp_get_group_permalink( $group );
$group_permalink = bp_get_group_url( $group );

$group_link = sprintf(
'<a href="%s">%s</a>',
Expand Down Expand Up @@ -1834,7 +1834,7 @@ function( $v ) use ( $source_site_url, $source_site_upload_dir, $dest_site_url,
$nav_items['group'],
array(
'menu-item-title' => '[ ' . $group_type->get_label( 'group_home' ) . ' ]',
'menu-item-url' => bp_get_group_permalink( $group ),
'menu-item-url' => bp_get_group_url( $group ),
'menu-item-status' => 'publish',
'menu-item-position' => -2,
'menu-item-classes' => 'group-profile-link',
Expand Down Expand Up @@ -2114,7 +2114,7 @@ function cboxol_get_nav_menu_items() {
'object_id' => $group_id,
'object' => 'custom',
'title' => '[ ' . $group_type->get_label( 'group_home' ) . ' ]',
'url' => bp_get_group_permalink( $group ),
'url' => bp_get_group_url( $group ),
'slug' => 'group-profile-link',
'type' => 'custom',
'classes' => [ 'group-profile-link' ],
Expand Down
6 changes: 3 additions & 3 deletions includes/network-toolbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -921,17 +921,17 @@ public function add_invites_menu( $wp_admin_bar ) {
foreach ( (array) $invites['groups'] as $group ) {
if ( $group_counter < 3 ) {
// avatar
$title = '<div class="row"><div class="col-sm-6"><div class="item-avatar"><a href="' . bp_get_group_permalink( $group ) . '"><img class="img-responsive" src ="' . bp_core_fetch_avatar(
$title = '<div class="row"><div class="col-sm-6"><div class="item-avatar"><a href="' . esc_url( bp_get_group_url( $group ) ) . '"><img class="img-responsive" src ="' . bp_core_fetch_avatar(
array(
'item_id' => $group->id,
'object' => 'group',
'type' => 'full',
'html' => false,
)
) . '" alt="Profile picture of ' . stripslashes( $group->name ) . '"/></a></div></div>';
) . '" alt="Profile picture of ' . esc_attr( stripslashes( $group->name ) ) . '"/></a></div></div>';

// name link
$title .= '<div class="col-sm-18"><p class="item-title"><a class="bold" href="' . bp_get_group_permalink( $group ) . '">' . stripslashes( $group->name ) . '</a></p>';
$title .= '<div class="col-sm-18"><p class="item-title"><a class="bold" href="' . esc_url( bp_get_group_url( $group ) ) . '">' . esc_html( stripslashes( $group->name ) ) . '</a></p>';

// accept/reject buttons
$title .= '<p class="actions clearfix"><a class="btn btn-primary link-btn accept" href="' . bp_get_group_accept_invite_link( $group ) . '">' . __( 'Accept', 'commons-in-a-box' ) . '</a> &nbsp; <a class="btn btn-default link-btn reject" href="' . bp_get_group_reject_invite_link( $group ) . '">' . __( 'Reject', 'commons-in-a-box' ) . '</a></p></div></div>';
Expand Down
2 changes: 1 addition & 1 deletion includes/portfolios.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function openlab_user_portfolio_profile_url( $user_id = 0 ) {
function openlab_get_user_portfolio_profile_url( $user_id = 0 ) {
$group_id = openlab_get_user_portfolio_id( $user_id );
$profile_obj = groups_get_group( array( 'group_id' => $group_id ) );
return bp_get_group_permalink( $profile_obj );
return bp_get_group_url( $profile_obj );
}

/**
Expand Down

0 comments on commit f0658d4

Please sign in to comment.