The Community forums are being phased out in favor of a new Slack group.
Add your email address below to get an invitation to join the community slack group

Slack Signup
Newsletter Optin
Help Desk

Add user meta to a view

Labels

This Discussion is public

Notifications

/** Formidable hook - shortcode view user meta */
add_shortcode( 'view_meta', 'view_meta_shortcode' );

function view_meta_shortcode( $atts ) {

$atts = shortcode_atts(
array(
'user' => '',
'meta' => '',
), $atts, 'view_meta' );

$results = get_user_meta ($atts['user'],$atts['meta'], true);

return $results;
}

/** Formidable hook - shortcode conditionaly view user meta */
add_shortcode( 'if_view_meta', 'if_view_meta_shortcode');

function if_view_meta_shortcode( $atts, $content = '' ) {
$atts = shortcode_atts(
array(
'user' => '',
'meta' => '',
), $atts, 'if_view_meta' );

$results = get_user_meta ($atts['user'],$atts['meta'], true);

if ( $results ) {
return $content;
} else {
return;
}
}

Hi there

Can you give example usage for this?

Discussion closed.