Last active
November 26, 2020 19:58
-
-
Save spivurno/a1765492ab01a5e2f69fded263bf9e0a to your computer and use it in GitHub Desktop.
Gravity Perks // GP Limit Submissions // Display Poll Results When Limit Is Reached
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 | |
/** | |
* 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 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👉 This Gist has been migrated to the Gravity Wiz Snippet Library:
https://github.com/gravitywiz/snippet-library/blob/master/gp-limit-submissions/gpls-show-poll-results.php