-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
49 lines (29 loc) · 1.25 KB
/
functions.php
File metadata and controls
49 lines (29 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* Function to output Bootstrap Form Modals with embedded Gravity Form
*
* Array contains key value pairs, key is the modal ID, value is the Name of the Gravity Form and the title
* which will appear in the modal. Sample:
* $modal_array = array( 'schedule_a_showing' => 'Schedule a Showing', 'ask_a_question' => 'Ask a Question' );
*/
function output_gravity_form_modal( $modal_array ) {
foreach ( $modal_array as $id => $name ) { ?>
<!-- Modal -->
<div class="modal modal-gravity-form fade" id="<?php echo $id; ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel"><?php echo $name; ?></h4>
</div>
<div class="modal-body">
<?php gravity_form( $name, false ); ?>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<?php }
}