A WordPress-centric search engine for devs and theme authors



post_submit_meta_box ›

Since2.7.0
Deprecatedn/a
post_submit_meta_box ( $post, $args = array() )
Parameters: (2)
  • (WP_Post) $post Current post object.
    Required: Yes
  • (array) $args { Array of arguments for building the post submit meta box.
    Required: No
    Default: array()
Defined at:
Codex:

Displays post submit form fields.



Source

function post_submit_meta_box( $post, $args = array() ) {
	global $action;

	$post_type        = $post->post_type;
	$post_type_object = get_post_type_object( $post_type );
	$can_publish      = current_user_can( $post_type_object->cap->publish_posts );
?>
<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="minor-publishing-actions">
<div id="save-action">
<?php
if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) {
	$private_style = '';
	if ( 'private' == $post->post_status ) {
		$private_style = 'style="display:none"';
	}
?>
<input <?php echo $private_style; ?> type="submit" name="save" id="save-post" value="<?php esc_attr_e( 'Save Draft' ); ?>" class="button" />
<span class="spinner"></span>
<?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?>
<input type="submit" name="save" id="save-post" value="<?php esc_attr_e( 'Save as Pending' ); ?>" class="button" />
<span class="spinner"></span>
<?php } ?>
</div>
<?php if ( is_post_type_viewable( $post_type_object ) ) : ?>
<div id="preview-action">
<?php
$preview_link = esc_url( get_preview_post_link( $post ) );
if ( 'publish' == $post->post_status ) {
	$preview_button_text = __( 'Preview Changes' );
} else {