-
-
Save champsupertramp/20f738c6bc3f5017dc19fdb2ed950b95 to your computer and use it in GitHub Desktop.
/** | |
* Sample usage: [um_embed_profile user_id="123" form_id="3"] | |
*/ | |
add_shortcode("um_embed_profile","um_082321_embed_specific_profile"); | |
function um_082321_embed_specific_profile( $atts ){ | |
$atts = shortcode_atts( array( | |
'user_id' => get_current_user_id(), | |
'form_id' => 0, | |
), $atts ); | |
extract( $atts ); | |
UM()->user()->target_id = $user_id; | |
$value = "[ultimatemember form_id='{$form_id}']"; | |
if ( version_compare( get_bloginfo('version'),'5.4', '<' ) ) { | |
return do_shortcode( $value ); | |
} else { | |
return apply_shortcodes( $value ); | |
} | |
} |
hi i tried the code, but not working form me showing multiple profiles in profile tab.
here the code i added, i don't know its wrong or right? because i am new in this field. if my code is wrong please guide me the right code or just give me modified code with my user & profile id. many many thanks
/**
-
Sample usage: [um_embed_profile user_id="um_card-holder" form_id="1383"]
*/
add_shortcode("um_embed_profile","um_082321_embed_specific_profile");
function um_082321_embed_specific_profile( $atts ){$atts = shortcode_atts( array(
'user_id' => um_card-holder(),
'form_id' => 1383,
'user_id' => um_mumayizat-black(),
'form_id' => 12003,
), $atts );extract( $atts );
UM()->user()->target_id = $user_id;
$value = "[ultimatemember form_id='{$form_id}']";if ( version_compare( get_bloginfo('version'),'5.4', '<' ) ) {
return do_shortcode( $value );
} else {
return apply_shortcodes( $value );
}
}
and i putted both profile shortcode in profile tab.
Hey @champsupertramp, thank you for the code!
Works like a champ!!