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
https://github.com/gravitywiz/snippet-library/blob/master/gp-limit-submissions/gpls-show-poll-results.php