Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Display Specific Profile with a Shortcode on a Page
/**
* 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 );
}
}
@kance

This comment has been minimized.

Copy link

@kance kance commented Oct 2, 2021

Hey @champsupertramp, thank you for the code!
Works like a champ!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment