-
AuthorPosts
-
March 24, 2021 at 9:54 am #1290052
Hallo,
in my current project I am developing with enfold and polylang.
Is it possible to use a second “text” in another language in the build-in enfold DSGVO-form function (generating the checkbox)?Thank you in advance,
MarcApril 1, 2021 at 4:23 am #1291655Hey phil-0071,
Thank you for the inquiry.
You should be able to add something like this in the functions.php file to change the text of the checkbox for another language.
add_action('after_setup_theme', function() { remove_filter( 'avf_sc_contact_form_elements', array( 'av_privacy_class', 'av_privacy_contactform_checkbox'), 10, 2 ); add_filter( 'avf_sc_contact_form_elements', 'av_privacy_contactform_checkbox_mod', 10, 2 ); }, 10); function av_privacy_contactform_checkbox_mod($fields, $atts) { $content = avia_get_option('privacy_message_contact'); if(pll_current_language("locale") == "en_GB") { $content = "CUSTOM TEXT FOR ANOTHER LANGUAGE en_GB"; } if( empty( $content ) ) { $content = av_privacy_class::get_default_privacy_message(); } $fields['av_privacy_agreement'] = array( 'label' => $content, 'type' => 'checkbox', 'options' => '', 'check' => 'is_empty', 'width' => '', 'av_uid' => '', 'class' => 'av_form_privacy_check av_contact_privacy_check', ); return $fields ; }
This line of code adjusts the content when the active or current language has the locale en_GB.
if(pll_current_language("locale") == "en_GB") { $content = "CUSTOM TEXT FOR ANOTHER LANGUAGE"; }
Adjust it as necessary.
Best regards,
IsmaelApril 2, 2021 at 12:14 am #1291915Hey Ismael,
first at all thank you very very much for your deep wp-work!
I tried the snippet and got the problem that there are no input fields, also there seems to be no different checkbox text, its still the german version.
Also both languages (de_DE, en_GB) seem to be identical.
Maybe you could be so kind and take another look?
I copied you the part of the source which contained the form part, the output for both languages is the same.Easter regards,
Phil<form action=”http://conwol.mto2.de/en/contact/” method=”post” class=”avia_ajax_form av-form-labels-visible avia-builder-el-11 el_after_av_hr el_before_av_hr av-custom-form-color av-dark-form ” data-avia-form-id=”1″ data-avia-redirect=” ><fieldset><p class=’av_form_privacy_check av_contact_privacy_check first_form form_element form_fullwidth’ id=’element_avia_1_1′> <input name=”avia_1_1″ class=”input_checkbox is_empty” type=”checkbox” id=”avia_1_1″ value=”true”/><label class=”input_checkbox_label” for=”avia_1_1″>Die Checkbox für die Zustimmung zur Speicherung ist nach DSGVO zwingend. Dieses Formular speichert Ihren Namen, Ihre E-Mail-Adresse sowie den Nachrichtentext, damit wir Ihre Nachricht auswerten können. Weitere Informationen finden Sie auf unserer Seite der Datenschutzbestimmungen. <abbr class=”required” title=”required”>*</abbr></label></p><p class=”form_element “><input type=”hidden” value=”1″ name=”avia_generated_form1″ /><input type=”submit” value=”Send” class=”button” data-sending-label=”Sending”/></p></fieldset></form><div id=”ajaxresponse_1″ class=”ajaxresponse ajaxresponse_1 hidden”></div>
<div style=’height:20px’ class=’hr hr-invisible avia-builder-el-12 el_after_av_contact el_before_av_textblock ‘><span class=’hr-inner ‘ ><span class=’hr-inner-style’></span></span></div>April 5, 2021 at 11:12 am #1292446Hi,
Sorry for the delay. I forgot to include the $fields and $atts parameters in the new function. Please try the updated code above.
If it does not work, please post the FTP and WP details in the private field so that we could test the modification.
Best regards,
Ismael1April 6, 2021 at 10:23 am #1292721This reply has been marked as private.April 8, 2021 at 6:02 am #1293170Hi,
Thank you for the info.
The FTP above is working, but we cannot access the site or the WP dasbboard to test the changes because it is asking for another authentication. Did you enable the htpassword or something similar?
Best regards,
IsmaelApril 8, 2021 at 12:53 pm #1293248This reply has been marked as private.April 12, 2021 at 4:29 am #1293827Hi,
No worries. The changes seems to be showing properly on our end, as shown in the screenshot below.
Please make sure to purge the cache or do a hard refresh of the browser before checking the page.
Thank you for your patience.
Best regards,
IsmaelApril 12, 2021 at 8:11 am #1293868Hi Ismael,
thank you very very much, you made my day :-)
Very professional work and mega-best theme support!Have a nice week, best regards from Berlin,
PhilApril 13, 2021 at 5:17 pm #1294191Hi,
Glad Ismael could help! :)
For your information, you can take a look at Enfold documentation here – https://kriesi.at/documentation/enfold/
If you have any other questions or issues, feel free to start a new thread under Enfold sub forum and we will gladly try to help you :)
Enjoy the rest of your day!
Best regards,
Yigit -
AuthorPosts
- The topic ‘Multilanguage second DSGVO checkbox-text for contactform’ is closed to new replies.