attachment_submit_meta_box

Display attachment submit form fields.

Description

attachment_submit_meta_box( (object) $post ); 

Parameters (1)

0. $post (object)
The post.

Usage

  1. if ( !function_exists( 'attachment_submit_meta_box' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/meta-boxes.php'; 
  3.  
  4. // The post. 
  5. $post = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = attachment_submit_meta_box($post); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/meta-boxes.php  
  1. function attachment_submit_meta_box( $post ) { 
  2. ?> 
  3. <div class="submitbox" id="submitpost"> 
  4.  
  5. <div id="minor-publishing"> 
  6.  
  7. <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?> 
  8. <div style="display:none;"> 
  9. <?php submit_button( __( 'Save' ), '', 'save' ); ?> 
  10. </div> 
  11.  
  12.  
  13. <div id="misc-publishing-actions"> 
  14. <?php 
  15. /** translators: Publish box date format, see https://secure.php.net/date */ 
  16. $datef = __( 'M j, Y @ H:i' ); 
  17. /** translators: Attachment information. 1: Date the attachment was uploaded */ 
  18. $stamp = __('Uploaded on: <b>%1$s</b>'); 
  19. $date = date_i18n( $datef, strtotime( $post->post_date ) ); 
  20. ?> 
  21. <div class="misc-pub-section curtime misc-pub-curtime"> 
  22. <span id="timestamp"><?php printf($stamp, $date); ?></span> 
  23. </div><!-- .misc-pub-section --> 
  24.  
  25. <?php 
  26. /** 
  27. * Fires after the 'Uploaded on' section of the Save meta box 
  28. * in the attachment editing screen. 
  29. * @since 3.5.0 
  30. */ 
  31. ?> 
  32. </div><!-- #misc-publishing-actions --> 
  33. <div class="clear"></div> 
  34. </div><!-- #minor-publishing --> 
  35.  
  36. <div id="major-publishing-actions"> 
  37. <div id="delete-action"> 
  38. <?php 
  39. if ( current_user_can( 'delete_post', $post->ID ) ) 
  40. echo "<a class='submitdelete deletion' href='" . get_delete_post_link( $post->ID ) . "'>" . _x( 'Trash', 'verb' ) . "</a>"; 
  41. } else { 
  42. $delete_ays = ! MEDIA_TRASH ? " onclick='return showNotice.warn();'" : ''; 
  43. echo "<a class='submitdelete deletion'$delete_ays href='" . get_delete_post_link( $post->ID, null, true ) . "'>" . __( 'Delete Permanently' ) . "</a>"; 
  44. ?> 
  45. </div> 
  46.  
  47. <div id="publishing-action"> 
  48. <span class="spinner"></span> 
  49. <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update') ?>" /> 
  50. <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update' ) ?>" /> 
  51. </div> 
  52. <div class="clear"></div> 
  53. </div><!-- #major-publishing-actions --> 
  54.  
  55. </div> 
  56.  
  57. <?php