bp_get_media_link()

Return the media link.

Description

Return

(string) The media link.

Source

File: bp-media/bp-media-template.php

1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
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

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.