Last active
August 29, 2015 14:18
-
-
Save colorful-tones/e1f46d68d6a397d07a00 to your computer and use it in GitHub Desktop.
Gravity Forms overrides I typically need to use. I like to put this in _s /inc/, and don't forget to put this in your functions.php:
```require get_template_directory() . '/inc/gravity-forms.php';```
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Maintainn Gravity Forms Hooks & Filter overrides | |
* | |
*/ | |
/* | |
* Filter the Gravity Forms button type and add your own .class | |
*/ | |
function your_prefix_form_submit_button( $button, $form ) { | |
return '<button class="button button--blue" id="gform_submit_button_{$form['id']}"><span>Send Now</span></button>'; | |
} | |
add_filter( 'gform_submit_button', 'your_prefix_form_submit_button', 10, 2 ); | |
/** | |
* Changes the default Gravity Forms AJAX spinner. | |
* Grab a preloader: http://preloaders.net/ | |
* | |
* @param string $src The default spinner URL. | |
* @return string $src The new spinner URL. | |
*/ | |
function your_prefix_custom_gforms_spinner( $src ) { | |
return get_stylesheet_directory_uri() . '/images/form-loader.gif'; | |
} | |
add_filter( 'gform_ajax_spinner_url', 'your_prefix_custom_gforms_spinner' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment