1125 | | |
| 1125 | /** |
| 1126 | * Retrieve full permalink for currently displayed buddypress page. |
| 1127 | * |
| 1128 | * Todo: if we are on a subpage (eg. /profile) we need to get the rest of slug. |
| 1129 | * @since Trunk 1.6 |
| 1130 | * |
| 1131 | * @return $permalink Current page url |
| 1132 | */ |
| 1133 | function bp_get_permalink() { |
| 1134 | if ( !bp_is_blog_page() && bp_displayed_user_id() && !is_404() ) { |
| 1135 | $permalink = bp_displayed_user_domain(); |
| 1136 | } |
| 1137 | |
| 1138 | if ( !bp_is_blog_page() && bp_is_groups_component() && bp_is_single_item() ) { |
| 1139 | $permalink = trailingslashit( get_site_url() ) . trailingslashit( bp_get_groups_slug() ) . trailingslashit( bp_get_current_group_slug() ); |
| 1140 | } |
| 1141 | |
| 1142 | if ( bp_is_blog_page() ) { //This must be a WordPress page. Let them handle it. |
| 1143 | $permalink = get_permalink(); |
| 1144 | } |
| 1145 | return apply_filters('bp_get_permalink', $permalink); |
| 1146 | } |