Link on email validator
-
Giving a form field a ‘URLValidator’ puts the field a link on the page, however ‘EmailValidator’ doesn’t do that.
I tried adding this to \api\api.php but didn’t work. Can anyone suggest anything for this?
Here’s what I did code block starting line 187
case 'meta': default: $value = wpbdp_get_listing_field_value($listing, $field); if ($value) { if (in_array($field->type, array('multiselect', 'checkbox'))) { return esc_attr(str_replace("\t", ', ', $value)); } elseif ($field->type == 'textarea') { return wpautop(wp_kses($value, array()), true); } elseif ($field->type == 'social-twitter') { return _wpbdp_display_twitter_button($value, array('lang' => substr(get_bloginfo('language'), 0, 2)) ); } elseif ($field->type == 'social-linkedin') { return _wpbdp_display_linkedin_button($value); } elseif ($field->type == 'social-facebook') { return _wpbdp_display_facebook_button($value); } elseif ($field->type == 'EmailValidator') { return "<a href=mailto:".$value.">".$value."</a>"; } else { if ($field->validator == 'URLValidator') { if (is_array($value)) { $value_url = $value[0]; $value_text = !empty($value[1]) ? $value[1] : $value[0]; } else { $value_url = $value; $value_text = $value; } if (!$value_url) return ''; return sprintf('<a href="%s" target="%s" title="%s">%s</a>', esc_url($value_url), isset($field->field_data['open_in_new_window']) && $field->field_data['open_in_new_window'] ? '_blank' : '_self', esc_attr($value_text), esc_attr($value_text)); } return wp_kses($value, array()); } }
My new part is the if EmailValidator part. Thanks
https://www.ads-software.com/extend/plugins/business-directory-plugin/
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘Link on email validator’ is closed to new replies.