WordPress功能函数attachment_submit_meta_box(),显示附件提交表单字段。
用法:
attachment_submit_meta_box( WP_Post $post )
参数:
$post
(WP_Post) (必需)
来源
文件: 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>
<?php submit_button( __( ‘Save’ ), ”, ‘save’ ); ?>
</div>
<div id=”misc-publishing-actions”>
<div class=”misc-pub-section curtime misc-pub-curtime”>
<span id=”timest**p”>
<?php
$uploaded_on = sprintf(
/* translators: Publish box date string. 1: Date, 2: Time. See https://www.php.net/**nual/datetime.for**t.php */
__( ‘1$s at 2$s’ ),
/* translators: Publish box date for**t, see https://www.php.net/**nual/datetime.for**t.php */
date_i18n( _x( ‘M j, Y’, ‘publish box date for**t’ ), strtotime( $post->post_date ) ),
/* translators: Publish box time for**t, see https://www.php.net/**nual/datetime.for**t.php */
date_i18n( _x( ‘H:i’, ‘publish box time for**t’ ), strtotime( $post->post_date ) )
);
/* translators: Attachment infor**tion. 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` par**eter.
*
* @par** 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=”**jor-publishing-actions”>
<div id=”delete-action”>
<?php
if ( current_user_can( ‘delete_post’, $post->ID ) ) {
if ( EMPTY_TRASH_DAYS &**p;&**p; MEDIA_TRASH ) {
echo “<a class=’submitdelete deletion’ href='” . get_delete_post_link( $post->ID ) . “‘>” . __( ‘Move to Trash’ ) . ‘</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 per**nently’ ) . ‘</a>’;
}
}
?>
</div>
<div id=”publishing-action”>
<span class=”spinner”></span>
<input n**e=”original_publish” type=”hidden” id=”original_publish” value=”<?php esc_attr_e( ‘Update’ ); ?>” />
<input n**e=”save” type=”submit” class=”button button-pri**ry button-large” id=”publish” value=”<?php esc_attr_e( ‘Update’ ); ?>” />
</div>
<div class=”clear”></div>
</div><!– #**jor-publishing-actions –>
</div>
<?php
}
更新日志:
暂无评论内容