Hello, I try with this code but doesnt works :
<?php }
if( $profil_statut == "Professionnel"){
um_user( 'display_username' );
} else {
um_user( 'display_name' );
} ?>
@benenoo
Your code snippet should look like this if I understand your issue right:
add_action( 'um_after_profile_name_inline', 'um_after_profile_name_inline_custom', 10, 1 );
function um_after_profile_name_inline_custom( $args ) {
if( !empty( um_user( 'profil_status' ) && um_user( 'profil_status' ) == "Professionnel" )) {
$html = ob_get_contents();
ob_end_clean();
$html = str_replace( um_user( 'display_name' ), um_user( 'business_name' ), $html );
ob_start();
echo $html;
}
}
Add code snippet to your active theme’s functions.php file
or use the “Code Snippets” plugin.
-
This reply was modified 3 years, 7 months ago by
missveronica.
-
This reply was modified 3 years, 7 months ago by
missveronica.
Thanks very much 🙂
works well
Michel
One thing again, if I want this code for the free plugin online user, what is the code ?and where add it ?
Thanks again 🙂
I try with this code, but this code display the field from profil_statut and not the display_nane or business_name
$name = um_user( 'profil_statut' );
if( !empty( um_user( 'profil_statut' ) && um_user( 'profil_statut' ) == "Professionnel" )) {
$html = ob_get_contents();
ob_end_clean();
$html = str_replace( um_user( 'display_name' ), um_user( 'business_name' ), $html );
ob_start();
echo $html;
Thanks for this code
add_action( 'um_after_profile_name_inline', 'um_after_profile_name_inline_custom', 10, 1 );
function um_after_profile_name_inline_custom( $args ) {
if( !empty( um_user( 'profil_status' ) && um_user( 'profil_status' ) == "Professionnel" )) {
$html = ob_get_contents();
ob_end_clean();
$html = str_replace( um_user( 'display_name' ), um_user( 'business_name' ), $html );
ob_start();
echo $html;
}
}
works well, what need to change for the profile search member list and online user
Thanks very much
-
This reply was modified 3 years, 7 months ago by
benenoo.