Home›Support›English Support›[Escalated to 2nd Tier] GravityForms lose styling when the GravityForms MultiLingual plugin is active
[Escalated to 2nd Tier] GravityForms lose styling when the GravityForms MultiLingual plugin is active
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Elementor users - please update WPML to the latest version to maintain compatibility. More details here - https://wpml.org/changelog/2024/12/wpml-4-6-15-critical-update-for-elementor-sites/
Background of the issue:
I am trying to fix an issue with the GravityForms styling when the GravityForms MultiLingual plugin is active. In the file gravityforms-multilingual/inc/gravity-forms-multilingual.class.php, there is a filter being added: add_filter( 'gform_pre_render', [ $this, 'gform_pre_render' ] );. The gform_pre_render makes a single call to return $this->translate( $form );. However, something in that function breaks the wrapper of the GravityForm. It removes the data-form-index="0" attribute somehow, causing the inline CSS to be disregarded. Commenting out that filter brings back the data-index attribute, and thus fixes the styling. Link to a page where the issue can be seen: hidden link
Symptoms:
The GravityForms lose styling when the GravityForms MultiLingual plugin is active. The data-form-index="0" attribute is removed, causing the inline CSS to be disregarded.
Questions:
Why does the gform_pre_render function remove the data-form-index attribute?
How can I fix the styling issue without commenting out the filter?
Thanks for the reply! I recreated the issue in the sandbox. If you visit the sample page at hidden link, the form wrapper is also missing the data-form-index="0" attribute and thus my styling is lost. If I deactivate the GravityFroms Multilingual plugin, the attribute (and the styling) is back -- in this case, styling refers simply to the background color of the submit button.