BP_Email_Tokens::token__poster_url( BP_Email $bp_email, array $formatted_tokens, array $tokens )

Generate the output for token poster.url

Description

Parameters

$bp_email

(Required)

$formatted_tokens

(Required)

$tokens

(Required)

Return

(string) html for the output

Source

File: bp-core/classes/class-bp-email-tokens.php

1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
public function token__poster_url( $bp_email, $formatted_tokens, $tokens ) {
    $activity = isset( $tokens['activity'] ) ? $tokens['activity'] : false;
 
    if ( empty( $activity ) ) {
        $user_id = isset( $tokens['commenter.id'] ) ? $tokens['commenter.id'] : false;
    } else {
        $user_id = $activity->user_id;
    }
 
    if ( empty( $user_id ) ) {
        return "";
    }
 
    return bp_core_get_user_domain( $user_id );
}

Changelog

Changelog
Version Description
BuddyBoss 1.0.0 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.