40 if ( 'publish' == $post->post_status ) { |
40 if ( 'publish' == $post->post_status ) { |
41 $preview_link = esc_url( get_permalink( $post->ID ) ); |
41 $preview_link = esc_url( get_permalink( $post->ID ) ); |
42 $preview_button = __( 'Preview Changes' ); |
42 $preview_button = __( 'Preview Changes' ); |
43 } else { |
43 } else { |
44 $preview_link = set_url_scheme( get_permalink( $post->ID ) ); |
44 $preview_link = set_url_scheme( get_permalink( $post->ID ) ); |
45 $preview_link = esc_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ) ) ); |
45 |
|
46 /** |
|
47 * Filter the URI of a post preview in the post submit box. |
|
48 * |
|
49 * @since 2.0.5 |
|
50 * @since 4.0.0 $post parameter was added. |
|
51 * |
|
52 * @param string $preview_link URI the user will be directed to for a post preview. |
|
53 * @param WP_Post $post Post object. |
|
54 */ |
|
55 $preview_link = esc_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post ) ); |
46 $preview_button = __( 'Preview' ); |
56 $preview_button = __( 'Preview' ); |
47 } |
57 } |
48 ?> |
58 ?> |
49 <a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview" id="post-preview"><?php echo $preview_button; ?></a> |
59 <a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview-<?php echo (int) $post->ID; ?>" id="post-preview"><?php echo $preview_button; ?></a> |
50 <input type="hidden" name="wp-preview" id="wp-preview" value="" /> |
60 <input type="hidden" name="wp-preview" id="wp-preview" value="" /> |
51 </div> |
61 </div> |
52 <?php endif; // public post type ?> |
62 <?php endif; // public post type ?> |
53 <div class="clear"></div> |
63 <div class="clear"></div> |
54 </div><!-- #minor-publishing-actions --> |
64 </div><!-- #minor-publishing-actions --> |
141 <span id="password-span"><label for="post_password"><?php _e('Password:'); ?></label> <input type="text" name="post_password" id="post_password" value="<?php echo esc_attr($post->post_password); ?>" maxlength="20" /><br /></span> |
151 <span id="password-span"><label for="post_password"><?php _e('Password:'); ?></label> <input type="text" name="post_password" id="post_password" value="<?php echo esc_attr($post->post_password); ?>" maxlength="20" /><br /></span> |
142 <input type="radio" name="visibility" id="visibility-radio-private" value="private" <?php checked( $visibility, 'private' ); ?> /> <label for="visibility-radio-private" class="selectit"><?php _e('Private'); ?></label><br /> |
152 <input type="radio" name="visibility" id="visibility-radio-private" value="private" <?php checked( $visibility, 'private' ); ?> /> <label for="visibility-radio-private" class="selectit"><?php _e('Private'); ?></label><br /> |
143 |
153 |
144 <p> |
154 <p> |
145 <a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a> |
155 <a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a> |
146 <a href="#visibility" class="cancel-post-visibility hide-if-no-js"><?php _e('Cancel'); ?></a> |
156 <a href="#visibility" class="cancel-post-visibility hide-if-no-js button-cancel"><?php _e('Cancel'); ?></a> |
147 </p> |
157 </p> |
148 </div> |
158 </div> |
149 <?php } ?> |
159 <?php } ?> |
150 |
160 |
151 </div><!-- .misc-pub-section --> |
161 </div><!-- .misc-pub-section --> |
152 |
162 |
153 <?php |
163 <?php |
154 // translators: Publish box date format, see http://php.net/date |
164 /* translators: Publish box date format, see http://php.net/date */ |
155 $datef = __( 'M j, Y @ G:i' ); |
165 $datef = __( 'M j, Y @ H:i' ); |
156 if ( 0 != $post->ID ) { |
166 if ( 0 != $post->ID ) { |
157 if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date |
167 if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date |
158 $stamp = __('Scheduled for: <b>%1$s</b>'); |
168 $stamp = __('Scheduled for: <b>%1$s</b>'); |
159 } else if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published |
169 } elseif ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published |
160 $stamp = __('Published on: <b>%1$s</b>'); |
170 $stamp = __('Published on: <b>%1$s</b>'); |
161 } else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified |
171 } elseif ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified |
162 $stamp = __('Publish <b>immediately</b>'); |
172 $stamp = __('Publish <b>immediately</b>'); |
163 } else if ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified |
173 } elseif ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified |
164 $stamp = __('Schedule for: <b>%1$s</b>'); |
174 $stamp = __('Schedule for: <b>%1$s</b>'); |
165 } else { // draft, 1 or more saves, date specified |
175 } else { // draft, 1 or more saves, date specified |
166 $stamp = __('Publish on: <b>%1$s</b>'); |
176 $stamp = __('Publish on: <b>%1$s</b>'); |
167 } |
177 } |
168 $date = date_i18n( $datef, strtotime( $post->post_date ) ); |
178 $date = date_i18n( $datef, strtotime( $post->post_date ) ); |
183 echo '</span>'; |
193 echo '</span>'; |
184 } else { |
194 } else { |
185 printf( __( 'Revisions: %s' ), '<b>' . number_format_i18n( $args['args']['revisions_count'] ) . '</b>' ); |
195 printf( __( 'Revisions: %s' ), '<b>' . number_format_i18n( $args['args']['revisions_count'] ) . '</b>' ); |
186 } |
196 } |
187 ?> |
197 ?> |
188 <a class="hide-if-no-js" href="<?php echo esc_url( get_edit_post_link( $args['args']['revision_id'] ) ); ?>"><?php _ex( 'Browse', 'revisions' ); ?></a> |
198 <a class="hide-if-no-js" href="<?php echo esc_url( get_edit_post_link( $args['args']['revision_id'] ) ); ?>"><span aria-hidden="true"><?php _ex( 'Browse', 'revisions' ); ?></span> <span class="screen-reader-text"><?php _e( 'Browse revisions' ); ?></span></a> |
189 </div> |
199 </div> |
190 <?php endif; |
200 <?php endif; |
191 |
201 |
192 if ( $can_publish ) : // Contributors don't get to choose the date of publish ?> |
202 if ( $can_publish ) : // Contributors don't get to choose the date of publish ?> |
193 <div class="misc-pub-section curtime misc-pub-curtime"> |
203 <div class="misc-pub-section curtime misc-pub-curtime"> |
194 <span id="timestamp"> |
204 <span id="timestamp"> |
195 <?php printf($stamp, $date); ?></span> |
205 <?php printf($stamp, $date); ?></span> |
196 <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js"><?php _e('Edit') ?></a> |
206 <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit date and time' ); ?></span></a> |
197 <div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'), 1); ?></div> |
207 <div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'), 1); ?></div> |
198 </div><?php // /misc-pub-section ?> |
208 </div><?php // /misc-pub-section ?> |
199 <?php endif; ?> |
209 <?php endif; ?> |
200 |
210 |
201 <?php do_action('post_submitbox_misc_actions'); ?> |
211 <?php |
|
212 /** |
|
213 * Fires after the post time/date setting in the Publish meta box. |
|
214 * |
|
215 * @since 2.9.0 |
|
216 */ |
|
217 do_action( 'post_submitbox_misc_actions' ); |
|
218 ?> |
202 </div> |
219 </div> |
203 <div class="clear"></div> |
220 <div class="clear"></div> |
204 </div> |
221 </div> |
205 |
222 |
206 <div id="major-publishing-actions"> |
223 <div id="major-publishing-actions"> |
207 <?php do_action('post_submitbox_start'); ?> |
224 <?php |
|
225 /** |
|
226 * Fires at the beginning of the publishing actions section of the Publish meta box. |
|
227 * |
|
228 * @since 2.7.0 |
|
229 */ |
|
230 do_action( 'post_submitbox_start' ); |
|
231 ?> |
208 <div id="delete-action"> |
232 <div id="delete-action"> |
209 <?php |
233 <?php |
210 if ( current_user_can( "delete_post", $post->ID ) ) { |
234 if ( current_user_can( "delete_post", $post->ID ) ) { |
211 if ( !EMPTY_TRASH_DAYS ) |
235 if ( !EMPTY_TRASH_DAYS ) |
212 $delete_text = __('Delete Permanently'); |
236 $delete_text = __('Delete Permanently'); |
222 <?php |
246 <?php |
223 if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) { |
247 if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) { |
224 if ( $can_publish ) : |
248 if ( $can_publish ) : |
225 if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?> |
249 if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?> |
226 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Schedule') ?>" /> |
250 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Schedule') ?>" /> |
227 <?php submit_button( __( 'Schedule' ), 'primary button-large', 'publish', false, array( 'accesskey' => 'p' ) ); ?> |
251 <?php submit_button( __( 'Schedule' ), 'primary button-large', 'publish', false ); ?> |
228 <?php else : ?> |
252 <?php else : ?> |
229 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Publish') ?>" /> |
253 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Publish') ?>" /> |
230 <?php submit_button( __( 'Publish' ), 'primary button-large', 'publish', false, array( 'accesskey' => 'p' ) ); ?> |
254 <?php submit_button( __( 'Publish' ), 'primary button-large', 'publish', false ); ?> |
231 <?php endif; |
255 <?php endif; |
232 else : ?> |
256 else : ?> |
233 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Submit for Review') ?>" /> |
257 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Submit for Review') ?>" /> |
234 <?php submit_button( __( 'Submit for Review' ), 'primary button-large', 'publish', false, array( 'accesskey' => 'p' ) ); ?> |
258 <?php submit_button( __( 'Submit for Review' ), 'primary button-large', 'publish', false ); ?> |
235 <?php |
259 <?php |
236 endif; |
260 endif; |
237 } else { ?> |
261 } else { ?> |
238 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update') ?>" /> |
262 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update') ?>" /> |
239 <input name="save" type="submit" class="button button-primary button-large" id="publish" accesskey="p" value="<?php esc_attr_e('Update') ?>" /> |
263 <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update' ) ?>" /> |
240 <?php |
264 <?php |
241 } ?> |
265 } ?> |
242 </div> |
266 </div> |
243 <div class="clear"></div> |
267 <div class="clear"></div> |
244 </div> |
268 </div> |
271 </div> |
290 </div> |
272 |
291 |
273 |
292 |
274 <div id="misc-publishing-actions"> |
293 <div id="misc-publishing-actions"> |
275 <?php |
294 <?php |
276 // translators: Publish box date format, see http://php.net/date |
295 /* translators: Publish box date format, see http://php.net/date */ |
277 $datef = __( 'M j, Y @ G:i' ); |
296 $datef = __( 'M j, Y @ H:i' ); |
278 $stamp = __('Uploaded on: <b>%1$s</b>'); |
297 $stamp = __('Uploaded on: <b>%1$s</b>'); |
279 $date = date_i18n( $datef, strtotime( $post->post_date ) ); |
298 $date = date_i18n( $datef, strtotime( $post->post_date ) ); |
280 ?> |
299 ?> |
281 <div class="misc-pub-section curtime misc-pub-curtime"> |
300 <div class="misc-pub-section curtime misc-pub-curtime"> |
282 <span id="timestamp"><?php printf($stamp, $date); ?></span> |
301 <span id="timestamp"><?php printf($stamp, $date); ?></span> |
283 </div><!-- .misc-pub-section --> |
302 </div><!-- .misc-pub-section --> |
284 |
303 |
285 <?php do_action('attachment_submitbox_misc_actions'); ?> |
304 <?php |
|
305 /** |
|
306 * Fires after the 'Uploaded on' section of the Save meta box |
|
307 * in the attachment editing screen. |
|
308 * |
|
309 * @since 3.5.0 |
|
310 */ |
|
311 do_action( 'attachment_submitbox_misc_actions' ); |
|
312 ?> |
286 </div><!-- #misc-publishing-actions --> |
313 </div><!-- #misc-publishing-actions --> |
287 <div class="clear"></div> |
314 <div class="clear"></div> |
288 </div><!-- #minor-publishing --> |
315 </div><!-- #minor-publishing --> |
289 |
316 |
290 <div id="major-publishing-actions"> |
317 <div id="major-publishing-actions"> |
344 /** |
379 /** |
345 * Display post tags form fields. |
380 * Display post tags form fields. |
346 * |
381 * |
347 * @since 2.6.0 |
382 * @since 2.6.0 |
348 * |
383 * |
349 * @param object $post |
384 * @todo Create taxonomy-agnostic wrapper for this. |
350 */ |
385 * |
351 function post_tags_meta_box($post, $box) { |
386 * @param WP_Post $post Post object. |
352 $defaults = array('taxonomy' => 'post_tag'); |
387 * @param array $box { |
353 if ( !isset($box['args']) || !is_array($box['args']) ) |
388 * Tags meta box arguments. |
|
389 * |
|
390 * @type string $id Meta box ID. |
|
391 * @type string $title Meta box title. |
|
392 * @type callback $callback Meta box display callback. |
|
393 * @type array $args { |
|
394 * Extra meta box arguments. |
|
395 * |
|
396 * @type string $taxonomy Taxonomy. Default 'post_tag'. |
|
397 * } |
|
398 * } |
|
399 */ |
|
400 function post_tags_meta_box( $post, $box ) { |
|
401 $defaults = array( 'taxonomy' => 'post_tag' ); |
|
402 if ( ! isset( $box['args'] ) || ! is_array( $box['args'] ) ) { |
354 $args = array(); |
403 $args = array(); |
355 else |
404 } else { |
356 $args = $box['args']; |
405 $args = $box['args']; |
357 extract( wp_parse_args($args, $defaults), EXTR_SKIP ); |
406 } |
358 $tax_name = esc_attr($taxonomy); |
407 $r = wp_parse_args( $args, $defaults ); |
359 $taxonomy = get_taxonomy($taxonomy); |
408 $tax_name = esc_attr( $r['taxonomy'] ); |
|
409 $taxonomy = get_taxonomy( $r['taxonomy'] ); |
360 $user_can_assign_terms = current_user_can( $taxonomy->cap->assign_terms ); |
410 $user_can_assign_terms = current_user_can( $taxonomy->cap->assign_terms ); |
361 $comma = _x( ',', 'tag delimiter' ); |
411 $comma = _x( ',', 'tag delimiter' ); |
362 ?> |
412 ?> |
363 <div class="tagsdiv" id="<?php echo $tax_name; ?>"> |
413 <div class="tagsdiv" id="<?php echo $tax_name; ?>"> |
364 <div class="jaxtag"> |
414 <div class="jaxtag"> |
366 <p><?php echo $taxonomy->labels->add_or_remove_items; ?></p> |
416 <p><?php echo $taxonomy->labels->add_or_remove_items; ?></p> |
367 <textarea name="<?php echo "tax_input[$tax_name]"; ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php echo $tax_name; ?>" <?php disabled( ! $user_can_assign_terms ); ?>><?php echo str_replace( ',', $comma . ' ', get_terms_to_edit( $post->ID, $tax_name ) ); // textarea_escaped by esc_attr() ?></textarea></div> |
417 <textarea name="<?php echo "tax_input[$tax_name]"; ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php echo $tax_name; ?>" <?php disabled( ! $user_can_assign_terms ); ?>><?php echo str_replace( ',', $comma . ' ', get_terms_to_edit( $post->ID, $tax_name ) ); // textarea_escaped by esc_attr() ?></textarea></div> |
368 <?php if ( $user_can_assign_terms ) : ?> |
418 <?php if ( $user_can_assign_terms ) : ?> |
369 <div class="ajaxtag hide-if-no-js"> |
419 <div class="ajaxtag hide-if-no-js"> |
370 <label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $box['title']; ?></label> |
420 <label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $box['title']; ?></label> |
371 <div class="taghint"><?php echo $taxonomy->labels->add_new_item; ?></div> |
|
372 <p><input type="text" id="new-tag-<?php echo $tax_name; ?>" name="newtag[<?php echo $tax_name; ?>]" class="newtag form-input-tip" size="16" autocomplete="off" value="" /> |
421 <p><input type="text" id="new-tag-<?php echo $tax_name; ?>" name="newtag[<?php echo $tax_name; ?>]" class="newtag form-input-tip" size="16" autocomplete="off" value="" /> |
373 <input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" /></p> |
422 <input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" /></p> |
374 </div> |
423 </div> |
375 <p class="howto"><?php echo $taxonomy->labels->separate_items_with_commas; ?></p> |
424 <p class="howto"><?php echo $taxonomy->labels->separate_items_with_commas; ?></p> |
376 <?php endif; ?> |
425 <?php endif; ?> |
386 /** |
435 /** |
387 * Display post categories form fields. |
436 * Display post categories form fields. |
388 * |
437 * |
389 * @since 2.6.0 |
438 * @since 2.6.0 |
390 * |
439 * |
391 * @param object $post |
440 * @todo Create taxonomy-agnostic wrapper for this. |
|
441 * |
|
442 * @param WP_Post $post Post object. |
|
443 * @param array $box { |
|
444 * Categories meta box arguments. |
|
445 * |
|
446 * @type string $id Meta box ID. |
|
447 * @type string $title Meta box title. |
|
448 * @type callback $callback Meta box display callback. |
|
449 * @type array $args { |
|
450 * Extra meta box arguments. |
|
451 * |
|
452 * @type string $taxonomy Taxonomy. Default 'category'. |
|
453 * } |
|
454 * } |
392 */ |
455 */ |
393 function post_categories_meta_box( $post, $box ) { |
456 function post_categories_meta_box( $post, $box ) { |
394 $defaults = array('taxonomy' => 'category'); |
457 $defaults = array( 'taxonomy' => 'category' ); |
395 if ( !isset($box['args']) || !is_array($box['args']) ) |
458 if ( ! isset( $box['args'] ) || ! is_array( $box['args'] ) ) { |
396 $args = array(); |
459 $args = array(); |
397 else |
460 } else { |
398 $args = $box['args']; |
461 $args = $box['args']; |
399 extract( wp_parse_args($args, $defaults), EXTR_SKIP ); |
462 } |
400 $tax = get_taxonomy($taxonomy); |
463 $r = wp_parse_args( $args, $defaults ); |
401 |
464 $tax_name = esc_attr( $r['taxonomy'] ); |
|
465 $taxonomy = get_taxonomy( $r['taxonomy'] ); |
402 ?> |
466 ?> |
403 <div id="taxonomy-<?php echo $taxonomy; ?>" class="categorydiv"> |
467 <div id="taxonomy-<?php echo $tax_name; ?>" class="categorydiv"> |
404 <ul id="<?php echo $taxonomy; ?>-tabs" class="category-tabs"> |
468 <ul id="<?php echo $tax_name; ?>-tabs" class="category-tabs"> |
405 <li class="tabs"><a href="#<?php echo $taxonomy; ?>-all"><?php echo $tax->labels->all_items; ?></a></li> |
469 <li class="tabs"><a href="#<?php echo $tax_name; ?>-all"><?php echo $taxonomy->labels->all_items; ?></a></li> |
406 <li class="hide-if-no-js"><a href="#<?php echo $taxonomy; ?>-pop"><?php _e( 'Most Used' ); ?></a></li> |
470 <li class="hide-if-no-js"><a href="#<?php echo $tax_name; ?>-pop"><?php _e( 'Most Used' ); ?></a></li> |
407 </ul> |
471 </ul> |
408 |
472 |
409 <div id="<?php echo $taxonomy; ?>-pop" class="tabs-panel" style="display: none;"> |
473 <div id="<?php echo $tax_name; ?>-pop" class="tabs-panel" style="display: none;"> |
410 <ul id="<?php echo $taxonomy; ?>checklist-pop" class="categorychecklist form-no-clear" > |
474 <ul id="<?php echo $tax_name; ?>checklist-pop" class="categorychecklist form-no-clear" > |
411 <?php $popular_ids = wp_popular_terms_checklist($taxonomy); ?> |
475 <?php $popular_ids = wp_popular_terms_checklist( $tax_name ); ?> |
412 </ul> |
476 </ul> |
413 </div> |
477 </div> |
414 |
478 |
415 <div id="<?php echo $taxonomy; ?>-all" class="tabs-panel"> |
479 <div id="<?php echo $tax_name; ?>-all" class="tabs-panel"> |
416 <?php |
480 <?php |
417 $name = ( $taxonomy == 'category' ) ? 'post_category' : 'tax_input[' . $taxonomy . ']'; |
481 $name = ( $tax_name == 'category' ) ? 'post_category' : 'tax_input[' . $tax_name . ']'; |
418 echo "<input type='hidden' name='{$name}[]' value='0' />"; // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks. |
482 echo "<input type='hidden' name='{$name}[]' value='0' />"; // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks. |
419 ?> |
483 ?> |
420 <ul id="<?php echo $taxonomy; ?>checklist" data-wp-lists="list:<?php echo $taxonomy?>" class="categorychecklist form-no-clear"> |
484 <ul id="<?php echo $tax_name; ?>checklist" data-wp-lists="list:<?php echo $tax_name; ?>" class="categorychecklist form-no-clear"> |
421 <?php wp_terms_checklist($post->ID, array( 'taxonomy' => $taxonomy, 'popular_cats' => $popular_ids ) ) ?> |
485 <?php wp_terms_checklist( $post->ID, array( 'taxonomy' => $tax_name, 'popular_cats' => $popular_ids ) ); ?> |
422 </ul> |
486 </ul> |
423 </div> |
487 </div> |
424 <?php if ( current_user_can($tax->cap->edit_terms) ) : ?> |
488 <?php if ( current_user_can( $taxonomy->cap->edit_terms ) ) : ?> |
425 <div id="<?php echo $taxonomy; ?>-adder" class="wp-hidden-children"> |
489 <div id="<?php echo $tax_name; ?>-adder" class="wp-hidden-children"> |
426 <h4> |
490 <h4> |
427 <a id="<?php echo $taxonomy; ?>-add-toggle" href="#<?php echo $taxonomy; ?>-add" class="hide-if-no-js"> |
491 <a id="<?php echo $tax_name; ?>-add-toggle" href="#<?php echo $tax_name; ?>-add" class="hide-if-no-js"> |
428 <?php |
492 <?php |
429 /* translators: %s: add new taxonomy label */ |
493 /* translators: %s: add new taxonomy label */ |
430 printf( __( '+ %s' ), $tax->labels->add_new_item ); |
494 printf( __( '+ %s' ), $taxonomy->labels->add_new_item ); |
431 ?> |
495 ?> |
432 </a> |
496 </a> |
433 </h4> |
497 </h4> |
434 <p id="<?php echo $taxonomy; ?>-add" class="category-add wp-hidden-child"> |
498 <p id="<?php echo $tax_name; ?>-add" class="category-add wp-hidden-child"> |
435 <label class="screen-reader-text" for="new<?php echo $taxonomy; ?>"><?php echo $tax->labels->add_new_item; ?></label> |
499 <label class="screen-reader-text" for="new<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->add_new_item; ?></label> |
436 <input type="text" name="new<?php echo $taxonomy; ?>" id="new<?php echo $taxonomy; ?>" class="form-required form-input-tip" value="<?php echo esc_attr( $tax->labels->new_item_name ); ?>" aria-required="true"/> |
500 <input type="text" name="new<?php echo $tax_name; ?>" id="new<?php echo $tax_name; ?>" class="form-required form-input-tip" value="<?php echo esc_attr( $taxonomy->labels->new_item_name ); ?>" aria-required="true"/> |
437 <label class="screen-reader-text" for="new<?php echo $taxonomy; ?>_parent"> |
501 <label class="screen-reader-text" for="new<?php echo $tax_name; ?>_parent"> |
438 <?php echo $tax->labels->parent_item_colon; ?> |
502 <?php echo $taxonomy->labels->parent_item_colon; ?> |
439 </label> |
503 </label> |
440 <?php wp_dropdown_categories( array( 'taxonomy' => $taxonomy, 'hide_empty' => 0, 'name' => 'new'.$taxonomy.'_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '— ' . $tax->labels->parent_item . ' —' ) ); ?> |
504 <?php wp_dropdown_categories( array( 'taxonomy' => $tax_name, 'hide_empty' => 0, 'name' => 'new' . $tax_name . '_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '— ' . $taxonomy->labels->parent_item . ' —' ) ); ?> |
441 <input type="button" id="<?php echo $taxonomy; ?>-add-submit" data-wp-lists="add:<?php echo $taxonomy ?>checklist:<?php echo $taxonomy ?>-add" class="button category-add-submit" value="<?php echo esc_attr( $tax->labels->add_new_item ); ?>" /> |
505 <input type="button" id="<?php echo $tax_name; ?>-add-submit" data-wp-lists="add:<?php echo $tax_name; ?>checklist:<?php echo $tax_name; ?>-add" class="button category-add-submit" value="<?php echo esc_attr( $taxonomy->labels->add_new_item ); ?>" /> |
442 <?php wp_nonce_field( 'add-'.$taxonomy, '_ajax_nonce-add-'.$taxonomy, false ); ?> |
506 <?php wp_nonce_field( 'add-' . $tax_name, '_ajax_nonce-add-' . $tax_name, false ); ?> |
443 <span id="<?php echo $taxonomy; ?>-ajax-response"></span> |
507 <span id="<?php echo $tax_name; ?>-ajax-response"></span> |
444 </p> |
508 </p> |
445 </div> |
509 </div> |
446 <?php endif; ?> |
510 <?php endif; ?> |
447 </div> |
511 </div> |
448 <?php |
512 <?php |
522 function post_comment_status_meta_box($post) { |
586 function post_comment_status_meta_box($post) { |
523 ?> |
587 ?> |
524 <input name="advanced_view" type="hidden" value="1" /> |
588 <input name="advanced_view" type="hidden" value="1" /> |
525 <p class="meta-options"> |
589 <p class="meta-options"> |
526 <label for="comment_status" class="selectit"><input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> /> <?php _e( 'Allow comments.' ) ?></label><br /> |
590 <label for="comment_status" class="selectit"><input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> /> <?php _e( 'Allow comments.' ) ?></label><br /> |
527 <label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php printf( __( 'Allow <a href="%s" target="_blank">trackbacks and pingbacks</a> on this page.' ), __( 'http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments' ) ); ?></label> |
591 <label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php printf( __( 'Allow <a href="%s" target="_blank">trackbacks and pingbacks</a> on this page.' ), __( 'https://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments' ) ); ?></label> |
528 <?php do_action('post_comment_status_meta_box-options', $post); ?> |
592 <?php |
|
593 /** |
|
594 * Fires at the end of the Discussion meta box on the post editing screen. |
|
595 * |
|
596 * @since 3.1.0 |
|
597 * |
|
598 * @param WP_Post $post WP_Post object of the current post. |
|
599 */ |
|
600 do_action( 'post_comment_status_meta_box-options', $post ); |
|
601 ?> |
529 </p> |
602 </p> |
530 <?php |
603 <?php |
531 } |
604 } |
532 |
605 |
533 /** |
606 /** |
644 'show_option_none' => __('(no parent)'), |
716 'show_option_none' => __('(no parent)'), |
645 'sort_column' => 'menu_order, post_title', |
717 'sort_column' => 'menu_order, post_title', |
646 'echo' => 0, |
718 'echo' => 0, |
647 ); |
719 ); |
648 |
720 |
|
721 /** |
|
722 * Filter the arguments used to generate a Pages drop-down element. |
|
723 * |
|
724 * @since 3.3.0 |
|
725 * |
|
726 * @see wp_dropdown_pages() |
|
727 * |
|
728 * @param array $dropdown_args Array of arguments used to generate the pages drop-down. |
|
729 * @param WP_Post $post The current WP_Post object. |
|
730 */ |
649 $dropdown_args = apply_filters( 'page_attributes_dropdown_pages_args', $dropdown_args, $post ); |
731 $dropdown_args = apply_filters( 'page_attributes_dropdown_pages_args', $dropdown_args, $post ); |
650 $pages = wp_dropdown_pages( $dropdown_args ); |
732 $pages = wp_dropdown_pages( $dropdown_args ); |
651 if ( ! empty($pages) ) { |
733 if ( ! empty($pages) ) { |
652 ?> |
734 ?> |
653 <p><strong><?php _e('Parent') ?></strong></p> |
735 <p><strong><?php _e('Parent') ?></strong></p> |
654 <label class="screen-reader-text" for="parent_id"><?php _e('Parent') ?></label> |
736 <label class="screen-reader-text" for="parent_id"><?php _e('Parent') ?></label> |
655 <?php echo $pages; ?> |
737 <?php echo $pages; ?> |
656 <?php |
738 <?php |
657 } // end empty pages check |
739 } // end empty pages check |
658 } // end hierarchical check. |
740 } // end hierarchical check. |
659 if ( 'page' == $post->post_type && 0 != count( get_page_templates() ) ) { |
741 if ( 'page' == $post->post_type && 0 != count( get_page_templates( $post ) ) && get_option( 'page_for_posts' ) != $post->ID ) { |
660 $template = !empty($post->page_template) ? $post->page_template : false; |
742 $template = !empty($post->page_template) ? $post->page_template : false; |
661 ?> |
743 ?> |
662 <p><strong><?php _e('Template') ?></strong></p> |
744 <p><strong><?php _e('Template') ?></strong></p> |
663 <label class="screen-reader-text" for="page_template"><?php _e('Page Template') ?></label><select name="page_template" id="page_template"> |
745 <label class="screen-reader-text" for="page_template"><?php _e('Page Template') ?></label><select name="page_template" id="page_template"> |
664 <option value='default'><?php _e('Default Template'); ?></option> |
746 <?php |
|
747 /** |
|
748 * Filter the title of the default page template displayed in the drop-down. |
|
749 * |
|
750 * @since 4.1.0 |
|
751 * |
|
752 * @param string $label The display value for the default page template title. |
|
753 * @param string $context Where the option label is displayed. Possible values |
|
754 * include 'meta-box' or 'quick-edit'. |
|
755 */ |
|
756 $default_title = apply_filters( 'default_page_template_title', __( 'Default Template' ), 'meta-box' ); |
|
757 ?> |
|
758 <option value="default"><?php echo esc_html( $default_title ); ?></option> |
665 <?php page_template_dropdown($template); ?> |
759 <?php page_template_dropdown($template); ?> |
666 </select> |
760 </select> |
667 <?php |
761 <?php |
668 } ?> |
762 } ?> |
669 <p><strong><?php _e('Order') ?></strong></p> |
763 <p><strong><?php _e('Order') ?></strong></p> |
670 <p><label class="screen-reader-text" for="menu_order"><?php _e('Order') ?></label><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo esc_attr($post->menu_order) ?>" /></p> |
764 <p><label class="screen-reader-text" for="menu_order"><?php _e('Order') ?></label><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo esc_attr($post->menu_order) ?>" /></p> |
671 <p><?php if ( 'page' == $post->post_type ) _e( 'Need help? Use the Help tab in the upper right of your screen.' ); ?></p> |
765 <?php if ( 'page' == $post->post_type && get_current_screen()->get_help_tabs() ) { ?> |
672 <?php |
766 <p><?php _e( 'Need help? Use the Help tab in the upper right of your screen.' ); ?></p> |
|
767 <?php |
|
768 } |
673 } |
769 } |
674 |
770 |
675 // -- Link related Meta Boxes |
771 // -- Link related Meta Boxes |
676 |
772 |
677 /** |
773 /** |
708 </div> |
804 </div> |
709 |
805 |
710 </div> |
806 </div> |
711 |
807 |
712 <div id="major-publishing-actions"> |
808 <div id="major-publishing-actions"> |
713 <?php do_action('post_submitbox_start'); ?> |
809 <?php |
|
810 /** This action is documented in wp-admin/includes/meta-boxes.php */ |
|
811 do_action( 'post_submitbox_start' ); |
|
812 ?> |
714 <div id="delete-action"> |
813 <div id="delete-action"> |
715 <?php |
814 <?php |
716 if ( !empty($_GET['action']) && 'edit' == $_GET['action'] && current_user_can('manage_links') ) { ?> |
815 if ( !empty($_GET['action']) && 'edit' == $_GET['action'] && current_user_can('manage_links') ) { ?> |
717 <a class="submitdelete deletion" href="<?php echo wp_nonce_url("link.php?action=delete&link_id=$link->link_id", 'delete-bookmark_' . $link->link_id); ?>" onclick="if ( confirm('<?php echo esc_js(sprintf(__("You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete."), $link->link_name )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a> |
816 <a class="submitdelete deletion" href="<?php echo wp_nonce_url("link.php?action=delete&link_id=$link->link_id", 'delete-bookmark_' . $link->link_id); ?>" onclick="if ( confirm('<?php echo esc_js(sprintf(__("You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete."), $link->link_name )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a> |
718 <?php } ?> |
817 <?php } ?> |
719 </div> |
818 </div> |
720 |
819 |
721 <div id="publishing-action"> |
820 <div id="publishing-action"> |
722 <?php if ( !empty($link->link_id) ) { ?> |
821 <?php if ( !empty($link->link_id) ) { ?> |
723 <input name="save" type="submit" class="button-large button-primary" id="publish" accesskey="p" value="<?php esc_attr_e('Update Link') ?>" /> |
822 <input name="save" type="submit" class="button-large button-primary" id="publish" value="<?php esc_attr_e( 'Update Link' ) ?>" /> |
724 <?php } else { ?> |
823 <?php } else { ?> |
725 <input name="save" type="submit" class="button-large button-primary" id="publish" accesskey="p" value="<?php esc_attr_e('Add Link') ?>" /> |
824 <input name="save" type="submit" class="button-large button-primary" id="publish" value="<?php esc_attr_e( 'Add Link' ) ?>" /> |
726 <?php } ?> |
825 <?php } ?> |
727 </div> |
826 </div> |
728 <div class="clear"></div> |
827 <div class="clear"></div> |
729 </div> |
828 </div> |
730 <?php do_action('submitlink_box'); ?> |
829 <?php |
|
830 /** |
|
831 * Fires at the end of the Publish box in the Link editing screen. |
|
832 * |
|
833 * @since 2.5.0 |
|
834 */ |
|
835 do_action( 'submitlink_box' ); |
|
836 ?> |
731 <div class="clear"></div> |
837 <div class="clear"></div> |
732 </div> |
838 </div> |
733 <?php |
839 <?php |
734 } |
840 } |
735 |
841 |