I'm using Cimy User Extra Fields to add more registration fields. I'm also using Contact Form 7 Dynamic Text Extension to pre-populate contact form fields.
I've read, in order to be able to use Cimy fields to pre-populate the contact form i need to add a shortcode. I've read this here.
He say's that you have to add a shortcode which calls a function that is in Cimy User Extra Fields.
The function in Cimy is called get_cimyFieldValue().
Here is the code he is referring to from Dynamic Text Extension.
function cf7_get_current_user($atts){
extract(shortcode_atts(array(
'key' => 'user_login',
), $atts));
global $current_user;
get_currentuserinfo();
$val = $current_user->$key;
return $val;
}
add_shortcode('CF7_get_current_user', 'cf7_get_current_user');
How can i add a shortcode in my functions.php to call get_cimyFieldValue() so i can populate the contact form with fields from Cimy?
Thanks
EDIT:
From the answer below i've managed to get this to work however it only seems to work if i use a user id. I need it to work with the current user not a predefined user.