Skip to content

Commit

Permalink
More use of bp_get_group_url().
Browse files Browse the repository at this point in the history
  • Loading branch information
boonebgorges committed Nov 15, 2024
1 parent 176031c commit 65ca4df
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion bbpress/content-single-topic.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<?php endif; ?>

<div class="bbp-back-to-course-discussion">
<p><a class="btn btn-primary link-btn" href="<?php bp_group_permalink(); ?>forum/"><span class="fa fa-chevron-circle-left"></span> <?php esc_html_e( 'Forum', 'commons-in-a-box' ); ?></a></p>
<p><a class="btn btn-primary link-btn" href="<?php echo esc_url( bp_get_group_url( groups_get_current_group(), bp_groups_get_path_chunks( [ 'forum' ] ) ) ); ?>"><span class="fa fa-chevron-circle-left"></span> <?php esc_html_e( 'Forum', 'commons-in-a-box' ); ?></a></p>
</div>

<?php bbp_get_template_part( 'form', 'reply' ); ?>
Expand Down
6 changes: 3 additions & 3 deletions buddypress/groups/groups-loop.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function ( $type ) {
esc_html__( 'Displaying clones of %1$s by %2$s.', 'commons-in-a-box' ),
sprintf(
'<a href="%s">%s</a>',
esc_attr( bp_get_group_permalink( $descendant_of_group ) ),
esc_attr( bp_get_group_url( $descendant_of_group ) ),
esc_html( $descendant_of_group->name )
),
implode( ', ', $descendant_of_admin_links )
Expand Down Expand Up @@ -217,7 +217,7 @@ function ( $type ) {
<div class="group-type-flag"><?php echo esc_html( $group_type->get_label( 'singular' ) ); ?></div>
<?php endif; ?>

<a href="<?php bp_group_permalink(); ?>"><img class="img-responsive" src="<?php echo esc_attr( $group_avatar ); ?>" alt="<?php echo esc_attr( bp_get_group_name() ); ?>"/></a>
<a href="<?php echo esc_url( bp_get_group_url( groups_get_current_group() ) ); ?>"><img class="img-responsive" src="<?php echo esc_attr( $group_avatar ); ?>" alt="<?php echo esc_attr( bp_get_group_name() ); ?>"/></a>

<?php if ( $group_site_url && cboxol_site_can_be_viewed( $group_id ) ) : ?>
<a class="group-site-link" href="<?php echo esc_url( $group_site_url ); ?>"><?php esc_html_e( 'Visit Site', 'commons-in-a-box' ); ?><span class="fa fa-chevron-circle-right" aria-hidden="true"></span></a>
Expand All @@ -227,7 +227,7 @@ function ( $type ) {
<div class="item col-xs-18">
<div class="item-content-wrapper">
<p class="item-title h2">
<a class="no-deco he-fly hyphenate truncate-on-the-fly" href="<?php bp_group_permalink(); ?>" data-basevalue="50" data-minvalue="20" data-basewidth="290"><?php bp_group_name(); ?></a>
<a class="no-deco he-fly hyphenate truncate-on-the-fly" href="<?php echo esc_url( bp_get_group_url( groups_get_current_group() ) ); ?>" data-basevalue="50" data-minvalue="20" data-basewidth="290"><?php bp_group_name(); ?></a>
<span class="original-copy hidden"><?php bp_group_name(); ?></span>
</p>

Expand Down
11 changes: 9 additions & 2 deletions buddypress/groups/single/invite-anyone.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,17 @@

<?php do_action( 'bp_before_group_send_invites_content' ); ?>

<?php $group_type = cboxol_get_group_group_type( bp_get_current_group_id() ); ?>
<?php
$group_type = cboxol_get_group_group_type( bp_get_current_group_id() );

$form_action = bp_get_group_url(
groups_get_current_group(),
bp_groups_get_path_chunks( [ 'invite-anyone', 'send' ] )
);
?>

<?php if ( ! bp_get_new_group_id() ) : ?>
<form action="<?php bp_group_permalink( groups_get_current_group() ); ?>/invite-anyone/send/" method="post" class="form-panel" id="send-invite-form">
<form action="<?php echo esc_url( $form_action ); ?>" method="post" class="form-panel" id="send-invite-form">
<?php endif; ?>

<div id="topgroupinvite" class="panel panel-default">
Expand Down
6 changes: 2 additions & 4 deletions buddypress/groups/single/nav/docs.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@

$group = groups_get_current_group();

$group_permalink = bp_get_group_permalink( $group );

?>

<li <?php echo ( 'list' === bp_docs_current_view() ? 'class="current-menu-item"' : '' ); ?> ><a href="<?php echo esc_url( $group_permalink . bp_docs_get_docs_slug() ); ?>/"><?php esc_html_e( 'View Docs', 'commons-in-a-box' ); ?></a></li>
<li <?php echo ( 'list' === bp_docs_current_view() ? 'class="current-menu-item"' : '' ); ?> ><a href="<?php echo esc_url( bp_docs_get_group_docs_url( $group ) ); ?>"><?php esc_html_e( 'View Docs', 'commons-in-a-box' ); ?></a></li>
<?php if ( current_user_can( 'bp_docs_create' ) && current_user_can( 'bp_docs_associate_with_group', bp_get_current_group_id() ) ) : ?>
<li <?php echo ( 'create' === bp_docs_current_view() ? 'class="current-menu-item"' : '' ); ?> ><a href="<?php echo esc_url( $group_permalink . bp_docs_get_docs_slug() ); ?>/create/"><?php esc_html_e( 'New Doc', 'commons-in-a-box' ); ?></a></li>
<li <?php echo ( 'create' === bp_docs_current_view() ? 'class="current-menu-item"' : '' ); ?> ><a href="<?php echo esc_url( bp_docs_get_group_docs_url( $group ) ); ?>create/"><?php esc_html_e( 'New Doc', 'commons-in-a-box' ); ?></a></li>
<?php endif; ?>
<?php if ( ( 'edit' === bp_docs_current_view() || 'single' === bp_docs_current_view() ) && bp_docs_is_existing_doc() ) : ?>
<?php $doc_obj = bp_docs_get_current_doc(); ?>
Expand Down

0 comments on commit 65ca4df

Please sign in to comment.