PluginProbe ʕ •ᴥ•ʔ
Nested Pages / 3.2.3
Nested Pages v3.2.3
3.3.1 3.2.15 3.2.14 3.1.8 3.1.9 3.2.0 3.2.1 3.2.10 3.2.11 3.2.12 3.2.13 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 trunk 1.0 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.3.0 1.3.1 1.3.10 1.3.11 1.3.12 1.3.13 1.3.14 1.3.15 1.3.2 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.3.1 1.6.3.2 1.6.4 1.6.5 1.6.5.1 1.6.5.2 1.6.6 1.6.7 1.6.8 1.7.0 1.7.1 2.0.1 2.0.2 2.0.3 2.0.4 3.0.1 3.0.10 3.0.11 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.17 3.1.18 3.1.19 3.1.2 3.1.20 3.1.21 3.1.22 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7
wp-nested-pages / app / Views / forms / quickedit-post.php
wp-nested-pages / app / Views / forms Last commit date
bulk-add.php 6 years ago clone-form.php 3 years ago delete-confirmation-modal.php 6 years ago empty-trash-modal.php 6 years ago link-form.php 5 years ago new-child.php 3 years ago quickedit-link.php 6 years ago quickedit-post.php 4 years ago
quickedit-post.php
297 lines
1 <?php
2 /**
3 * See public inline_edit method of WP_Posts_List_Table class
4 */
5 $post_type_object = get_post_type_object( 'page' );
6 $can_publish = current_user_can( $post_type_object->cap->publish_posts );
7 $wpml_pages = ( $this->integrations->plugins->wpml->installed && $this->integrations->plugins->wpml->isDefaultLanguage()) ? true : false;
8 if ( !$this->integrations->plugins->wpml->installed ) $wpml_pages = true;
9
10 $has_taxonomies = ( !empty($this->h_taxonomies) || !empty($this->f_taxonomies) ) ? true : false;
11 $has_taxonomies = ( $has_taxonomies && !array_key_exists('hide_taxonomies', $this->disabled_standard_fields) ) ? true : false;
12 $has_menu_options = ( $this->user->canSortPosts($this->post_type->name) && $this->post_type->name == 'page' && !$this->listing_repo->isSearch() && !array_key_exists('menu_options', $this->disabled_standard_fields) && $wpml_pages && !$this->settings->menusDisabled() ) ? true : false;
13 ?>
14
15 <form method="get" action="">
16
17 <div class="header <?php if ( !$has_taxonomies && $this->post_type->name !== 'page' ) echo 'no-tabs'; ?>">
18 <h3><?php _e('Quick Edit', 'wp-nested-pages'); ?><span class="page_id"></span></h3>
19 <div class="np-quickedit-error" style="clear:both;display:none;"></div>
20 <ul class="np-tabs">
21 <li class="active"><a href="#" data-np-tab-group="quick-edit" data-np-tab-toggle="post-info"><?php esc_html_e($this->post_type->labels->singular_name); ?></a></li>
22 <?php if ( $has_taxonomies ) : ?>
23 <li><a href="#" data-np-tab-group="quick-edit" data-np-tab-toggle="taxonomies"><?php esc_html_e('Taxonomies', 'wp-nested-pages'); ?></a></li>
24 <?php endif; ?>
25 <?php if ( $has_menu_options ) : ?>
26 <li><a href="#" data-np-tab-group="quick-edit" data-np-tab-toggle="menu-options"><?php esc_html_e('Menu Options', 'wp-nested-pages'); ?></a></li>
27 <?php endif; ?>
28 </ul>
29 </div>
30
31 <div class="form-interior">
32
33 <div class="fields">
34
35 <div class="np-tab-pane" data-np-tab-pane="post-info" data-np-tab-group="quick-edit" style="display: block;">
36 <div class="left">
37
38 <?php if ( !array_key_exists('title', $this->disabled_standard_fields) ) : ?>
39 <div class="form-control">
40 <label><?php _e( 'Title' ); ?></label>
41 <input type="text" name="post_title" class="np_title" value="" />
42 </div>
43 <?php endif; ?>
44
45 <?php if ( !array_key_exists('slug', $this->disabled_standard_fields) ) : ?>
46 <div class="form-control">
47 <label><?php _e( 'Slug' ); ?></label>
48 <input type="text" name="post_name" class="np_slug" value="" />
49 </div>
50 <?php endif; ?>
51
52 <?php if ( !array_key_exists('date', $this->disabled_standard_fields) ) : ?>
53 <?php if ( $this->settings->datepickerEnabled() ) : ?>
54 <div class="form-control np-datepicker-container">
55 <label><?php _e( 'Date' ); ?></label>
56 <div class="datetime">
57 <input type="text" name="np_date" class="np_datepicker np_publish_date" value="" />
58 <span><?php _e('@', 'wp-nested-pages'); ?></span>
59 <div class="np-time-container">
60 <?php if ( get_option('time_format') !== 'H:i' ) : ?>
61 <select name="np_ampm" class="np_ampm">
62 <option value="am"><?php _e('am', 'wp-nested-pages'); ?></option>
63 <option value="pm"><?php _e('pm', 'wp-nested-pages'); ?></option>
64 </select>
65 <?php endif; ?>
66 <input type="text" name="np_time" class="np_time" value="" />
67 </div>
68 </div>
69 </div>
70 <?php else : ?>
71 <div>
72 <label><?php _e( 'Date', 'wp-nested-pages' ); ?></label>
73 <div class="dates"><?php touch_time( 1, 1, 0, 1 ); ?></div>
74 </div>
75 <?php endif; endif; ?>
76
77 <?php
78 /*
79 * Authors Dropdown
80 */
81 if ( !array_key_exists('author', $this->disabled_standard_fields) ) :
82 $authors_dropdown = '';
83 if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) ) :
84 $users_opt = [
85 'hide_if_only_one_author' => false,
86 'capability' => 'edit_posts',
87 'name' => 'post_author',
88 'id' => 'post_author',
89 'class'=> 'authors',
90 'multi' => 1,
91 'echo' => 0
92 ];
93
94 if ( $authors = wp_dropdown_users( $users_opt ) ) :
95 $authors_dropdown = '<div class="form-control np_author"><label>' . __( 'Author' ) . '</label>';
96 $authors_dropdown .= $authors;
97 $authors_dropdown .= '</div>';
98 endif;
99 echo $authors_dropdown;
100 endif;
101 endif;
102 ?>
103
104 <?php
105 if ( !array_key_exists('status', $this->disabled_standard_fields) ) :
106 $statuses = $this->post_type_repo->quickEditStatuses($this->post_type->name);
107 ?>
108 <div class="form-control">
109 <label><?php _e( 'Status' ); ?></label>
110 <select name="_status" class="np_status">
111 <?php
112 if ( $can_publish && isset($statuses['can_publish']) ) :
113 foreach ( $statuses['can_publish'] as $status => $label ){
114 echo '<option value="' . $status . '">' . $label . '</option>';
115 }
116 endif;
117 foreach ( $statuses['other'] as $status => $label ){
118 echo '<option value="' . $status . '">' . $label . '</option>';
119 }
120 ?>
121 </select>
122 </div>
123 <?php endif; ?>
124
125 <?php
126 $custom_fields_left = $this->custom_fields_repo->outputFields($this->post_type, 'left');
127 if ( $custom_fields_left ) echo $custom_fields_left;
128 ?>
129
130 </div><!-- .left -->
131
132 <div class="right">
133
134 <?php if ( $this->post_type->hierarchical && !array_key_exists('template', $this->disabled_standard_fields)) : ?>
135 <div class="form-control">
136 <label><?php _e( 'Template' ); ?></label>
137 <select name="page_template" class="np_template">
138 <option value="default"><?php _e( 'Default Template' ); ?></option>
139 <?php page_template_dropdown() ?>
140 </select>
141 </div>
142 <?php endif; ?>
143
144 <?php if ( $can_publish && !array_key_exists('password', $this->disabled_standard_fields) ) : ?>
145 <div class="form-control password">
146 <label><?php _e( 'Password' ); ?></label>
147 <input type="text" class="post_password" name="post_password" value="" />
148 <div class="private">
149 <em style="margin:2px 8px 0 0" class="alignleft"><?php _e( '&ndash;OR&ndash;' ); ?></em>
150 <label>
151 <input type="checkbox" class="keep_private" name="keep_private" value="private" />
152 <?php echo __( 'Private' ); ?>
153 </label>
154 </div>
155 </div>
156 <?php endif; ?>
157
158 <?php if ( !array_key_exists('allow_comments', $this->disabled_standard_fields) ) : ?>
159 <div class="comments">
160 <label>
161 <input type="checkbox" name="comment_status" class="np_cs" value="open" />
162 <span class="checkbox-title"><?php _e( 'Allow Comments' ); ?></span>
163 </label>
164 </div>
165 <?php endif; ?>
166
167 <?php if ( current_user_can('edit_theme_options') && !array_key_exists('hide_in_np', $this->disabled_standard_fields) ) : ?>
168 <div class="comments">
169 <label>
170 <input type="checkbox" name="nested_pages_status" class="nested_pages_status" value="hide" />
171 <span class="checkbox-title"><?php _e( 'Hide in Nested Pages', 'wp-nested-pages' ); ?></span>
172 </label>
173 </div>
174 <?php endif; // Edit theme options ?>
175
176 <?php
177 $sticky_available = ( $this->post_type->hierarchical ) ? false : true;
178 $sticky_available = apply_filters('nestedpages_sticky_available', $sticky_available, $this->post, $this->post_type);
179 $make_sticky = apply_filters('nestedpages_make_sticky_text', __('Make Sticky', 'wp-nested-pages'), $this->post, $this->post_type);
180 if ( $sticky_available ) :
181 ?>
182 <div class="comments">
183 <label>
184 <input type="checkbox" name="sticky" class="np-sticky" value="sticky" />
185 <span class="checkbox-title"><?php echo $make_sticky; ?></span>
186 </label>
187 </div>
188 <?php endif; ?>
189
190 <?php
191 $custom_fields_right = $this->custom_fields_repo->outputFields($this->post_type, 'right');
192 if ( $custom_fields_right ) echo $custom_fields_right;
193 ?>
194
195 </div><!-- .right -->
196 </div><!-- .np-tab-pane -->
197
198
199 <?php if ( $has_taxonomies ) : ?>
200 <div class="np-tab-pane np-taxonomies" data-np-tab-pane="taxonomies" data-np-tab-group="quick-edit">
201 <?php
202 foreach ( $this->h_taxonomies as $taxonomy ) :
203 $disabled = $this->post_type_repo->taxonomyDisabled($taxonomy->name, $this->post_type->name);
204 if ( !$disabled ) :
205 ?>
206 <div class="np-taxonomy">
207 <span class="title"><?php esc_html_e( $taxonomy->labels->name ) ?></span>
208 <input type="hidden" name="<?php echo ( $taxonomy->name == 'category' ) ? 'post_category[]' : 'tax_input[' . esc_attr( $taxonomy->name ) . '][]'; ?>" value="0" />
209 <ul class="cat-checklist <?php echo esc_attr( $taxonomy->name )?>-checklist">
210 <?php wp_terms_checklist( null, array( 'taxonomy' => $taxonomy->name ) ) ?>
211 </ul>
212 </div><!-- .np-taxonomy -->
213 <?php
214 endif;
215 endforeach;
216 ?>
217
218 <?php
219 foreach ( $this->f_taxonomies as $taxonomy ) :
220 $disabled = $this->post_type_repo->taxonomyDisabled($taxonomy->name, $this->post_type->name);
221 if ( !$disabled ) :
222 ?>
223 <div class="np-taxonomy">
224 <span class="title"><?php esc_html_e( $taxonomy->labels->name ) ?></span>
225 <textarea id="<?php esc_attr_e($taxonomy->name); ?>-quickedit" cols="22" rows="1" name="tax_input[<?php esc_attr_e( $taxonomy->name )?>]" class="tax_input_<?php esc_attr_e( $taxonomy->name )?>" data-autotag data-taxonomy="<?php esc_attr_e($taxonomy->name); ?>"></textarea>
226 </div><!-- .np-taxonomy -->
227 <?php
228 endif;
229 endforeach;
230 ?>
231 </div><!-- .taxonomies.tab-pane -->
232 <?php endif; // if taxonomies ?>
233
234
235 <?php if ( $has_menu_options ) : ?>
236 <div class="np-tab-pane np-menuoptions" data-np-tab-pane="menu-options" data-np-tab-group="quick-edit">
237 <?php
238 $current_menu_term = $this->settings->getMenuTerm();
239 if ( $current_menu_term ) :
240 $edit_url = admin_url("nav-menus.php?menu=$current_menu_term->term_id");
241 ?>
242 <div class="np-menuoptions-description">
243 <p class="current-menu"><?php echo wp_kses(sprintf(__('<strong>Current Menu</strong>: %s', 'wp-nested-pages'), $current_menu_term->name), ['strong' => []]); ?> (<a href="<?php echo $edit_url; ?>"><?php _e('Edit', 'wp-nested-pages'); ?></a>)</p>
244 </div>
245 <?php endif; ?>
246 <div class="left">
247 <div class="form-control">
248 <label><?php _e( 'Navigation Label' ); ?></label>
249 <input type="text" name="np_nav_title" class="np_nav_title" value="" />
250 </div>
251 <div class="form-control">
252 <label><?php _e( 'Title Attribute' ); ?></label>
253 <input type="text" name="np_title_attribute" class="np_title_attribute" value="" />
254 </div>
255 <div class="form-control">
256 <label><?php _e( 'CSS Classes' ); ?></label>
257 <input type="text" name="np_nav_css_classes" class="np_nav_css_classes" value="" />
258 </div>
259 <div class="form-control">
260 <label><?php _e( 'Custom URL' ); ?></label>
261 <input type="text" name="np_nav_custom_url" class="np_nav_custom_url" placeholder="<?php _e('Example: #', 'wp-nested-pages'); ?>" value="" />
262 </div>
263 </div><!-- .menuoptions-left -->
264 <div class="right">
265 <div class="form-control">
266 <label>
267 <input type="checkbox" name="nav_status" class="np_nav_status" value="hide" />
268 <span class="checkbox-title"><?php _e( 'Hide in Nav Menu', 'wp-nested-pages' ); ?></span>
269 </label>
270 </div>
271 <div class="form-control">
272 <label>
273 <input type="checkbox" name="link_target" class="link_target" value="_blank" />
274 <span class="checkbox-title"><?php _e( 'Open link in a new window/tab' ); ?></span>
275 </label>
276 </div>
277 </div><!-- .menuoptions-right -->
278 </div>
279 <?php endif; ?>
280
281 </div><!-- .fields -->
282
283 </div><!-- .form-interior -->
284
285 <div class="buttons">
286 <input type="hidden" name="post_id" class="np_id" value="<?php echo get_the_id(); ?>">
287 <a accesskey="c" href="#inline-edit" class="button-secondary alignleft np-cancel-quickedit">
288 <?php _e( 'Cancel' ); ?>
289 </a>
290 <a accesskey="s" href="#inline-edit" class="button-primary np-save-quickedit alignright">
291 <?php _e( 'Update' ); ?>
292 </a>
293 <div class="np-qe-loading">
294 <?php include( NestedPages\Helpers::asset('images/spinner.svg') ); ?>
295 </div>
296 </div>
297 </form>