bp_get_media_link()
Return the media link.
Description
Return
(string) The media link.
Source
File: bp-media/bp-media-template.php
function bp_get_media_link() {
global $media_template;
if ( ! empty( $media_template->media->group_id ) ) {
$group = buddypress()->groups->current_group;
if ( ! isset( $group->id ) || $group->id !== $media_template->media->group_id ) {
$group = groups_get_group( $media_template->media->group_id );
}
$group_link = bp_get_group_permalink( $group );
$url = trailingslashit( $group_link . bp_get_media_slug() );
} else {
$url = trailingslashit( bp_core_get_user_domain( bp_get_media_user_id() ) . bp_get_media_slug() );
}
/**
* Filters the media link being displayed.
*
* @since BuddyBoss 1.5.3
*
* @param int $id The media link.
*/
return apply_filters( 'bp_get_media_link', $url );
}
Changelog
| Version | Description |
|---|---|
| BuddyBoss 1.5.3 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.