3 // -- Post related Meta Boxes
6 * Displays post submit form fields.
10 * @global string $action
12 * @param WP_Post $post Current post object.
13 * @param array $args {
14 * Array of arguments for building the post submit meta box.
16 * @type string $id Meta box 'id' attribute.
17 * @type string $title Meta box title.
18 * @type callable $callback Meta box display callback.
19 * @type array $args Extra meta box arguments.
22 function post_submit_meta_box( $post, $args = array() ) {
25 $post_type = $post->post_type;
26 $post_type_object = get_post_type_object($post_type);
27 $can_publish = current_user_can($post_type_object->cap->publish_posts);
29 <div class="submitbox" id="submitpost">
31 <div id="minor-publishing">
33 <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
34 <div style="display:none;">
35 <?php submit_button( __( 'Save' ), '', 'save' ); ?>
38 <div id="minor-publishing-actions">
39 <div id="save-action">
40 <?php if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { ?>
41 <input <?php if ( 'private' == $post->post_status ) { ?>style="display:none"<?php } ?> type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save Draft'); ?>" class="button" />
42 <span class="spinner"></span>
43 <?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?>
44 <input type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save as Pending'); ?>" class="button" />
45 <span class="spinner"></span>
48 <?php if ( is_post_type_viewable( $post_type_object ) ) : ?>
49 <div id="preview-action">
51 $preview_link = esc_url( get_preview_post_link( $post ) );
52 if ( 'publish' == $post->post_status ) {
53 $preview_button = __( 'Preview Changes' );
55 $preview_button = __( 'Preview' );
58 <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>
59 <input type="hidden" name="wp-preview" id="wp-preview" value="" />
61 <?php endif; // public post type ?>
64 * Fires before the post time/date setting in the Publish meta box.
68 * @param WP_Post $post WP_Post object for the current post.
70 do_action( 'post_submitbox_minor_actions', $post );
72 <div class="clear"></div>
73 </div><!-- #minor-publishing-actions -->
75 <div id="misc-publishing-actions">
77 <div class="misc-pub-section misc-pub-post-status">
78 <?php _e( 'Status:' ) ?> <span id="post-status-display"><?php
80 switch ( $post->post_status ) {
82 _e('Privately Published');
100 <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?>
101 <a href="#post_status" <?php if ( 'private' == $post->post_status ) { ?>style="display:none;" <?php } ?>class="edit-post-status hide-if-no-js" role="button"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit status' ); ?></span></a>
103 <div id="post-status-select" class="hide-if-js">
104 <input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo esc_attr( ('auto-draft' == $post->post_status ) ? 'draft' : $post->post_status); ?>" />
105 <label for="post_status" class="screen-reader-text"><?php _e( 'Set status' ) ?></label>
106 <select name="post_status" id="post_status">
107 <?php if ( 'publish' == $post->post_status ) : ?>
108 <option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e('Published') ?></option>
109 <?php elseif ( 'private' == $post->post_status ) : ?>
110 <option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e('Privately Published') ?></option>
111 <?php elseif ( 'future' == $post->post_status ) : ?>
112 <option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option>
114 <option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option>
115 <?php if ( 'auto-draft' == $post->post_status ) : ?>
116 <option<?php selected( $post->post_status, 'auto-draft' ); ?> value='draft'><?php _e('Draft') ?></option>
118 <option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft') ?></option>
121 <a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a>
122 <a href="#post_status" class="cancel-post-status hide-if-no-js button-cancel"><?php _e('Cancel'); ?></a>
126 </div><!-- .misc-pub-section -->
128 <div class="misc-pub-section misc-pub-visibility" id="visibility">
129 <?php _e('Visibility:'); ?> <span id="post-visibility-display"><?php
131 if ( 'private' == $post->post_status ) {
132 $post->post_password = '';
133 $visibility = 'private';
134 $visibility_trans = __('Private');
135 } elseif ( !empty( $post->post_password ) ) {
136 $visibility = 'password';
137 $visibility_trans = __('Password protected');
138 } elseif ( $post_type == 'post' && is_sticky( $post->ID ) ) {
139 $visibility = 'public';
140 $visibility_trans = __('Public, Sticky');
142 $visibility = 'public';
143 $visibility_trans = __('Public');
146 echo esc_html( $visibility_trans ); ?></span>
147 <?php if ( $can_publish ) { ?>
148 <a href="#visibility" class="edit-visibility hide-if-no-js" role="button"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit visibility' ); ?></span></a>
150 <div id="post-visibility-select" class="hide-if-js">
151 <input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo esc_attr($post->post_password); ?>" />
152 <?php if ($post_type == 'post'): ?>
153 <input type="checkbox" style="display:none" name="hidden_post_sticky" id="hidden-post-sticky" value="sticky" <?php checked(is_sticky($post->ID)); ?> />
155 <input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo esc_attr( $visibility ); ?>" />
156 <input type="radio" name="visibility" id="visibility-radio-public" value="public" <?php checked( $visibility, 'public' ); ?> /> <label for="visibility-radio-public" class="selectit"><?php _e('Public'); ?></label><br />
157 <?php if ( $post_type == 'post' && current_user_can( 'edit_others_posts' ) ) : ?>
158 <span id="sticky-span"><input id="sticky" name="sticky" type="checkbox" value="sticky" <?php checked( is_sticky( $post->ID ) ); ?> /> <label for="sticky" class="selectit"><?php _e( 'Stick this post to the front page' ); ?></label><br /></span>
160 <input type="radio" name="visibility" id="visibility-radio-password" value="password" <?php checked( $visibility, 'password' ); ?> /> <label for="visibility-radio-password" class="selectit"><?php _e('Password protected'); ?></label><br />
161 <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="255" /><br /></span>
162 <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 />
165 <a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a>
166 <a href="#visibility" class="cancel-post-visibility hide-if-no-js button-cancel"><?php _e('Cancel'); ?></a>
171 </div><!-- .misc-pub-section -->
174 /* translators: Publish box date format, see https://secure.php.net/date */
175 $datef = __( 'M j, Y @ H:i' );
176 if ( 0 != $post->ID ) {
177 if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
178 /* translators: Post date information. 1: Date on which the post is currently scheduled to be published */
179 $stamp = __('Scheduled for: <b>%1$s</b>');
180 } elseif ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published
181 /* translators: Post date information. 1: Date on which the post was published */
182 $stamp = __('Published on: <b>%1$s</b>');
183 } elseif ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
184 $stamp = __('Publish <b>immediately</b>');
185 } elseif ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified
186 /* translators: Post date information. 1: Date on which the post is to be published */
187 $stamp = __('Schedule for: <b>%1$s</b>');
188 } else { // draft, 1 or more saves, date specified
189 /* translators: Post date information. 1: Date on which the post is to be published */
190 $stamp = __('Publish on: <b>%1$s</b>');
192 $date = date_i18n( $datef, strtotime( $post->post_date ) );
193 } else { // draft (no saves, and thus no date specified)
194 $stamp = __('Publish <b>immediately</b>');
195 $date = date_i18n( $datef, strtotime( current_time('mysql') ) );
198 if ( ! empty( $args['args']['revisions_count'] ) ) : ?>
199 <div class="misc-pub-section misc-pub-revisions">
201 /* translators: Post revisions heading. 1: The number of available revisions */
202 printf( __( 'Revisions: %s' ), '<b>' . number_format_i18n( $args['args']['revisions_count'] ) . '</b>' );
204 <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>
208 if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
209 <div class="misc-pub-section curtime misc-pub-curtime">
210 <span id="timestamp">
211 <?php printf($stamp, $date); ?></span>
212 <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" role="button"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit date and time' ); ?></span></a>
213 <fieldset id="timestampdiv" class="hide-if-js">
214 <legend class="screen-reader-text"><?php _e( 'Date and time' ); ?></legend>
215 <?php touch_time( ( $action === 'edit' ), 1 ); ?>
217 </div><?php // /misc-pub-section ?>
222 * Fires after the post time/date setting in the Publish meta box.
225 * @since 4.4.0 Added the `$post` parameter.
227 * @param WP_Post $post WP_Post object for the current post.
229 do_action( 'post_submitbox_misc_actions', $post );
232 <div class="clear"></div>
235 <div id="major-publishing-actions">
238 * Fires at the beginning of the publishing actions section of the Publish meta box.
242 do_action( 'post_submitbox_start' );
244 <div id="delete-action">
246 if ( current_user_can( "delete_post", $post->ID ) ) {
247 if ( !EMPTY_TRASH_DAYS )
248 $delete_text = __('Delete Permanently');
250 $delete_text = __('Move to Trash');
252 <a class="submitdelete deletion" href="<?php echo get_delete_post_link($post->ID); ?>"><?php echo $delete_text; ?></a><?php
256 <div id="publishing-action">
257 <span class="spinner"></span>
259 if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) {
260 if ( $can_publish ) :
261 if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
262 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Schedule') ?>" />
263 <?php submit_button( __( 'Schedule' ), 'primary large', 'publish', false ); ?>
265 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Publish') ?>" />
266 <?php submit_button( __( 'Publish' ), 'primary large', 'publish', false ); ?>
269 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Submit for Review') ?>" />
270 <?php submit_button( __( 'Submit for Review' ), 'primary large', 'publish', false ); ?>
274 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update') ?>" />
275 <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update' ) ?>" />
279 <div class="clear"></div>
287 * Display attachment submit form fields.
291 * @param object $post
293 function attachment_submit_meta_box( $post ) {
295 <div class="submitbox" id="submitpost">
297 <div id="minor-publishing">
299 <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
300 <div style="display:none;">
301 <?php submit_button( __( 'Save' ), '', 'save' ); ?>
305 <div id="misc-publishing-actions">
307 /* translators: Publish box date format, see https://secure.php.net/date */
308 $datef = __( 'M j, Y @ H:i' );
309 /* translators: Attachment information. 1: Date the attachment was uploaded */
310 $stamp = __('Uploaded on: <b>%1$s</b>');
311 $date = date_i18n( $datef, strtotime( $post->post_date ) );
313 <div class="misc-pub-section curtime misc-pub-curtime">
314 <span id="timestamp"><?php printf($stamp, $date); ?></span>
315 </div><!-- .misc-pub-section -->
319 * Fires after the 'Uploaded on' section of the Save meta box
320 * in the attachment editing screen.
324 do_action( 'attachment_submitbox_misc_actions' );
326 </div><!-- #misc-publishing-actions -->
327 <div class="clear"></div>
328 </div><!-- #minor-publishing -->
330 <div id="major-publishing-actions">
331 <div id="delete-action">
333 if ( current_user_can( 'delete_post', $post->ID ) )
334 if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {
335 echo "<a class='submitdelete deletion' href='" . get_delete_post_link( $post->ID ) . "'>" . _x( 'Trash', 'verb' ) . "</a>";
337 $delete_ays = ! MEDIA_TRASH ? " onclick='return showNotice.warn();'" : '';
338 echo "<a class='submitdelete deletion'$delete_ays href='" . get_delete_post_link( $post->ID, null, true ) . "'>" . __( 'Delete Permanently' ) . "</a>";
343 <div id="publishing-action">
344 <span class="spinner"></span>
345 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update') ?>" />
346 <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update' ) ?>" />
348 <div class="clear"></div>
349 </div><!-- #major-publishing-actions -->
357 * Display post format form elements.
361 * @param WP_Post $post Post object.
362 * @param array $box {
363 * Post formats meta box arguments.
365 * @type string $id Meta box 'id' attribute.
366 * @type string $title Meta box title.
367 * @type callable $callback Meta box display callback.
368 * @type array $args Extra meta box arguments.
371 function post_format_meta_box( $post, $box ) {
372 if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) ) :
373 $post_formats = get_theme_support( 'post-formats' );
375 if ( is_array( $post_formats[0] ) ) :
376 $post_format = get_post_format( $post->ID );
379 // Add in the current one if it isn't there yet, in case the current theme doesn't support it
380 if ( $post_format && !in_array( $post_format, $post_formats[0] ) )
381 $post_formats[0][] = $post_format;
383 <div id="post-formats-select">
385 <legend class="screen-reader-text"><?php _e( 'Post Formats' ); ?></legend>
386 <input type="radio" name="post_format" class="post-format" id="post-format-0" value="0" <?php checked( $post_format, '0' ); ?> /> <label for="post-format-0" class="post-format-icon post-format-standard"><?php echo get_post_format_string( 'standard' ); ?></label>
387 <?php foreach ( $post_formats[0] as $format ) : ?>
388 <br /><input type="radio" name="post_format" class="post-format" id="post-format-<?php echo esc_attr( $format ); ?>" value="<?php echo esc_attr( $format ); ?>" <?php checked( $post_format, $format ); ?> /> <label for="post-format-<?php echo esc_attr( $format ); ?>" class="post-format-icon post-format-<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></label>
396 * Display post tags form fields.
400 * @todo Create taxonomy-agnostic wrapper for this.
402 * @param WP_Post $post Post object.
403 * @param array $box {
404 * Tags meta box arguments.
406 * @type string $id Meta box 'id' attribute.
407 * @type string $title Meta box title.
408 * @type callable $callback Meta box display callback.
409 * @type array $args {
410 * Extra meta box arguments.
412 * @type string $taxonomy Taxonomy. Default 'post_tag'.
416 function post_tags_meta_box( $post, $box ) {
417 $defaults = array( 'taxonomy' => 'post_tag' );
418 if ( ! isset( $box['args'] ) || ! is_array( $box['args'] ) ) {
421 $args = $box['args'];
423 $r = wp_parse_args( $args, $defaults );
424 $tax_name = esc_attr( $r['taxonomy'] );
425 $taxonomy = get_taxonomy( $r['taxonomy'] );
426 $user_can_assign_terms = current_user_can( $taxonomy->cap->assign_terms );
427 $comma = _x( ',', 'tag delimiter' );
428 $terms_to_edit = get_terms_to_edit( $post->ID, $tax_name );
429 if ( ! is_string( $terms_to_edit ) ) {
433 <div class="tagsdiv" id="<?php echo $tax_name; ?>">
435 <div class="nojs-tags hide-if-js">
436 <label for="tax-input-<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->add_or_remove_items; ?></label>
437 <p><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 ); ?> aria-describedby="new-tag-<?php echo $tax_name; ?>-desc"><?php echo str_replace( ',', $comma . ' ', $terms_to_edit ); // textarea_escaped by esc_attr() ?></textarea></p>
439 <?php if ( $user_can_assign_terms ) : ?>
440 <div class="ajaxtag hide-if-no-js">
441 <label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->add_new_item; ?></label>
442 <p><input data-wp-taxonomy="<?php echo $tax_name; ?>" type="text" id="new-tag-<?php echo $tax_name; ?>" name="newtag[<?php echo $tax_name; ?>]" class="newtag form-input-tip" size="16" autocomplete="off" aria-describedby="new-tag-<?php echo $tax_name; ?>-desc" value="" />
443 <input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" /></p>
445 <p class="howto" id="new-tag-<?php echo $tax_name; ?>-desc"><?php echo $taxonomy->labels->separate_items_with_commas; ?></p>
446 <?php elseif ( empty( $terms_to_edit ) ): ?>
447 <p><?php echo $taxonomy->labels->no_terms; ?></p>
450 <div class="tagchecklist"></div>
452 <?php if ( $user_can_assign_terms ) : ?>
453 <p class="hide-if-no-js"><button type="button" class="button-link tagcloud-link" id="link-<?php echo $tax_name; ?>" aria-expanded="false"><?php echo $taxonomy->labels->choose_from_most_used; ?></button></p>
459 * Display post categories form fields.
463 * @todo Create taxonomy-agnostic wrapper for this.
465 * @param WP_Post $post Post object.
466 * @param array $box {
467 * Categories meta box arguments.
469 * @type string $id Meta box 'id' attribute.
470 * @type string $title Meta box title.
471 * @type callable $callback Meta box display callback.
472 * @type array $args {
473 * Extra meta box arguments.
475 * @type string $taxonomy Taxonomy. Default 'category'.
479 function post_categories_meta_box( $post, $box ) {
480 $defaults = array( 'taxonomy' => 'category' );
481 if ( ! isset( $box['args'] ) || ! is_array( $box['args'] ) ) {
484 $args = $box['args'];
486 $r = wp_parse_args( $args, $defaults );
487 $tax_name = esc_attr( $r['taxonomy'] );
488 $taxonomy = get_taxonomy( $r['taxonomy'] );
490 <div id="taxonomy-<?php echo $tax_name; ?>" class="categorydiv">
491 <ul id="<?php echo $tax_name; ?>-tabs" class="category-tabs">
492 <li class="tabs"><a href="#<?php echo $tax_name; ?>-all"><?php echo $taxonomy->labels->all_items; ?></a></li>
493 <li class="hide-if-no-js"><a href="#<?php echo $tax_name; ?>-pop"><?php _e( 'Most Used' ); ?></a></li>
496 <div id="<?php echo $tax_name; ?>-pop" class="tabs-panel" style="display: none;">
497 <ul id="<?php echo $tax_name; ?>checklist-pop" class="categorychecklist form-no-clear" >
498 <?php $popular_ids = wp_popular_terms_checklist( $tax_name ); ?>
502 <div id="<?php echo $tax_name; ?>-all" class="tabs-panel">
504 $name = ( $tax_name == 'category' ) ? 'post_category' : 'tax_input[' . $tax_name . ']';
505 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.
507 <ul id="<?php echo $tax_name; ?>checklist" data-wp-lists="list:<?php echo $tax_name; ?>" class="categorychecklist form-no-clear">
508 <?php wp_terms_checklist( $post->ID, array( 'taxonomy' => $tax_name, 'popular_cats' => $popular_ids ) ); ?>
511 <?php if ( current_user_can( $taxonomy->cap->edit_terms ) ) : ?>
512 <div id="<?php echo $tax_name; ?>-adder" class="wp-hidden-children">
513 <a id="<?php echo $tax_name; ?>-add-toggle" href="#<?php echo $tax_name; ?>-add" class="hide-if-no-js taxonomy-add-new">
515 /* translators: %s: add new taxonomy label */
516 printf( __( '+ %s' ), $taxonomy->labels->add_new_item );
519 <p id="<?php echo $tax_name; ?>-add" class="category-add wp-hidden-child">
520 <label class="screen-reader-text" for="new<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->add_new_item; ?></label>
521 <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"/>
522 <label class="screen-reader-text" for="new<?php echo $tax_name; ?>_parent">
523 <?php echo $taxonomy->labels->parent_item_colon; ?>
526 $parent_dropdown_args = array(
527 'taxonomy' => $tax_name,
529 'name' => 'new' . $tax_name . '_parent',
532 'show_option_none' => '— ' . $taxonomy->labels->parent_item . ' —',
536 * Filters the arguments for the taxonomy parent dropdown on the Post Edit page.
540 * @param array $parent_dropdown_args {
541 * Optional. Array of arguments to generate parent dropdown.
543 * @type string $taxonomy Name of the taxonomy to retrieve.
544 * @type bool $hide_if_empty True to skip generating markup if no
545 * categories are found. Default 0.
546 * @type string $name Value for the 'name' attribute
547 * of the select element.
548 * Default "new{$tax_name}_parent".
549 * @type string $orderby Which column to use for ordering
550 * terms. Default 'name'.
551 * @type bool|int $hierarchical Whether to traverse the taxonomy
552 * hierarchy. Default 1.
553 * @type string $show_option_none Text to display for the "none" option.
554 * Default "— {$parent} —",
555 * where `$parent` is 'parent_item'
559 $parent_dropdown_args = apply_filters( 'post_edit_category_parent_dropdown_args', $parent_dropdown_args );
561 wp_dropdown_categories( $parent_dropdown_args );
563 <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 ); ?>" />
564 <?php wp_nonce_field( 'add-' . $tax_name, '_ajax_nonce-add-' . $tax_name, false ); ?>
565 <span id="<?php echo $tax_name; ?>-ajax-response"></span>
574 * Display post excerpt form fields.
578 * @param object $post
580 function post_excerpt_meta_box($post) {
582 <label class="screen-reader-text" for="excerpt"><?php _e('Excerpt') ?></label><textarea rows="1" cols="40" name="excerpt" id="excerpt"><?php echo $post->post_excerpt; // textarea_escaped ?></textarea>
585 /* translators: %s: Codex URL */
586 __( 'Excerpts are optional hand-crafted summaries of your content that can be used in your theme. <a href="%s">Learn more about manual excerpts</a>.' ),
587 __( 'https://codex.wordpress.org/Excerpt' )
594 * Display trackback links form fields.
598 * @param object $post
600 function post_trackback_meta_box($post) {
601 $form_trackback = '<input type="text" name="trackback_url" id="trackback_url" class="code" value="' .
602 esc_attr( str_replace( "\n", ' ', $post->to_ping ) ) . '" aria-describedby="trackback-url-desc" />';
603 if ('' != $post->pinged) {
604 $pings = '<p>'. __('Already pinged:') . '</p><ul>';
605 $already_pinged = explode("\n", trim($post->pinged));
606 foreach ($already_pinged as $pinged_url) {
607 $pings .= "\n\t<li>" . esc_html($pinged_url) . "</li>";
614 <label for="trackback_url"><?php _e( 'Send trackbacks to:' ); ?></label>
615 <?php echo $form_trackback; ?>
617 <p id="trackback-url-desc" class="howto"><?php _e( 'Separate multiple URLs with spaces' ); ?></p>
620 /* translators: %s: Codex URL */
621 __( 'Trackbacks are a way to notify legacy blog systems that you’ve linked to them. If you link other WordPress sites, they’ll be notified automatically using <a href="%s">pingbacks</a>, no other action necessary.' ),
622 __( 'https://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments' )
626 if ( ! empty($pings) )
631 * Display custom fields form fields.
635 * @param object $post
637 function post_custom_meta_box($post) {
639 <div id="postcustomstuff">
640 <div id="ajax-response"></div>
642 $metadata = has_meta($post->ID);
643 foreach ( $metadata as $key => $value ) {
644 if ( is_protected_meta( $metadata[ $key ][ 'meta_key' ], 'post' ) || ! current_user_can( 'edit_post_meta', $post->ID, $metadata[ $key ][ 'meta_key' ] ) )
645 unset( $metadata[ $key ] );
647 list_meta( $metadata );
648 meta_form( $post ); ?>
652 /* translators: %s: Codex URL */
653 __( 'Custom fields can be used to add extra metadata to a post that you can <a href="%s">use in your theme</a>.' ),
654 __( 'https://codex.wordpress.org/Using_Custom_Fields' )
661 * Display comments status form fields.
665 * @param object $post
667 function post_comment_status_meta_box($post) {
669 <input name="advanced_view" type="hidden" value="1" />
670 <p class="meta-options">
671 <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 />
672 <label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php
674 /* translators: %s: Codex URL */
675 __( 'Allow <a href="%s">trackbacks and pingbacks</a> on this page.' ),
676 __( 'https://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments' ) );
680 * Fires at the end of the Discussion meta box on the post editing screen.
684 * @param WP_Post $post WP_Post object of the current post.
686 do_action( 'post_comment_status_meta_box-options', $post );
693 * Display comments for post table header
697 * @param array $result table header rows
700 function post_comment_meta_box_thead($result) {
701 unset($result['cb'], $result['response']);
706 * Display comments for post.
710 * @param object $post
712 function post_comment_meta_box( $post ) {
713 wp_nonce_field( 'get-comments', 'add_comment_nonce', false );
715 <p class="hide-if-no-js" id="add-new-comment"><a class="button" href="#commentstatusdiv" onclick="window.commentReply && commentReply.addcomment(<?php echo $post->ID; ?>);return false;"><?php _e('Add comment'); ?></a></p>
718 $total = get_comments( array( 'post_id' => $post->ID, 'number' => 1, 'count' => true ) );
719 $wp_list_table = _get_list_table('WP_Post_Comments_List_Table');
720 $wp_list_table->display( true );
723 echo '<p id="no-comments">' . __('No comments yet.') . '</p>';
725 $hidden = get_hidden_meta_boxes( get_current_screen() );
726 if ( ! in_array('commentsdiv', $hidden) ) {
728 <script type="text/javascript">jQuery(document).ready(function(){commentsBox.get(<?php echo $total; ?>, 10);});</script>
733 <p class="hide-if-no-js" id="show-comments"><a href="#commentstatusdiv" onclick="commentsBox.load(<?php echo $total; ?>);return false;"><?php _e('Show comments'); ?></a> <span class="spinner"></span></p>
737 wp_comment_trashnotice();
741 * Display slug form fields.
745 * @param object $post
747 function post_slug_meta_box($post) {
748 /** This filter is documented in wp-admin/edit-tag-form.php */
749 $editable_slug = apply_filters( 'editable_slug', $post->post_name, $post );
751 <label class="screen-reader-text" for="post_name"><?php _e('Slug') ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo esc_attr( $editable_slug ); ?>" />
756 * Display form field with list of authors.
760 * @global int $user_ID
762 * @param object $post
764 function post_author_meta_box($post) {
767 <label class="screen-reader-text" for="post_author_override"><?php _e('Author'); ?></label>
769 wp_dropdown_users( array(
771 'name' => 'post_author_override',
772 'selected' => empty($post->ID) ? $user_ID : $post->post_author,
773 'include_selected' => true,
774 'show' => 'display_name_with_login',
779 * Display list of revisions.
783 * @param object $post
785 function post_revisions_meta_box( $post ) {
786 wp_list_post_revisions( $post );
789 // -- Page related Meta Boxes
792 * Display page attributes form fields.
796 * @param object $post
798 function page_attributes_meta_box($post) {
799 if ( is_post_type_hierarchical( $post->post_type ) ) :
800 $dropdown_args = array(
801 'post_type' => $post->post_type,
802 'exclude_tree' => $post->ID,
803 'selected' => $post->post_parent,
804 'name' => 'parent_id',
805 'show_option_none' => __('(no parent)'),
806 'sort_column' => 'menu_order, post_title',
811 * Filters the arguments used to generate a Pages drop-down element.
815 * @see wp_dropdown_pages()
817 * @param array $dropdown_args Array of arguments used to generate the pages drop-down.
818 * @param WP_Post $post The current WP_Post object.
820 $dropdown_args = apply_filters( 'page_attributes_dropdown_pages_args', $dropdown_args, $post );
821 $pages = wp_dropdown_pages( $dropdown_args );
822 if ( ! empty($pages) ) :
824 <p class="post-attributes-label-wrapper"><label class="post-attributes-label" for="parent_id"><?php _e( 'Parent' ); ?></label></p>
825 <?php echo $pages; ?>
827 endif; // end empty pages check
828 endif; // end hierarchical check.
830 if ( count( get_page_templates( $post ) ) > 0 && get_option( 'page_for_posts' ) != $post->ID ) :
831 $template = ! empty( $post->page_template ) ? $post->page_template : false;
833 <p class="post-attributes-label-wrapper"><label class="post-attributes-label" for="page_template"><?php _e( 'Template' ); ?></label><?php
835 * Fires immediately after the label inside the 'Template' section
836 * of the 'Page Attributes' meta box.
840 * @param string $template The template used for the current post.
841 * @param WP_Post $post The current post.
843 do_action( 'page_attributes_meta_box_template', $template, $post );
845 <select name="page_template" id="page_template">
848 * Filters the title of the default page template displayed in the drop-down.
852 * @param string $label The display value for the default page template title.
853 * @param string $context Where the option label is displayed. Possible values
854 * include 'meta-box' or 'quick-edit'.
856 $default_title = apply_filters( 'default_page_template_title', __( 'Default Template' ), 'meta-box' );
858 <option value="default"><?php echo esc_html( $default_title ); ?></option>
859 <?php page_template_dropdown( $template, $post->post_type ); ?>
862 <?php if ( post_type_supports( $post->post_type, 'page-attributes' ) ) : ?>
863 <p class="post-attributes-label-wrapper"><label class="post-attributes-label" for="menu_order"><?php _e( 'Order' ); ?></label></p>
864 <input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo esc_attr( $post->menu_order ); ?>" />
865 <?php if ( 'page' == $post->post_type && get_current_screen()->get_help_tabs() ) : ?>
866 <p><?php _e( 'Need help? Use the Help tab above the screen title.' ); ?></p>
871 // -- Link related Meta Boxes
874 * Display link create form fields.
878 * @param object $link
880 function link_submit_meta_box($link) {
882 <div class="submitbox" id="submitlink">
884 <div id="minor-publishing">
886 <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
887 <div style="display:none;">
888 <?php submit_button( __( 'Save' ), '', 'save', false ); ?>
891 <div id="minor-publishing-actions">
892 <div id="preview-action">
893 <?php if ( !empty($link->link_id) ) { ?>
894 <a class="preview button" href="<?php echo $link->link_url; ?>" target="_blank"><?php _e('Visit Link'); ?></a>
897 <div class="clear"></div>
900 <div id="misc-publishing-actions">
901 <div class="misc-pub-section misc-pub-private">
902 <label for="link_private" class="selectit"><input id="link_private" name="link_visible" type="checkbox" value="N" <?php checked($link->link_visible, 'N'); ?> /> <?php _e('Keep this link private') ?></label>
908 <div id="major-publishing-actions">
910 /** This action is documented in wp-admin/includes/meta-boxes.php */
911 do_action( 'post_submitbox_start' );
913 <div id="delete-action">
915 if ( !empty($_GET['action']) && 'edit' == $_GET['action'] && current_user_can('manage_links') ) { ?>
916 <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>
920 <div id="publishing-action">
921 <?php if ( !empty($link->link_id) ) { ?>
922 <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update Link' ) ?>" />
924 <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Add Link' ) ?>" />
927 <div class="clear"></div>
931 * Fires at the end of the Publish box in the Link editing screen.
935 do_action( 'submitlink_box' );
937 <div class="clear"></div>
943 * Display link categories form fields.
947 * @param object $link
949 function link_categories_meta_box($link) {
951 <div id="taxonomy-linkcategory" class="categorydiv">
952 <ul id="category-tabs" class="category-tabs">
953 <li class="tabs"><a href="#categories-all"><?php _e( 'All Categories' ); ?></a></li>
954 <li class="hide-if-no-js"><a href="#categories-pop"><?php _e( 'Most Used' ); ?></a></li>
957 <div id="categories-all" class="tabs-panel">
958 <ul id="categorychecklist" data-wp-lists="list:category" class="categorychecklist form-no-clear">
960 if ( isset($link->link_id) )
961 wp_link_category_checklist($link->link_id);
963 wp_link_category_checklist();
968 <div id="categories-pop" class="tabs-panel" style="display: none;">
969 <ul id="categorychecklist-pop" class="categorychecklist form-no-clear">
970 <?php wp_popular_terms_checklist('link_category'); ?>
974 <div id="category-adder" class="wp-hidden-children">
975 <a id="category-add-toggle" href="#category-add" class="taxonomy-add-new"><?php _e( '+ Add New Category' ); ?></a>
976 <p id="link-category-add" class="wp-hidden-child">
977 <label class="screen-reader-text" for="newcat"><?php _e( '+ Add New Category' ); ?></label>
978 <input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php esc_attr_e( 'New category name' ); ?>" aria-required="true" />
979 <input type="button" id="link-category-add-submit" data-wp-lists="add:categorychecklist:link-category-add" class="button" value="<?php esc_attr_e( 'Add' ); ?>" />
980 <?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?>
981 <span id="category-ajax-response"></span>
989 * Display form fields for changing link target.
993 * @param object $link
995 function link_target_meta_box($link) { ?>
996 <fieldset><legend class="screen-reader-text"><span><?php _e('Target') ?></span></legend>
997 <p><label for="link_target_blank" class="selectit">
998 <input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo ( isset( $link->link_target ) && ($link->link_target == '_blank') ? 'checked="checked"' : ''); ?> />
999 <?php _e('<code>_blank</code> — new window or tab.'); ?></label></p>
1000 <p><label for="link_target_top" class="selectit">
1001 <input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo ( isset( $link->link_target ) && ($link->link_target == '_top') ? 'checked="checked"' : ''); ?> />
1002 <?php _e('<code>_top</code> — current window or tab, with no frames.'); ?></label></p>
1003 <p><label for="link_target_none" class="selectit">
1004 <input id="link_target_none" type="radio" name="link_target" value="" <?php echo ( isset( $link->link_target ) && ($link->link_target == '') ? 'checked="checked"' : ''); ?> />
1005 <?php _e('<code>_none</code> — same window or tab.'); ?></label></p>
1007 <p><?php _e('Choose the target frame for your link.'); ?></p>
1012 * Display checked checkboxes attribute for xfn microformat options.
1016 * @global object $link
1018 * @param string $class
1019 * @param string $value
1020 * @param mixed $deprecated Never used.
1022 function xfn_check( $class, $value = '', $deprecated = '' ) {
1025 if ( !empty( $deprecated ) )
1026 _deprecated_argument( __FUNCTION__, '0.0.0' ); // Never implemented
1028 $link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: '';
1029 $rels = preg_split('/\s+/', $link_rel);
1031 if ('' != $value && in_array($value, $rels) ) {
1032 echo ' checked="checked"';
1036 if ('family' == $class && strpos($link_rel, 'child') === false && strpos($link_rel, 'parent') === false && strpos($link_rel, 'sibling') === false && strpos($link_rel, 'spouse') === false && strpos($link_rel, 'kin') === false) echo ' checked="checked"';
1037 if ('friendship' == $class && strpos($link_rel, 'friend') === false && strpos($link_rel, 'acquaintance') === false && strpos($link_rel, 'contact') === false) echo ' checked="checked"';
1038 if ('geographical' == $class && strpos($link_rel, 'co-resident') === false && strpos($link_rel, 'neighbor') === false) echo ' checked="checked"';
1039 if ('identity' == $class && in_array('me', $rels) ) echo ' checked="checked"';
1044 * Display xfn form fields.
1048 * @param object $link
1050 function link_xfn_meta_box($link) {
1052 <table class="links-table">
1054 <th scope="row"><label for="link_rel"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('rel:') ?></label></th>
1055 <td><input type="text" name="link_rel" id="link_rel" value="<?php echo ( isset( $link->link_rel ) ? esc_attr($link->link_rel) : ''); ?>" /></td>
1058 <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('identity') ?></th>
1059 <td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('identity') ?></span></legend>
1061 <input type="checkbox" name="identity" value="me" id="me" <?php xfn_check('identity', 'me'); ?> />
1062 <?php _e('another web address of mine') ?></label>
1066 <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friendship') ?></th>
1067 <td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friendship') ?></span></legend>
1068 <label for="contact">
1069 <input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check('friendship', 'contact'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('contact') ?>
1071 <label for="acquaintance">
1072 <input class="valinp" type="radio" name="friendship" value="acquaintance" id="acquaintance" <?php xfn_check('friendship', 'acquaintance'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('acquaintance') ?>
1074 <label for="friend">
1075 <input class="valinp" type="radio" name="friendship" value="friend" id="friend" <?php xfn_check('friendship', 'friend'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friend') ?>
1077 <label for="friendship">
1078 <input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check('friendship'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?>
1083 <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('physical') ?> </th>
1084 <td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('physical') ?></span></legend>
1086 <input class="valinp" type="checkbox" name="physical" value="met" id="met" <?php xfn_check('physical', 'met'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('met') ?>
1091 <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('professional') ?> </th>
1092 <td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('professional') ?></span></legend>
1093 <label for="co-worker">
1094 <input class="valinp" type="checkbox" name="professional" value="co-worker" id="co-worker" <?php xfn_check('professional', 'co-worker'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('co-worker') ?>
1096 <label for="colleague">
1097 <input class="valinp" type="checkbox" name="professional" value="colleague" id="colleague" <?php xfn_check('professional', 'colleague'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('colleague') ?>
1102 <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('geographical') ?></th>
1103 <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('geographical') ?> </span></legend>
1104 <label for="co-resident">
1105 <input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check('geographical', 'co-resident'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('co-resident') ?>
1107 <label for="neighbor">
1108 <input class="valinp" type="radio" name="geographical" value="neighbor" id="neighbor" <?php xfn_check('geographical', 'neighbor'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('neighbor') ?>
1110 <label for="geographical">
1111 <input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check('geographical'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?>
1116 <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('family') ?></th>
1117 <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('family') ?> </span></legend>
1119 <input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check('family', 'child'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('child') ?>
1122 <input class="valinp" type="radio" name="family" value="kin" id="kin" <?php xfn_check('family', 'kin'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('kin') ?>
1124 <label for="parent">
1125 <input class="valinp" type="radio" name="family" value="parent" id="parent" <?php xfn_check('family', 'parent'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('parent') ?>
1127 <label for="sibling">
1128 <input class="valinp" type="radio" name="family" value="sibling" id="sibling" <?php xfn_check('family', 'sibling'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('sibling') ?>
1130 <label for="spouse">
1131 <input class="valinp" type="radio" name="family" value="spouse" id="spouse" <?php xfn_check('family', 'spouse'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('spouse') ?>
1133 <label for="family">
1134 <input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check('family'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?>
1139 <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('romantic') ?></th>
1140 <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('romantic') ?> </span></legend>
1142 <input class="valinp" type="checkbox" name="romantic" value="muse" id="muse" <?php xfn_check('romantic', 'muse'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('muse') ?>
1145 <input class="valinp" type="checkbox" name="romantic" value="crush" id="crush" <?php xfn_check('romantic', 'crush'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('crush') ?>
1148 <input class="valinp" type="checkbox" name="romantic" value="date" id="date" <?php xfn_check('romantic', 'date'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('date') ?>
1150 <label for="romantic">
1151 <input class="valinp" type="checkbox" name="romantic" value="sweetheart" id="romantic" <?php xfn_check('romantic', 'sweetheart'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('sweetheart') ?>
1157 <p><?php _e('If the link is to a person, you can specify your relationship with them using the above form. If you would like to learn more about the idea check out <a href="http://gmpg.org/xfn/">XFN</a>.'); ?></p>
1162 * Display advanced link options form fields.
1166 * @param object $link
1168 function link_advanced_meta_box($link) {
1170 <table class="links-table" cellpadding="0">
1172 <th scope="row"><label for="link_image"><?php _e('Image Address') ?></label></th>
1173 <td><input type="text" name="link_image" class="code" id="link_image" maxlength="255" value="<?php echo ( isset( $link->link_image ) ? esc_attr($link->link_image) : ''); ?>" /></td>
1176 <th scope="row"><label for="rss_uri"><?php _e('RSS Address') ?></label></th>
1177 <td><input name="link_rss" class="code" type="text" id="rss_uri" maxlength="255" value="<?php echo ( isset( $link->link_rss ) ? esc_attr($link->link_rss) : ''); ?>" /></td>
1180 <th scope="row"><label for="link_notes"><?php _e('Notes') ?></label></th>
1181 <td><textarea name="link_notes" id="link_notes" rows="10"><?php echo ( isset( $link->link_notes ) ? $link->link_notes : ''); // textarea_escaped ?></textarea></td>
1184 <th scope="row"><label for="link_rating"><?php _e('Rating') ?></label></th>
1185 <td><select name="link_rating" id="link_rating" size="1">
1187 for ( $r = 0; $r <= 10; $r++ ) {
1188 echo '<option value="' . $r . '"';
1189 if ( isset($link->link_rating) && $link->link_rating == $r )
1190 echo ' selected="selected"';
1191 echo('>' . $r . '</option>');
1193 ?></select> <?php _e('(Leave at 0 for no rating.)') ?>
1201 * Display post thumbnail meta box.
1205 * @param WP_Post $post A post object.
1207 function post_thumbnail_meta_box( $post ) {
1208 $thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true );
1209 echo _wp_post_thumbnail_html( $thumbnail_id, $post->ID );
1213 * Display fields for ID3 data
1217 * @param WP_Post $post A post object.
1219 function attachment_id3_data_meta_box( $post ) {
1221 if ( ! empty( $post->ID ) ) {
1222 $meta = wp_get_attachment_metadata( $post->ID );
1225 foreach ( wp_get_attachment_id3_keys( $post, 'edit' ) as $key => $label ) : ?>
1227 <label for="title"><?php echo $label ?></label><br />
1228 <input type="text" name="id3_<?php echo esc_attr( $key ) ?>" id="id3_<?php echo esc_attr( $key ) ?>" class="large-text" value="<?php
1229 if ( ! empty( $meta[ $key ] ) ) {
1230 echo esc_attr( $meta[ $key ] );