diff --git src/bp-groups/bp-groups-template.php src/bp-groups/bp-groups-template.php
index 15eb8ca..bb33cf3 100644
|
|
|
function bp_group_last_active( $group = false, $args = array() ) { |
| 962 | 962 | * |
| 963 | 963 | * @since 1.0.0 |
| 964 | 964 | * |
| 965 | | * @param BP_Groups_Group|null $group Optional. Group object. Default: current group in loop. |
| | 965 | * @param BP_Groups_Group|null $group Optional. Group object. |
| | 966 | * Default: current group in loop. |
| | 967 | * @param bool $html_link Optional. Whether to generate an html |
| | 968 | * link or just return the URL. |
| | 969 | * Default: false. |
| 966 | 970 | */ |
| 967 | | function bp_group_permalink( $group = null ) { |
| 968 | | echo bp_get_group_permalink( $group ); |
| | 971 | function bp_group_permalink( $group = null, $html_link = false ) { |
| | 972 | echo bp_get_group_permalink( $group, $html_link ); |
| 969 | 973 | } |
| 970 | 974 | /** |
| 971 | 975 | * Return the permalink for the current group in the loop. |
| 972 | 976 | * |
| 973 | 977 | * @since 1.0.0 |
| 974 | 978 | * |
| 975 | | * @param BP_Groups_Group|null $group Optional. Group object. Default: current group in loop. |
| | 979 | * @param BP_Groups_Group|null $group Optional. Group object. |
| | 980 | * Default: current group in loop. |
| | 981 | * @param bool $html_link Optional. Whether to generate an |
| | 982 | * html link or just return the URL. |
| | 983 | * Default: false. |
| 976 | 984 | * @return string |
| 977 | 985 | */ |
| 978 | | function bp_get_group_permalink( $group = null ) { |
| | 986 | function bp_get_group_permalink( $group = null, $html_link = false ) { |
| 979 | 987 | global $groups_template; |
| 980 | 988 | |
| 981 | 989 | if ( empty( $group ) ) { |
| … |
… |
function bp_group_permalink( $group = null ) { |
| 991 | 999 | * @param string $value Permalink for the current group in the loop. |
| 992 | 1000 | * @param object $group Group object. |
| 993 | 1001 | */ |
| 994 | | return apply_filters( 'bp_get_group_permalink', trailingslashit( bp_get_groups_directory_permalink() . bp_get_group_slug( $group ) . '/' ), $group ); |
| | 1002 | $permalink = apply_filters( 'bp_get_group_permalink', trailingslashit( bp_get_groups_directory_permalink() . bp_get_group_slug( $group ) . '/' ), $group ); |
| | 1003 | |
| | 1004 | if ( $html_link ) { |
| | 1005 | $permalink = sprintf( |
| | 1006 | '<a href="%s">%s</a>', |
| | 1007 | esc_url( bp_get_group_permalink( $group ) ), |
| | 1008 | esc_html( bp_get_group_name( $group ) ) |
| | 1009 | ); |
| | 1010 | |
| | 1011 | /** |
| | 1012 | * Filters the html version of the permalink for the current group in the loop. |
| | 1013 | * |
| | 1014 | * @since 2.9.0 |
| | 1015 | * |
| | 1016 | * @param string $value HTML permalink for the current group in the loop. |
| | 1017 | * @param object $group Group object. |
| | 1018 | */ |
| | 1019 | $permalink = apply_filters( 'bp_get_group_permalink_html', $permalink, $group ); |
| | 1020 | } |
| | 1021 | |
| | 1022 | return $permalink; |
| 995 | 1023 | } |
| 996 | 1024 | |
| 997 | 1025 | /** |