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
Add user meta to a view
/** 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;
}
}
October 5, 2018 at 6:39 am
Hi there
Can you give example usage for this?
Discussion closed.