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.
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' ), 'button', '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"><label for="post_status"><?php _e('Status:') ?></label>
78 <span id="post-status-display">
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"><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 <select name='post_status' id='post_status'>
106 <?php if ( 'publish' == $post->post_status ) : ?>
107 <option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e('Published') ?></option>
108 <?php elseif ( 'private' == $post->post_status ) : ?>
109 <option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e('Privately Published') ?></option>
110 <?php elseif ( 'future' == $post->post_status ) : ?>
111 <option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option>
113 <option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option>
114 <?php if ( 'auto-draft' == $post->post_status ) : ?>
115 <option<?php selected( $post->post_status, 'auto-draft' ); ?> value='draft'><?php _e('Draft') ?></option>
117 <option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft') ?></option>
120 <a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a>
121 <a href="#post_status" class="cancel-post-status hide-if-no-js button-cancel"><?php _e('Cancel'); ?></a>
125 </div><!-- .misc-pub-section -->
127 <div class="misc-pub-section misc-pub-visibility" id="visibility">
128 <?php _e('Visibility:'); ?> <span id="post-visibility-display"><?php
130 if ( 'private' == $post->post_status ) {
131 $post->post_password = '';
132 $visibility = 'private';
133 $visibility_trans = __('Private');
134 } elseif ( !empty( $post->post_password ) ) {
135 $visibility = 'password';
136 $visibility_trans = __('Password protected');
137 } elseif ( $post_type == 'post' && is_sticky( $post->ID ) ) {
138 $visibility = 'public';
139 $visibility_trans = __('Public, Sticky');
141 $visibility = 'public';
142 $visibility_trans = __('Public');
145 echo esc_html( $visibility_trans ); ?></span>
146 <?php if ( $can_publish ) { ?>
147 <a href="#visibility" class="edit-visibility hide-if-no-js"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit visibility' ); ?></span></a>
149 <div id="post-visibility-select" class="hide-if-js">
150 <input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo esc_attr($post->post_password); ?>" />
151 <?php if ($post_type == 'post'): ?>
152 <input type="checkbox" style="display:none" name="hidden_post_sticky" id="hidden-post-sticky" value="sticky" <?php checked(is_sticky($post->ID)); ?> />
154 <input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo esc_attr( $visibility ); ?>" />
155 <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 />
156 <?php if ( $post_type == 'post' && current_user_can( 'edit_others_posts' ) ) : ?>
157 <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>
159 <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 />
160 <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>
161 <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 />
164 <a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a>
165 <a href="#visibility" class="cancel-post-visibility hide-if-no-js button-cancel"><?php _e('Cancel'); ?></a>
170 </div><!-- .misc-pub-section -->
173 /* translators: Publish box date format, see http://php.net/date */
174 $datef = __( 'M j, Y @ H:i' );
175 if ( 0 != $post->ID ) {
176 if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
177 $stamp = __('Scheduled for: <b>%1$s</b>');
178 } elseif ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published
179 $stamp = __('Published on: <b>%1$s</b>');
180 } elseif ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
181 $stamp = __('Publish <b>immediately</b>');
182 } elseif ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified
183 $stamp = __('Schedule for: <b>%1$s</b>');
184 } else { // draft, 1 or more saves, date specified
185 $stamp = __('Publish on: <b>%1$s</b>');
187 $date = date_i18n( $datef, strtotime( $post->post_date ) );
188 } else { // draft (no saves, and thus no date specified)
189 $stamp = __('Publish <b>immediately</b>');
190 $date = date_i18n( $datef, strtotime( current_time('mysql') ) );
193 if ( ! empty( $args['args']['revisions_count'] ) ) :
194 $revisions_to_keep = wp_revisions_to_keep( $post );
196 <div class="misc-pub-section misc-pub-revisions">
198 if ( $revisions_to_keep > 0 && $revisions_to_keep <= $args['args']['revisions_count'] ) {
199 echo '<span title="' . esc_attr( sprintf( __( 'Your site is configured to keep only the last %s revisions.' ),
200 number_format_i18n( $revisions_to_keep ) ) ) . '">';
201 printf( __( 'Revisions: %s' ), '<b>' . number_format_i18n( $args['args']['revisions_count'] ) . '+</b>' );
204 printf( __( 'Revisions: %s' ), '<b>' . number_format_i18n( $args['args']['revisions_count'] ) . '</b>' );
207 <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>
211 if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
212 <div class="misc-pub-section curtime misc-pub-curtime">
213 <span id="timestamp">
214 <?php printf($stamp, $date); ?></span>
215 <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>
216 <fieldset id="timestampdiv" class="hide-if-js">
217 <legend class="screen-reader-text"><?php _e( 'Date and time' ); ?></legend>
218 <?php touch_time( ( $action === 'edit' ), 1 ); ?>
220 </div><?php // /misc-pub-section ?>
225 * Fires after the post time/date setting in the Publish meta box.
228 * @since 4.4.0 Added the `$post` parameter.
230 * @param WP_Post $post WP_Post object for the current post.
232 do_action( 'post_submitbox_misc_actions', $post );
235 <div class="clear"></div>
238 <div id="major-publishing-actions">
241 * Fires at the beginning of the publishing actions section of the Publish meta box.
245 do_action( 'post_submitbox_start' );
247 <div id="delete-action">
249 if ( current_user_can( "delete_post", $post->ID ) ) {
250 if ( !EMPTY_TRASH_DAYS )
251 $delete_text = __('Delete Permanently');
253 $delete_text = __('Move to Trash');
255 <a class="submitdelete deletion" href="<?php echo get_delete_post_link($post->ID); ?>"><?php echo $delete_text; ?></a><?php
259 <div id="publishing-action">
260 <span class="spinner"></span>
262 if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) {
263 if ( $can_publish ) :
264 if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
265 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Schedule') ?>" />
266 <?php submit_button( __( 'Schedule' ), 'primary button-large', 'publish', false ); ?>
268 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Publish') ?>" />
269 <?php submit_button( __( 'Publish' ), 'primary button-large', 'publish', false ); ?>
272 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Submit for Review') ?>" />
273 <?php submit_button( __( 'Submit for Review' ), 'primary button-large', 'publish', false ); ?>
277 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update') ?>" />
278 <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update' ) ?>" />
282 <div class="clear"></div>
290 * Display attachment submit form fields.
294 * @param object $post
296 function attachment_submit_meta_box( $post ) {
298 <div class="submitbox" id="submitpost">
300 <div id="minor-publishing">
302 <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
303 <div style="display:none;">
304 <?php submit_button( __( 'Save' ), 'button', 'save' ); ?>
308 <div id="misc-publishing-actions">
310 /* translators: Publish box date format, see http://php.net/date */
311 $datef = __( 'M j, Y @ H:i' );
312 $stamp = __('Uploaded on: <b>%1$s</b>');
313 $date = date_i18n( $datef, strtotime( $post->post_date ) );
315 <div class="misc-pub-section curtime misc-pub-curtime">
316 <span id="timestamp"><?php printf($stamp, $date); ?></span>
317 </div><!-- .misc-pub-section -->
321 * Fires after the 'Uploaded on' section of the Save meta box
322 * in the attachment editing screen.
326 do_action( 'attachment_submitbox_misc_actions' );
328 </div><!-- #misc-publishing-actions -->
329 <div class="clear"></div>
330 </div><!-- #minor-publishing -->
332 <div id="major-publishing-actions">
333 <div id="delete-action">
335 if ( current_user_can( 'delete_post', $post->ID ) )
336 if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {
337 echo "<a class='submitdelete deletion' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Trash' ) . "</a>";
339 $delete_ays = ! MEDIA_TRASH ? " onclick='return showNotice.warn();'" : '';
340 echo "<a class='submitdelete deletion'$delete_ays href='" . get_delete_post_link( $post->ID, null, true ) . "'>" . __( 'Delete Permanently' ) . "</a>";
345 <div id="publishing-action">
346 <span class="spinner"></span>
347 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update') ?>" />
348 <input name="save" type="submit" class="button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update' ) ?>" />
350 <div class="clear"></div>
351 </div><!-- #major-publishing-actions -->
359 * Display post format form elements.
363 * @param WP_Post $post Post object.
364 * @param array $box {
365 * Post formats meta box arguments.
367 * @type string $id Meta box ID.
368 * @type string $title Meta box title.
369 * @type callable $callback Meta box display callback.
370 * @type array $args Extra meta box arguments.
373 function post_format_meta_box( $post, $box ) {
374 if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) ) :
375 $post_formats = get_theme_support( 'post-formats' );
377 if ( is_array( $post_formats[0] ) ) :
378 $post_format = get_post_format( $post->ID );
381 // Add in the current one if it isn't there yet, in case the current theme doesn't support it
382 if ( $post_format && !in_array( $post_format, $post_formats[0] ) )
383 $post_formats[0][] = $post_format;
385 <div id="post-formats-select">
387 <legend class="screen-reader-text"><?php _e( 'Post Formats' ); ?></legend>
388 <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>
389 <?php foreach ( $post_formats[0] as $format ) : ?>
390 <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>
398 * Display post tags form fields.
402 * @todo Create taxonomy-agnostic wrapper for this.
404 * @param WP_Post $post Post object.
405 * @param array $box {
406 * Tags meta box arguments.
408 * @type string $id Meta box ID.
409 * @type string $title Meta box title.
410 * @type callable $callback Meta box display callback.
411 * @type array $args {
412 * Extra meta box arguments.
414 * @type string $taxonomy Taxonomy. Default 'post_tag'.
418 function post_tags_meta_box( $post, $box ) {
419 $defaults = array( 'taxonomy' => 'post_tag' );
420 if ( ! isset( $box['args'] ) || ! is_array( $box['args'] ) ) {
423 $args = $box['args'];
425 $r = wp_parse_args( $args, $defaults );
426 $tax_name = esc_attr( $r['taxonomy'] );
427 $taxonomy = get_taxonomy( $r['taxonomy'] );
428 $user_can_assign_terms = current_user_can( $taxonomy->cap->assign_terms );
429 $comma = _x( ',', 'tag delimiter' );
430 $terms_to_edit = get_terms_to_edit( $post->ID, $tax_name );
431 if ( ! is_string( $terms_to_edit ) ) {
435 <div class="tagsdiv" id="<?php echo $tax_name; ?>">
437 <div class="nojs-tags hide-if-js">
438 <label for="tax-input-<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->add_or_remove_items; ?></label>
439 <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>
441 <?php if ( $user_can_assign_terms ) : ?>
442 <div class="ajaxtag hide-if-no-js">
443 <label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->add_new_item; ?></label>
444 <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" aria-describedby="new-tag-<?php echo $tax_name; ?>-desc" value="" />
445 <input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" /></p>
447 <p class="howto" id="new-tag-<?php echo $tax_name; ?>-desc"><?php echo $taxonomy->labels->separate_items_with_commas; ?></p>
450 <div class="tagchecklist"></div>
452 <?php if ( $user_can_assign_terms ) : ?>
453 <p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->choose_from_most_used; ?></a></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.
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 * Filter 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>
583 <p><?php _e('Excerpts are optional hand-crafted summaries of your content that can be used in your theme. <a href="https://codex.wordpress.org/Excerpt" target="_blank">Learn more about manual excerpts.</a>'); ?></p>
588 * Display trackback links form fields.
592 * @param object $post
594 function post_trackback_meta_box($post) {
595 $form_trackback = '<input type="text" name="trackback_url" id="trackback_url" class="code" value="'. esc_attr( str_replace("\n", ' ', $post->to_ping) ) .'" />';
596 if ('' != $post->pinged) {
597 $pings = '<p>'. __('Already pinged:') . '</p><ul>';
598 $already_pinged = explode("\n", trim($post->pinged));
599 foreach ($already_pinged as $pinged_url) {
600 $pings .= "\n\t<li>" . esc_html($pinged_url) . "</li>";
606 <p><label for="trackback_url"><?php _e('Send trackbacks to:'); ?></label> <?php echo $form_trackback; ?><br /> (<?php _e('Separate multiple URLs with spaces'); ?>)</p>
607 <p><?php _e('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="https://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">pingbacks</a>, no other action necessary.'); ?></p>
609 if ( ! empty($pings) )
614 * Display custom fields form fields.
618 * @param object $post
620 function post_custom_meta_box($post) {
622 <div id="postcustomstuff">
623 <div id="ajax-response"></div>
625 $metadata = has_meta($post->ID);
626 foreach ( $metadata as $key => $value ) {
627 if ( is_protected_meta( $metadata[ $key ][ 'meta_key' ], 'post' ) || ! current_user_can( 'edit_post_meta', $post->ID, $metadata[ $key ][ 'meta_key' ] ) )
628 unset( $metadata[ $key ] );
630 list_meta( $metadata );
631 meta_form( $post ); ?>
633 <p><?php _e('Custom fields can be used to add extra metadata to a post that you can <a href="https://codex.wordpress.org/Using_Custom_Fields" target="_blank">use in your theme</a>.'); ?></p>
638 * Display comments status form fields.
642 * @param object $post
644 function post_comment_status_meta_box($post) {
646 <input name="advanced_view" type="hidden" value="1" />
647 <p class="meta-options">
648 <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 />
649 <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>
652 * Fires at the end of the Discussion meta box on the post editing screen.
656 * @param WP_Post $post WP_Post object of the current post.
658 do_action( 'post_comment_status_meta_box-options', $post );
665 * Display comments for post table header
669 * @param array $result table header rows
672 function post_comment_meta_box_thead($result) {
673 unset($result['cb'], $result['response']);
678 * Display comments for post.
682 * @param object $post
684 function post_comment_meta_box( $post ) {
685 wp_nonce_field( 'get-comments', 'add_comment_nonce', false );
687 <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>
690 $total = get_comments( array( 'post_id' => $post->ID, 'number' => 1, 'count' => true ) );
691 $wp_list_table = _get_list_table('WP_Post_Comments_List_Table');
692 $wp_list_table->display( true );
695 echo '<p id="no-comments">' . __('No comments yet.') . '</p>';
697 $hidden = get_hidden_meta_boxes( get_current_screen() );
698 if ( ! in_array('commentsdiv', $hidden) ) {
700 <script type="text/javascript">jQuery(document).ready(function(){commentsBox.get(<?php echo $total; ?>, 10);});</script>
705 <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>
709 wp_comment_trashnotice();
713 * Display slug form fields.
717 * @param object $post
719 function post_slug_meta_box($post) {
720 /** This filter is documented in wp-admin/edit-tag-form.php */
721 $editable_slug = apply_filters( 'editable_slug', $post->post_name, $post );
723 <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 ); ?>" />
728 * Display form field with list of authors.
732 * @global int $user_ID
734 * @param object $post
736 function post_author_meta_box($post) {
739 <label class="screen-reader-text" for="post_author_override"><?php _e('Author'); ?></label>
741 wp_dropdown_users( array(
743 'name' => 'post_author_override',
744 'selected' => empty($post->ID) ? $user_ID : $post->post_author,
745 'include_selected' => true
750 * Display list of revisions.
754 * @param object $post
756 function post_revisions_meta_box( $post ) {
757 wp_list_post_revisions( $post );
760 // -- Page related Meta Boxes
763 * Display page attributes form fields.
767 * @param object $post
769 function page_attributes_meta_box($post) {
770 $post_type_object = get_post_type_object($post->post_type);
771 if ( $post_type_object->hierarchical ) {
772 $dropdown_args = array(
773 'post_type' => $post->post_type,
774 'exclude_tree' => $post->ID,
775 'selected' => $post->post_parent,
776 'name' => 'parent_id',
777 'show_option_none' => __('(no parent)'),
778 'sort_column' => 'menu_order, post_title',
783 * Filter the arguments used to generate a Pages drop-down element.
787 * @see wp_dropdown_pages()
789 * @param array $dropdown_args Array of arguments used to generate the pages drop-down.
790 * @param WP_Post $post The current WP_Post object.
792 $dropdown_args = apply_filters( 'page_attributes_dropdown_pages_args', $dropdown_args, $post );
793 $pages = wp_dropdown_pages( $dropdown_args );
794 if ( ! empty($pages) ) {
796 <p><strong><?php _e('Parent') ?></strong></p>
797 <label class="screen-reader-text" for="parent_id"><?php _e('Parent') ?></label>
798 <?php echo $pages; ?>
800 } // end empty pages check
801 } // end hierarchical check.
802 if ( 'page' == $post->post_type && 0 != count( get_page_templates( $post ) ) && get_option( 'page_for_posts' ) != $post->ID ) {
803 $template = !empty($post->page_template) ? $post->page_template : false;
805 <p><strong><?php _e('Template') ?></strong><?php
807 * Fires immediately after the heading inside the 'Template' section
808 * of the 'Page Attributes' meta box.
812 * @param string $template The template used for the current post.
813 * @param WP_Post $post The current post.
815 do_action( 'page_attributes_meta_box_template', $template, $post );
817 <label class="screen-reader-text" for="page_template"><?php _e('Page Template') ?></label><select name="page_template" id="page_template">
820 * Filter the title of the default page template displayed in the drop-down.
824 * @param string $label The display value for the default page template title.
825 * @param string $context Where the option label is displayed. Possible values
826 * include 'meta-box' or 'quick-edit'.
828 $default_title = apply_filters( 'default_page_template_title', __( 'Default Template' ), 'meta-box' );
830 <option value="default"><?php echo esc_html( $default_title ); ?></option>
831 <?php page_template_dropdown($template); ?>
835 <p><strong><?php _e('Order') ?></strong></p>
836 <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>
837 <?php if ( 'page' == $post->post_type && get_current_screen()->get_help_tabs() ) { ?>
838 <p><?php _e( 'Need help? Use the Help tab in the upper right of your screen.' ); ?></p>
843 // -- Link related Meta Boxes
846 * Display link create form fields.
850 * @param object $link
852 function link_submit_meta_box($link) {
854 <div class="submitbox" id="submitlink">
856 <div id="minor-publishing">
858 <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
859 <div style="display:none;">
860 <?php submit_button( __( 'Save' ), 'button', 'save', false ); ?>
863 <div id="minor-publishing-actions">
864 <div id="preview-action">
865 <?php if ( !empty($link->link_id) ) { ?>
866 <a class="preview button" href="<?php echo $link->link_url; ?>" target="_blank"><?php _e('Visit Link'); ?></a>
869 <div class="clear"></div>
872 <div id="misc-publishing-actions">
873 <div class="misc-pub-section misc-pub-private">
874 <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>
880 <div id="major-publishing-actions">
882 /** This action is documented in wp-admin/includes/meta-boxes.php */
883 do_action( 'post_submitbox_start' );
885 <div id="delete-action">
887 if ( !empty($_GET['action']) && 'edit' == $_GET['action'] && current_user_can('manage_links') ) { ?>
888 <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>
892 <div id="publishing-action">
893 <?php if ( !empty($link->link_id) ) { ?>
894 <input name="save" type="submit" class="button-large button-primary" id="publish" value="<?php esc_attr_e( 'Update Link' ) ?>" />
896 <input name="save" type="submit" class="button-large button-primary" id="publish" value="<?php esc_attr_e( 'Add Link' ) ?>" />
899 <div class="clear"></div>
903 * Fires at the end of the Publish box in the Link editing screen.
907 do_action( 'submitlink_box' );
909 <div class="clear"></div>
915 * Display link categories form fields.
919 * @param object $link
921 function link_categories_meta_box($link) {
923 <div id="taxonomy-linkcategory" class="categorydiv">
924 <ul id="category-tabs" class="category-tabs">
925 <li class="tabs"><a href="#categories-all"><?php _e( 'All Categories' ); ?></a></li>
926 <li class="hide-if-no-js"><a href="#categories-pop"><?php _e( 'Most Used' ); ?></a></li>
929 <div id="categories-all" class="tabs-panel">
930 <ul id="categorychecklist" data-wp-lists="list:category" class="categorychecklist form-no-clear">
932 if ( isset($link->link_id) )
933 wp_link_category_checklist($link->link_id);
935 wp_link_category_checklist();
940 <div id="categories-pop" class="tabs-panel" style="display: none;">
941 <ul id="categorychecklist-pop" class="categorychecklist form-no-clear">
942 <?php wp_popular_terms_checklist('link_category'); ?>
946 <div id="category-adder" class="wp-hidden-children">
947 <a id="category-add-toggle" href="#category-add" class="taxonomy-add-new"><?php _e( '+ Add New Category' ); ?></a>
948 <p id="link-category-add" class="wp-hidden-child">
949 <label class="screen-reader-text" for="newcat"><?php _e( '+ Add New Category' ); ?></label>
950 <input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php esc_attr_e( 'New category name' ); ?>" aria-required="true" />
951 <input type="button" id="link-category-add-submit" data-wp-lists="add:categorychecklist:link-category-add" class="button" value="<?php esc_attr_e( 'Add' ); ?>" />
952 <?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?>
953 <span id="category-ajax-response"></span>
961 * Display form fields for changing link target.
965 * @param object $link
967 function link_target_meta_box($link) { ?>
968 <fieldset><legend class="screen-reader-text"><span><?php _e('Target') ?></span></legend>
969 <p><label for="link_target_blank" class="selectit">
970 <input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo ( isset( $link->link_target ) && ($link->link_target == '_blank') ? 'checked="checked"' : ''); ?> />
971 <?php _e('<code>_blank</code> — new window or tab.'); ?></label></p>
972 <p><label for="link_target_top" class="selectit">
973 <input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo ( isset( $link->link_target ) && ($link->link_target == '_top') ? 'checked="checked"' : ''); ?> />
974 <?php _e('<code>_top</code> — current window or tab, with no frames.'); ?></label></p>
975 <p><label for="link_target_none" class="selectit">
976 <input id="link_target_none" type="radio" name="link_target" value="" <?php echo ( isset( $link->link_target ) && ($link->link_target == '') ? 'checked="checked"' : ''); ?> />
977 <?php _e('<code>_none</code> — same window or tab.'); ?></label></p>
979 <p><?php _e('Choose the target frame for your link.'); ?></p>
984 * Display checked checkboxes attribute for xfn microformat options.
988 * @global object $link
990 * @param string $class
991 * @param string $value
992 * @param mixed $deprecated Never used.
994 function xfn_check( $class, $value = '', $deprecated = '' ) {
997 if ( !empty( $deprecated ) )
998 _deprecated_argument( __FUNCTION__, '0.0' ); // Never implemented
1000 $link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: '';
1001 $rels = preg_split('/\s+/', $link_rel);
1003 if ('' != $value && in_array($value, $rels) ) {
1004 echo ' checked="checked"';
1008 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"';
1009 if ('friendship' == $class && strpos($link_rel, 'friend') === false && strpos($link_rel, 'acquaintance') === false && strpos($link_rel, 'contact') === false) echo ' checked="checked"';
1010 if ('geographical' == $class && strpos($link_rel, 'co-resident') === false && strpos($link_rel, 'neighbor') === false) echo ' checked="checked"';
1011 if ('identity' == $class && in_array('me', $rels) ) echo ' checked="checked"';
1016 * Display xfn form fields.
1020 * @param object $link
1022 function link_xfn_meta_box($link) {
1024 <table class="links-table">
1026 <th scope="row"><label for="link_rel"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('rel:') ?></label></th>
1027 <td><input type="text" name="link_rel" id="link_rel" value="<?php echo ( isset( $link->link_rel ) ? esc_attr($link->link_rel) : ''); ?>" /></td>
1030 <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('identity') ?></th>
1031 <td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('identity') ?></span></legend>
1033 <input type="checkbox" name="identity" value="me" id="me" <?php xfn_check('identity', 'me'); ?> />
1034 <?php _e('another web address of mine') ?></label>
1038 <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friendship') ?></th>
1039 <td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friendship') ?></span></legend>
1040 <label for="contact">
1041 <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') ?>
1043 <label for="acquaintance">
1044 <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') ?>
1046 <label for="friend">
1047 <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') ?>
1049 <label for="friendship">
1050 <input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check('friendship'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?>
1055 <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('physical') ?> </th>
1056 <td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('physical') ?></span></legend>
1058 <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') ?>
1063 <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('professional') ?> </th>
1064 <td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('professional') ?></span></legend>
1065 <label for="co-worker">
1066 <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') ?>
1068 <label for="colleague">
1069 <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') ?>
1074 <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('geographical') ?></th>
1075 <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('geographical') ?> </span></legend>
1076 <label for="co-resident">
1077 <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') ?>
1079 <label for="neighbor">
1080 <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') ?>
1082 <label for="geographical">
1083 <input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check('geographical'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?>
1088 <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('family') ?></th>
1089 <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('family') ?> </span></legend>
1091 <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') ?>
1094 <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') ?>
1096 <label for="parent">
1097 <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') ?>
1099 <label for="sibling">
1100 <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') ?>
1102 <label for="spouse">
1103 <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') ?>
1105 <label for="family">
1106 <input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check('family'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?>
1111 <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('romantic') ?></th>
1112 <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('romantic') ?> </span></legend>
1114 <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') ?>
1117 <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') ?>
1120 <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') ?>
1122 <label for="romantic">
1123 <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') ?>
1129 <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>
1134 * Display advanced link options form fields.
1138 * @param object $link
1140 function link_advanced_meta_box($link) {
1142 <table class="links-table" cellpadding="0">
1144 <th scope="row"><label for="link_image"><?php _e('Image Address') ?></label></th>
1145 <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>
1148 <th scope="row"><label for="rss_uri"><?php _e('RSS Address') ?></label></th>
1149 <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>
1152 <th scope="row"><label for="link_notes"><?php _e('Notes') ?></label></th>
1153 <td><textarea name="link_notes" id="link_notes" rows="10"><?php echo ( isset( $link->link_notes ) ? $link->link_notes : ''); // textarea_escaped ?></textarea></td>
1156 <th scope="row"><label for="link_rating"><?php _e('Rating') ?></label></th>
1157 <td><select name="link_rating" id="link_rating" size="1">
1159 for ( $r = 0; $r <= 10; $r++ ) {
1160 echo '<option value="' . $r . '"';
1161 if ( isset($link->link_rating) && $link->link_rating == $r )
1162 echo ' selected="selected"';
1163 echo('>' . $r . '</option>');
1165 ?></select> <?php _e('(Leave at 0 for no rating.)') ?>
1173 * Display post thumbnail meta box.
1177 function post_thumbnail_meta_box( $post ) {
1178 $thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true );
1179 echo _wp_post_thumbnail_html( $thumbnail_id, $post->ID );
1183 * Display fields for ID3 data
1187 * @param WP_Post $post
1189 function attachment_id3_data_meta_box( $post ) {
1191 if ( ! empty( $post->ID ) ) {
1192 $meta = wp_get_attachment_metadata( $post->ID );
1195 foreach ( wp_get_attachment_id3_keys( $post, 'edit' ) as $key => $label ) : ?>
1197 <label for="title"><?php echo $label ?></label><br />
1198 <input type="text" name="id3_<?php echo esc_attr( $key ) ?>" id="id3_<?php echo esc_attr( $key ) ?>" class="large-text" value="<?php
1199 if ( ! empty( $meta[ $key ] ) ) {
1200 echo esc_attr( $meta[ $key ] );