Created
February 14, 2017 17:55
-
-
Save zackkatz/d361149f4961c7d0c67a50d6e959357d to your computer and use it in GitHub Desktop.
GravityView - Remove the hooks added by GW_Submission_Limit
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 | |
add_action( 'gravityview/edit-entry/render/before', 'gravityview_remove_gw_submission_limit' ); | |
/** | |
* Remove the hooks added by GW_Submission_Limit | |
* | |
* @see https://gravitywiz.com/better-limit-submission-per-time-period-by-user-or-ip/ | |
* | |
* @return void | |
*/ | |
function gravityview_remove_gw_submission_limit() { | |
if( ! class_exists( 'GW_Submission_Limit' ) ) { | |
return; | |
} | |
$GW_Submission_Limit = new GW_Submission_Limit; | |
remove_filter( 'gform_pre_render', array( $GW_Submission_Limit, 'pre_render' ) ); | |
remove_filter( 'gform_validation', array( $GW_Submission_Limit, 'validate' ) ); | |
remove_action( 'gform_after_submission', array( $GW_Submission_Limit, 'maybe_send_limit_reached_notifications' ), 10, 2 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment