Hi
I like to have the link with the form popup done by a function call. When I checked the function geodir_cf_email the $cf parameter (array) can also be a string as it will look for an individual field at the beginning:
// check we have the post value
if(is_int($p)){$post = geodir_get_post_info($p);}
else{ global $post;}
if(!is_array($cf) && $cf!=''){
$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
if(!$cf){return NULL;}
}
$html_var = $cf['htmlvar_name'];
the geodir_get_field_infoby is returning a StdClass so the $html_var = $cf[‘htmlvar_name’]; will not work.
An explicit cast is needed here:
$cf = (array) geodir_get_field_infoby(‘htmlvar_name’, $cf, $post->post_type);
With this change the function can also be called with just a string like ‘geodir_email’ and it will give you the html code for this link.
Could you please consider to change this in the repo?
Or do I miss something more elegant to get to my goal?
Thanks,
Dirk