Skip to content

Instantly share code, notes, and snippets.

@zackkatz
Created February 14, 2017 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zackkatz/d361149f4961c7d0c67a50d6e959357d to your computer and use it in GitHub Desktop.
Save zackkatz/d361149f4961c7d0c67a50d6e959357d to your computer and use it in GitHub Desktop.
GravityView - Remove the hooks added by GW_Submission_Limit
<?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