Quote from
qualmy91 on February 9, 2021, 5:01 am
Hey @amandahaccpmentor-com,
by default, there are only the following replacements:
- ###USERNAME###
- ###AUTHOR###
- ###LINK###
- ###TITLE###
- ###CONTENT###
If you want to use the first name you can try the following code:
add_filter('asgarosforum_user_replacements', 10, 2);
function add_firstname($replacements, $user){
if($user){
$replacements['###FIRSTNAME###'] = $user->user_firstname;
} else {
// Please Change 'User' to a default value for the case that there is no user found by this email
$replacements['###FIRSTNAME###'] = 'User';
}
return $replacements;
}
After adding this code, you can use ###FIRSTNAME### in the template settings.
Hey @amandahaccpmentor-com,
by default, there are only the following replacements:
- ###USERNAME###
- ###AUTHOR###
- ###LINK###
- ###TITLE###
- ###CONTENT###
If you want to use the first name you can try the following code:
add_filter('asgarosforum_user_replacements', 10, 2);
function add_firstname($replacements, $user){
if($user){
$replacements['###FIRSTNAME###'] = $user->user_firstname;
} else {
// Please Change 'User' to a default value for the case that there is no user found by this email
$replacements['###FIRSTNAME###'] = 'User';
}
return $replacements;
}
After adding this code, you can use ###FIRSTNAME### in the template settings.
Asgaros has reacted to this post.