attachment_submit_meta_box
Display attachment submit form fields.
Description
attachment_submit_meta_box( (object) $post );
Parameters (1)
- 0. $post (object)
- The post.
Usage
if ( !function_exists( 'attachment_submit_meta_box' ) ) { require_once ABSPATH . '/wp-admin/includes/meta-boxes.php'; } // The post. $post = null; // NOTICE! Understand what this does before running. $result = attachment_submit_meta_box($post);
Defined (1)
The function is defined in the following location(s).
- /wp-admin/includes/meta-boxes.php
- function attachment_submit_meta_box( $post ) {
- ?>
- <div class="submitbox" id="submitpost">
- <div id="minor-publishing">
- <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
- <div style="display:none;">
- <?php submit_button( __( 'Save' ), '', 'save' ); ?>
- </div>
- <div id="misc-publishing-actions">
- <?php
- /** translators: Publish box date format, see https://secure.php.net/date */
- $datef = __( 'M j, Y @ H:i' );
- /** translators: Attachment information. 1: Date the attachment was uploaded */
- $stamp = __('Uploaded on: <b>%1$s</b>');
- $date = date_i18n( $datef, strtotime( $post->post_date ) );
- ?>
- <div class="misc-pub-section curtime misc-pub-curtime">
- <span id="timestamp"><?php printf($stamp, $date); ?></span>
- </div><!-- .misc-pub-section -->
- <?php
- /**
- * Fires after the 'Uploaded on' section of the Save meta box
- * in the attachment editing screen.
- *
- * @since 3.5.0
- */
- ?>
- </div><!-- #misc-publishing-actions -->
- <div class="clear"></div>
- </div><!-- #minor-publishing -->
- <div id="major-publishing-actions">
- <div id="delete-action">
- <?php
- if ( current_user_can( 'delete_post', $post->ID ) )
- if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {
- echo "<a class='submitdelete deletion' href='" . get_delete_post_link( $post->ID ) . "'>" . _x( 'Trash', 'verb' ) . "</a>";
- } else {
- $delete_ays = ! MEDIA_TRASH ? " onclick='return showNotice.warn();'" : '';
- echo "<a class='submitdelete deletion'$delete_ays href='" . get_delete_post_link( $post->ID, null, true ) . "'>" . __( 'Delete Permanently' ) . "</a>";
- }
- ?>
- </div>
- <div id="publishing-action">
- <span class="spinner"></span>
- <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update') ?>" />
- <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update' ) ?>" />
- </div>
- <div class="clear"></div>
- </div><!-- #major-publishing-actions -->
- </div>
- <?php