@palopoliart7
I can’t reproduce your issue with line breaks.
“Enable HTML support for user description” at UM Settings -> Appearance -> Profile will enable/disable line breaks very well in the description field.
You have an “Elementor-Pro” JavaScript error on your pages.
Try to do Theme/Plugin conflict test to find out if it’s your Theme or another Plugin which is removing your line breaks.
https://docs.ultimatemember.com/article/96-how-to-do-a-plugin-theme-conflict-test
-
This reply was modified 2 years, 11 months ago by
missveronica.
Thank you! It actually works with the UM in-built option to show Description in Header.
But when I want to display it anywhere else using the custom shortcode, it won't respect the HTML layout.
Here is the shortcode :
// CREATE SHORTCODE TO DISPLAY USER META FROM UM PLUGIN (including Profile Photo)
/**
* Returns a user meta value
* Usage [um_user user_id="" meta_key="" ] // leave user_id empty if you want to retrive the current user's meta value.
* meta_key is the field name that you've set in the UM form builder
* You can modify the return meta_value with filter hook 'um_user_shortcode_filter__{$meta_key}'
*/
add_action('template_redirect','sc_init_um_user_shortcode');
add_action('init','sc_init_um_user_shortcode');
function sc_init_um_user_shortcode(){
add_shortcode( 'um_user', 'sc_um_user_shortcode' );
}
add_filter("um_user_shortcode_filter__profile_photo","um_user_shortcode_filter__profile_photo", 10, 3);
function um_user_shortcode_filter__profile_photo( $meta_value, $raw_meta_value, $user_id ){
return UM()->uploader()->get_upload_user_base_url( $user_id )."/".$meta_value;
}
function sc_um_user_shortcode( $atts ) {
$atts = shortcode_atts( array(
'user_id' => um_profile_id(),
'meta_key' => ''
), $atts );
extract( $atts );
if ( empty( $meta_key ) ) return;
if( empty( $user_id ) ) $user_id = um_profile_id();
$raw_meta_value = get_user_meta( $user_id, $meta_key, true );
if( is_serialized( $raw_meta_value ) ){
$meta_value = unserialize( $raw_meta_value );
}else if( is_array( $raw_meta_value ) ){
if(wp_http_validate_url($raw_meta_value == FALSE)) {
$meta_value = implode(",",$raw_meta_value);
}else{
$meta_value = implode("",$raw_meta_value);
}
}else{
$meta_value = $raw_meta_value;
}
return apply_filters("um_user_shortcode_filter__{$meta_key}", $meta_value, $raw_meta_value, $user_id );
}
@palopoliart7
Use the UM Predefined textarea field “Biography” when you want to display the description meta_value somewhere else on the Profile page.
Hi @palopoliart7
This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.
Please feel free to re-open this thread if any other questions come up and we’d be happy to help. 🙂
Regards