/** 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;
}
}