Title: attachment_submit_meta_box
Published: April 25, 2014
Last modified: August 20, 2026

---

# attachment_submit_meta_box( WP_Post $post )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/attachment_submit_meta_box/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/functions/attachment_submit_meta_box/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/functions/attachment_submit_meta_box/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/functions/attachment_submit_meta_box/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/attachment_submit_meta_box/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/attachment_submit_meta_box/?output_format=md#user-contributed-notes)

Displays attachment submit form fields.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/attachment_submit_meta_box/?output_format=md#parameters)󠁿

 `$post`[WP_Post](https://developer.wordpress.org/reference/classes/wp_post/)required

Current post object.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/attachment_submit_meta_box/?output_format=md#source)󠁿

    ```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">
    	<div class="misc-pub-section curtime misc-pub-curtime">
    		<span id="timestamp">
    			<?php
    			$uploaded_on = sprintf(
    				/* translators: Publish box date string. 1: Date, 2: Time. */
    				__( '%1$s at %2$s' ),
    				/* translators: Publish box date format, see https://www.php.net/manual/datetime.format.php */
    				date_i18n( _x( 'M j, Y', 'publish box date format' ), strtotime( $post->post_date ) ),
    				/* translators: Publish box time format, see https://www.php.net/manual/datetime.format.php */
    				date_i18n( _x( 'H:i', 'publish box time format' ), strtotime( $post->post_date ) )
    			);
    			/* translators: Attachment information. %s: Date the attachment was uploaded. */
    			printf( __( 'Uploaded on: %s' ), '<b>' . $uploaded_on . '</b>' );
    			?>
    		</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
    	 * @since 4.9.0 Added the `$post` parameter.
    	 *
    	 * @param WP_Post $post WP_Post object for the current attachment.
    	 */
    	do_action( 'attachment_submitbox_misc_actions', $post );
    	?>
    </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 ) {
    			printf(
    				'<a class="submitdelete deletion" href="%1$s">%2$s</a>',
    				get_delete_post_link( $post->ID ),
    				__( 'Move to Trash' )
    			);
    		} else {
    			$show_confirmation = ! MEDIA_TRASH ? " onclick='return showNotice.warn();'" : '';

    			printf(
    				'<a class="submitdelete deletion"%1$s href="%2$s">%3$s</a>',
    				$show_confirmation,
    				get_delete_post_link( $post->ID, '', true ),
    				__( 'Delete permanently' )
    			);
    		}
    	}
    	?>
    	</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
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/meta-boxes.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-admin/includes/meta-boxes.php#L420)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/meta-boxes.php#L420-L501)

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/attachment_submit_meta_box/?output_format=md#hooks)󠁿

 [do_action( ‘attachment_submitbox_misc_actions’, WP_Post $post )](https://developer.wordpress.org/reference/hooks/attachment_submitbox_misc_actions/)

Fires after the ‘Uploaded on’ section of the Save meta box in the attachment editing
screen.

## 󠀁[Related](https://developer.wordpress.org/reference/functions/attachment_submit_meta_box/?output_format=md#related)󠁿

| Uses | Description | 
| [submit_button()](https://developer.wordpress.org/reference/functions/submit_button/)`wp-admin/includes/template.php` |

Echoes a submit button, with provided text and appropriate class(es).

  | 
| [esc_attr_e()](https://developer.wordpress.org/reference/functions/esc_attr_e/)`wp-includes/l10n.php` |

Displays translated text that has been escaped for safe use in an attribute.

  | 
| [date_i18n()](https://developer.wordpress.org/reference/functions/date_i18n/)`wp-includes/functions.php` |

Retrieves the date in localized format, based on a sum of Unix timestamp and timezone offset in seconds.

  | 
| [get_delete_post_link()](https://developer.wordpress.org/reference/functions/get_delete_post_link/)`wp-includes/link-template.php` |

Retrieves the delete posts link for post.

  | 
| [current_user_can()](https://developer.wordpress.org/reference/functions/current_user_can/)`wp-includes/capabilities.php` |

Returns whether the current user has the specified capability.

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  | 
| [_x()](https://developer.wordpress.org/reference/functions/_x/)`wp-includes/l10n.php` |

Retrieves translated string with gettext context.

  | 
| [do_action()](https://developer.wordpress.org/reference/functions/do_action/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to an action hook.

  |

[Show 4 more](https://developer.wordpress.org/reference/functions/attachment_submit_meta_box/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/attachment_submit_meta_box/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/attachment_submit_meta_box/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/attachment_submit_meta_box/?output_format=md#user-contributed-notes)󠁿

 1.   [Skip to note 2 content](https://developer.wordpress.org/reference/functions/attachment_submit_meta_box/?output_format=md#comment-content-6668)
 2.    [Muhibul Haque](https://profiles.wordpress.org/devmuhib/)  [  3 years ago  ](https://developer.wordpress.org/reference/functions/attachment_submit_meta_box/#comment-6668)
 3.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fattachment_submit_meta_box%2F%23comment-6668)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fattachment_submit_meta_box%2F%23comment-6668)
 4.  The **attachment_submit_meta_box** function is a WordPress core function used 
     to render a meta box on the Edit Media screen in the WordPress admin. This meta
     box allows users to perform actions and make changes related to media attachments(
     e.g., images, videos) associated with posts or pages.
 5.  Here are the key details about the **attachment_submit_meta_box** function:
 6.  **Parameters:** It accepts a single parameter, $post, which is an instance of 
     the **[WP_Post](https://developer.wordpress.org/reference/classes/wp_post/)** 
     class representing the media attachment being edited.
 7.  **Purpose:** This function renders the content of the **“Attachment Details”**
     meta box, which is displayed on the Edit Media screen. This meta box contains 
     fields and options for modifying various attributes of the attachment, such as
     the title, caption, alt text, description, and attachment alignment.
 8.  **Usage:** Typically, you don’t need to call this function directly in your code.
     WordPress core handles the rendering of this meta box automatically when you’re
     editing media attachments through the admin interface.
 9.  **Hooks:** If you want to customize the behavior or content of this meta box, 
     you can do so by using WordPress hooks and filters, such as **add_meta_boxes**
     and **save_post**. These allow you to add or modify fields and data associated
     with media attachments.
 10. In summary, **attachment_submit_meta_box** is a WordPress core function responsible
     for rendering the “Attachment Details” meta box in the admin interface, providing
     a way to edit and manage media attachment attributes.
 11.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fattachment_submit_meta_box%2F%3Freplytocom%3D6668%23feedback-editor-6668)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fattachment_submit_meta_box%2F)
before being able to contribute a note or feedback.