Skip to content

Commit

Permalink
Some replacements 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 d2055fd commit a2ee2cf
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
19 changes: 11 additions & 8 deletions buddypress/groups/single/activity-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
$group_slug = bp_get_group_slug();
$group_type = cboxol_get_group_group_type( bp_get_current_group_id() );

$group = groups_get_current_group();
$group_url = bp_get_group_permalink( $group );
$group = groups_get_current_group();

if ( current_user_can( 'view_private_members_of_group', $group->id ) ) {
$group_private_members = [];
Expand All @@ -37,7 +36,7 @@
<div class="col-sm-12">
<div class="recent-discussions">
<div class="recent-posts">
<h2 class="title activity-title"><a class="no-deco" href="<?php echo esc_attr( $group_url ); ?>/forum/"><?php esc_html_e( 'Recent Discussions', 'commons-in-a-box' ); ?><span class="fa fa-chevron-circle-right" aria-hidden="true"></span></a></h2>
<h2 class="title activity-title"><a class="no-deco" href="<?php echo esc_attr( bp_get_group_url( $group, bp_groups_get_path_chunks( [ 'forum' ] ) ) ); ?>"><?php esc_html_e( 'Recent Discussions', 'commons-in-a-box' ); ?><span class="fa fa-chevron-circle-right" aria-hidden="true"></span></a></h2>
<?php
$forum_id = null;
$forum_ids = bbp_get_group_forum_ids( bp_get_current_group_id() );
Expand Down Expand Up @@ -109,7 +108,7 @@
<div class="col-sm-12">
<div id="recent-docs">
<div class="recent-posts">
<h2 class="title activity-title"><a class="no-deco" href="<?php echo esc_attr( $group_url ); ?><?php echo esc_attr( bp_docs_get_slug() ); ?>/"><?php esc_html_e( 'Recent Docs', 'commons-in-a-box' ); ?><span class="fa fa-chevron-circle-right" aria-hidden="true"></span></a></h2>
<h2 class="title activity-title"><a class="no-deco" href="<?php echo esc_url( bp_get_group_url( $group, bp_groups_get_path_chunks( [ bp_docs_get_slug() ] ) ) ); ?>"><?php esc_html_e( 'Recent Docs', 'commons-in-a-box' ); ?><span class="fa fa-chevron-circle-right" aria-hidden="true"></span></a></h2>
<?php

$docs_query = new BP_Docs_Query(
Expand Down Expand Up @@ -151,12 +150,16 @@
<div id="members-list" class="info-group">

<?php
$group_permalink = bp_get_group_permalink( $group );

if ( bp_is_item_admin() || bp_is_item_mod() ) {
$href = $group_permalink . '/admin/manage-members/';
$href = bp_get_group_url(
$group,
bp_groups_get_path_chunks( [ 'admin', 'manage-members' ] )
);
} else {
$href = $group_permalink . '/members/';
$href = bp_get_group_url(
$group,
bp_groups_get_path_chunks( [ 'members' ] )
);
}
?>

Expand Down
9 changes: 6 additions & 3 deletions buddypress/members/single/groups/invites.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,23 @@
'html' => false,
)
);

$group_permalink = bp_get_group_url( groups_get_current_group() );

?>

<div class="group-item col-xs-12">
<div class="group-item-wrapper">
<div class="row info-row">
<div class="item-avatar alignleft col-xs-7">
<a href="<?php bp_group_permalink(); ?>"><img class="img-responsive" src="<?php echo esc_attr( $group_avatar ); ?>" alt="<?php echo esc_html( bp_get_group_name() ); ?>"/></a>
<a href="<?php echo esc_url( $group_permalink ); ?>"><img class="img-responsive" src="<?php echo esc_attr( $group_avatar ); ?>" alt="<?php echo esc_html( bp_get_group_name() ); ?>"/></a>
</div>
<div class="item col-xs-17">
<p class="item-title h2"><a class="no-deco truncate-on-the-fly" href="<?php bp_group_permalink(); ?>" data-basevalue="65" data-minvalue="20" data-basewidth="280"><?php bp_group_name(); ?></a></p>
<p class="item-title h2"><a class="no-deco truncate-on-the-fly" href="<?php echo esc_url( $group_permalink ); ?>" data-basevalue="65" data-minvalue="20" data-basewidth="280"><?php bp_group_name(); ?></a></p>

<div class="description-line">
<?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<p class="truncate-on-the-fly" data-link="<?php echo bp_get_group_permalink(); ?>" data-basevalue="100" data-basewidth="280"><?php echo bp_get_group_description_excerpt(); ?></p>
<p class="truncate-on-the-fly" data-link="<?php echo esc_url( $group_permalink ); ?>" data-basevalue="100" data-basewidth="280"><?php echo bp_get_group_description_excerpt(); ?></p>
<?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<p class="original-copy hidden"><?php echo bp_get_group_description_excerpt(); ?></p>
</div>
Expand Down
7 changes: 6 additions & 1 deletion lib/plugin-mods/files-funcs.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,12 @@ function () {

bp_core_add_message( __( 'Folder successfully deleted.', 'commons-in-a-box' ) );

bp_core_redirect( trailingslashit( bp_get_group_permalink( groups_get_current_group() ) . BP_GROUP_DOCUMENTS_SLUG ) );
$redirect_url = bp_get_group_url(
groups_get_current_group(),
bp_groups_get_path_chunks( [ BP_GROUP_DOCUMENTS_SLUG ] )
);

bp_core_redirect( $redirect_url );
die;
}
);
Expand Down

0 comments on commit a2ee2cf

Please sign in to comment.