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' ), 'button', '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. $stamp = __('Uploaded on: <b>%1$s</b>'); 
  18. $date = date_i18n( $datef, strtotime( $post->post_date ) ); 
  19. ?> 
  20. <div class="misc-pub-section curtime misc-pub-curtime"> 
  21. <span id="timestamp"><?php printf($stamp, $date); ?></span> 
  22. </div><!-- .misc-pub-section --> 
  23.  
  24. <?php 
  25. /** 
  26. * Fires after the 'Uploaded on' section of the Save meta box 
  27. * in the attachment editing screen. 
  28. * @since 3.5.0 
  29. */ 
  30. ?> 
  31. </div><!-- #misc-publishing-actions --> 
  32. <div class="clear"></div> 
  33. </div><!-- #minor-publishing --> 
  34.  
  35. <div id="major-publishing-actions"> 
  36. <div id="delete-action"> 
  37. <?php 
  38. if ( current_user_can( 'delete_post', $post->ID ) ) 
  39. echo "<a class='submitdelete deletion' href='" . get_delete_post_link( $post->ID ) . "'>" . _x( 'Trash', 'verb' ) . "</a>"; 
  40. } else { 
  41. $delete_ays = ! MEDIA_TRASH ? " onclick='return showNotice.warn();'" : ''; 
  42. echo "<a class='submitdelete deletion'$delete_ays href='" . get_delete_post_link( $post->ID, null, true ) . "'>" . __( 'Delete Permanently' ) . "</a>"; 
  43. ?> 
  44. </div> 
  45.  
  46. <div id="publishing-action"> 
  47. <span class="spinner"></span> 
  48. <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update') ?>" /> 
  49. <input name="save" type="submit" class="button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update' ) ?>" /> 
  50. </div> 
  51. <div class="clear"></div> 
  52. </div><!-- #major-publishing-actions --> 
  53.  
  54. </div> 
  55.  
  56. <?php