-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpage-orientation.php
More file actions
139 lines (116 loc) · 3.93 KB
/
page-orientation.php
File metadata and controls
139 lines (116 loc) · 3.93 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?php
/**
* ACF needs this, form processing
*/
if ( function_exists('acf_form_head') ) { acf_form_head(); }
/**
* Test url to make sure the user is in the right place
*/
$orientation_step = get_query_var('add');
$orientation_post_id = get_query_var('orientation_post');
$orientation_post = get_post($orientation_post_id);
if ( ! $orientation_step ) $orientation_step = 1;
/** /
if ( ! $orientation_step || ! is_numeric($orientation_step) ) {
wp_safe_redirect( get_permalink() . '1/' );
}
if ( 1 < $orientation_step && (! $orientation_post || 'em_orientation' != get_post_type($orientation_post)) ) {
wp_safe_redirect( get_permalink() . '1/' );
}
if ( 1 < $orientation_step && (! $orientation_post || 'em_orientation' != get_post_type($orientation_post)) ) {
wp_safe_redirect( get_permalink() . '1/' );
}
/**/
get_header('orientation'); ?>
<div id="content">
<div class="wrap">
<?php #do_action( 'before_content' ); ?>
<div id="main" role="main">
<div id="content" class="content clearfix" role="main">
<div class="entry-content inner">
<?php
while ( have_posts() ) : the_post();
?>
<h1><?php the_title(); ?></h1>
<?php if ( 5 != $orientation_step ) : ?>
<form action="<?php the_permalink(); ?>" id="post" class="acf-form form-archive form-orientation form-<?php echo $post_type; ?>" method="post">
<?php
endif;
/**
* Show a form
*/
if ( function_exists('acf_form') ) :
if ( 1 == $orientation_step ) :
$id = /* ( is_local() ) ? 1035 : */ 'acf_orientation-background';
acf_form( array(
'field_groups' => array($id),
'form' => false,
'post_id' => 'new_post',
'submit_value' => 'Submit',
) );
?>
<input type="hidden" name="post_status" value="publish" />
<input type="hidden" name="post_type" value="em_orientation" />
<?php
elseif ( 2 == $orientation_step ) :
$id = /* ( is_local() ) ? 1048 : */ 'acf_orientation-photo';
acf_form( array(
'field_groups' => array($id),
'form' => false,
'post_id' => $orientation_post->ID,
'submit_value' => 'Submit',
) );
elseif ( 3 == $orientation_step ) :
$id = /* ( is_local() ) ? 1032 : */ 'acf_orientation-policies';
acf_form( array(
'field_groups' => array($id),
'form' => false,
'post_id' => $orientation_post->ID,
'submit_value' => 'Submit',
) );
elseif ( 4 == $orientation_step ) :
$id = /* ( is_local() ) ? 1055 : */ 'acf_orientation-certification';
acf_form( array(
'field_groups' => array($id),
'form' => false,
'post_id' => $orientation_post->ID,
'submit_value' => 'Submit',
) );
elseif ( 5 == $orientation_step ) :
?>
<h3>Orientation Complete</h3>
<p>Next step instructions.</p>
<p><a class="btn btn-warning" href="/orientation/1/" title="Restart Orientation">Restart Orientation</a></p>
<?php
endif;
/**/
/** /
$id = ( false != strpos(get_option('siteurl'), 'dev') ) ? 1032 : 3896;
acf_form( array(
'field_groups' => array($id,'acf_issue-signature'),
'form' => false,
'post_id' => 'new_post',
'submit_value' => 'Submit',
) );
/**/
endif;
if ( 5 != $orientation_step ) :
?>
<input type="hidden" name="post_status" value="publish" />
<input type="hidden" name="post_type" value="em_orientation" />
<div class="field field-submit clearfix">
<button class="btn btn-primary btn-lg">Submit</button>
</div>
</form>
<?php
endif;
endwhile;
?>
</div><!-- .inner (end) -->
</div><!-- #content (end) -->
</div>
<?php #get_sidebar(); ?>
<?php #do_action( 'after_content' ); ?>
</div>
</div>
<?php get_footer();