Last active
June 24, 2022 09:59
-
-
Save KyleIrving/2cfc9cbbac04a366dded to your computer and use it in GitHub Desktop.
To use the button backend text, you should do something like that :
add_filter( 'gform_submit_button', 'form_submit_button', 10, 2 ); function form_submit_button( $button, $form ) { return "<button class='button gform_button' id='gform_submit_button_{$form['id']}'><span class="icon icon-arrow" aria-hidden="true"></span>{$form['button']['text']}</button>"; }
And of course aria-hidden="true"
for a right accessibility as you put an icon in your button.
The important for the text is {$form['button']['text']}
{$form['button']['text']}
not works for me, I have to use {$form['buttonText']}
instead. (GF v2.6.3)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is an awesome, straightforward example and worked perfectly! Thanks for sharing!!