-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathform.php
124 lines (91 loc) · 4.87 KB
/
form.php
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
<?php
/**
* Create/Edit Form.
*/
?>
<?php if ( $this->current_user_can_post ) : ?>
<div class="bp-simple-post-form">
<form class="standard-form bp-simple-post-form" method="post" action="" enctype="multipart/form-data" id="<?php echo $this->get_id(); ?>">
<!-- do not modify/remove the line blow -->
<input type="hidden" name="bp_simple_post_form_id" value="<?php echo $this->id; ?>"/>
<input type="hidden" name="action" value="bp_simple_post_new_post_<?php echo $this->id; ?>"/>
<?php wp_nonce_field( 'bp_simple_post_new_post_' . $this->id ); ?>
<?php wp_nonce_field( 'update-post_' . $post_id, '_bsfep_media_uploader_nonce' ); ?>
<?php if ( $post_id ) : ?>
<input type="hidden" name="post_id" value="<?php echo $post_id; ?>" id="post_ID"/>
<?php endif; ?>
<?php do_action( 'bsfep_before_title', $this->id, $post_id ); ?>
<!-- you can modify these, just make sure to not change the name of the fields -->
<label for="bp_simple_post_title"><?php _e( 'Title:', 'bp-simple-front-end-post' ); ?>
<input type="text" name="bp_simple_post_title" value="<?php echo $title; ?>"/>
</label>
<?php do_action( 'bsfep_before_content', $this->id, $post_id ); ?>
<label for="bp_simple_post_text"><?php _e( 'Post:', 'bp-simple-front-end-post' ); ?>
<?php wp_editor( $content, 'bp_simple_post_text', array(
'media_buttons' => $this->allow_upload,
'quicktags' => false,
) ); ?>
</label>
<?php if ( $this->enable_visibility && 'publish' == $this->post_status) : ?>
<div class="bp_simple_post_visibility-wrapper">
<label><?php _e( 'Visibility:', 'bp-simple-front-end-post' ); ?></label>
<label for="bp_simple_post_visibility_public">
<input type="radio" name="bp_simple_post_visibility" id="bp_simple_post_visibility_public"
value="public"> <?php _e( 'Public', 'bp-simple-front-end-post' ); ?>
</label>
<label for="bp_simple_post_visibility_private">
<input type="radio" name="bp_simple_post_visibility" id="bp_simple_post_visibility_private"
value="private"> <?php _e( 'Private', 'bp-simple-front-end-post' ); ?>
</label>
</div>
<?php endif; ?>
<?php do_action( 'bsfep_before_thumbnail', $this->id, $post_id ); ?>
<?php if ( $this->has_post_thumbnail ) : ?>
<div id="postimagediv">
<div class="inside">
<?php $thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true );
echo _wp_post_thumbnail_html( $thumbnail_id, $post->ID );
?>
</div>
</div>
<?php endif; ?>
<?php do_action( 'bsfep_before_taxonomy_terms', $this->id, $post_id ); ?>
<!-- taxonomy terms box -->
<?php if ( $this->has_tax() ) : ?>
<div class='simple-post-taxonomies-box clearfix'>
<?php $this->render_taxonomies(); ?>
<div class="clear"></div>
</div>
<?php endif; ?>
<?php do_action( 'bsfep_before_custom_fields', $this->id, $post_id ); ?>
<!-- custom fields -->
<?php if ( $this->has_custom_fields() ) : ?>
<div class='simple-post-custom-fields'>
<?php if ( $this->has_visible_meta() && $this->custom_field_title ) : ?>
<h3> <?php echo $this->custom_field_title; ?> </h3>
<?php endif; ?>
<?php $this->render_custom_fields(); ?>
</div>
<?php endif; ?>
<?php do_action( 'bsfep_before_comment_options', $this->id, $post_id ); ?>
<?php if ( $this->show_comment_option ) : ?>
<div class="simple-post-comment-option">
<h4><?php _e( 'Allow Comments', 'bp-simple-front-end-post' ); ?></h4>
<?php $current_status = $this->comment_status;
if ( $post_id ) {
$post = get_post( $post_id );
$current_status = $post->comment_status;
}
?>
<label for="bp-simple-post-comment-status">
<input id="bp-simple-post-comment-status" name="bp_simple_post_comment_status" type="checkbox"
value="open" <?php echo checked( 'open', $current_status ); ?> /> <?php _e( 'Yes', 'bp-simple-front-end-post' ); ?>
</label>
</div>
<?php endif; ?>
<?php do_action( 'bsfep_before_submit', $this->id, $post_id ); ?>
<input type="hidden" value="<?php echo $_SERVER['REQUEST_URI']; ?>" name="post_form_url"/>
<input id="submit" name='bp_simple_post_form_subimitted' type="submit" value="<?php _e( 'Post', 'bp-simple-front-end-post' ); ?>"/>
</form>
</div>
<?php endif; ?>