Created
September 9, 2014 22:14
-
-
Save bryanmonzon/fb5953634700e9513925 to your computer and use it in GitHub Desktop.
Grab a list of Gravity Form IDs for use in post meta
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 | |
if( class_exists( 'RGFormsModel' ) ){ | |
$select = '<select name="s_camps_gforms_id">'; | |
$select .= '<option>--No Form</option>'; | |
$forms = RGFormsModel::get_forms( null, 'title' ); | |
foreach( $forms as $form ) { | |
$select .= '<option id="' . $form->id . '" value="'. $form->id.'" '. selected( $s_camps_gforms_id, $form->id, false).'>' . $form->title . '</option>'; | |
} | |
$select .= '</select>'; | |
?> | |
<p> | |
<strong>Select a donation form</strong> | |
<?php echo $select; ?><br> | |
<em class="hint">You must have Gravity Forms installed</em> | |
</p> | |
<?php | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment