Skip to content

Instantly share code, notes, and snippets.

@spivurno
Last active November 26, 2020 19:58
Show Gist options
  • Save spivurno/a1765492ab01a5e2f69fded263bf9e0a to your computer and use it in GitHub Desktop.
Save spivurno/a1765492ab01a5e2f69fded263bf9e0a to your computer and use it in GitHub Desktop.
Gravity Perks // GP Limit Submissions // Display Poll Results When Limit Is Reached
<?php
/**
* Gravity Perks // GP Limit Submissions // Display Poll Results When Limit Is Reached
* http://gravitywiz.com/documentaiton/gravity-forms-limit-submissions/
*/
add_action( 'gform_get_form_filter', function( $markup, $form ) {
if( ! is_callable( 'gf_polls' ) || ! gf_polls()->get_form_setting( $form, 'displayResults' ) ) {
return $markup;
}
if( is_callable( 'gp_limit_submissions' ) && property_exists( gp_limit_submissions(), 'enforce' ) && gp_limit_submissions()->enforce->is_limit_reached() ) {
$results = gf_polls()->gpoll_get_results( $form['id'] );
$markup .= $results['summary'];
}
return $markup;
}, 11, 2 );
@spivurno
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment