str_replace depending on form ID ?
-
Hello there,
I have dropdown list with custom label achieving with that code:function custom_wpcf7_form_elements($html) { $text = 'My custom label...'; $html = str_replace('<option value="">---</option>', '<option value="" disabled selected>' . $text . '</option>', $html); return $html; } add_filter('wpcf7_form_elements', 'custom_wpcf7_form_elements');
Everything works nice, but what if i have 3 forms at site and want to put different labels on them depending on language for example ? I figured out that i could use form id somehow and then depending on that form id view different labels. The big problem is that i have no idea how to code this. Any help would be appreciated. Thanks.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘str_replace depending on form ID ?’ is closed to new replies.