If your are receiving the email on Outlook in Times New Roman, add the following code inside the head tag.
Hits: 53
If your are receiving the email on Outlook in Times New Roman, add the following code inside the head tag.
Hits: 53
---'
in all forms with the same text:For replacing all ‘—‘ blank value of select , add the below filter in function.php
1 2 3 4 5 6 |
function kd_wpcf7_form_elements($html) { $text = 'Select'; $html = str_replace('<option value="">---</option>', '<option value="">' . $text . '</option>', $html); return $html; } add_filter('wpcf7_form_elements', 'kd_wpcf7_form_elements'); |
We can replace the $text variable with any text.
2. Replace the select element blank value with unique text.
For replacing the select elements blank with unique text add the following filter in function.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
function kd_wpcf7_form_elements($html) { function kd_replace_include_blank($name, $text, &$html) { $matches = false; preg_match('/<select name="' . $name . '"[^>]*>(.*)<\/select>/iU', $html, $matches); if ($matches) { $select = str_replace('<option value="">---</option>', '<option value="">' . $text . '</option>', $matches[0]); $html = preg_replace('/<select name="' . $name . '"[^>]*>(.*)<\/select>/iU', $select, $html); } } kd_replace_include_blank('subject', 'Subject', $html); kd_replace_include_blank('country', 'Country', $html); return $html; } add_filter('wpcf7_form_elements', 'kd_wpcf7_form_elements'); |
Hits: 131