Edit File by line
/home/barbar84/public_h.../wp-admin/includes
File: meta-boxes.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* WordPress Administration Meta Boxes API.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
* @subpackage Administration
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
//
[8] Fix | Delete
// Post-related Meta Boxes.
[9] Fix | Delete
//
[10] Fix | Delete
[11] Fix | Delete
/**
[12] Fix | Delete
* Displays post submit form fields.
[13] Fix | Delete
*
[14] Fix | Delete
* @since 2.7.0
[15] Fix | Delete
*
[16] Fix | Delete
* @global string $action
[17] Fix | Delete
*
[18] Fix | Delete
* @param WP_Post $post Current post object.
[19] Fix | Delete
* @param array $args {
[20] Fix | Delete
* Array of arguments for building the post submit meta box.
[21] Fix | Delete
*
[22] Fix | Delete
* @type string $id Meta box 'id' attribute.
[23] Fix | Delete
* @type string $title Meta box title.
[24] Fix | Delete
* @type callable $callback Meta box display callback.
[25] Fix | Delete
* @type array $args Extra meta box arguments.
[26] Fix | Delete
* }
[27] Fix | Delete
*/
[28] Fix | Delete
function post_submit_meta_box( $post, $args = array() ) {
[29] Fix | Delete
global $action;
[30] Fix | Delete
[31] Fix | Delete
$post_id = (int) $post->ID;
[32] Fix | Delete
$post_type = $post->post_type;
[33] Fix | Delete
$post_type_object = get_post_type_object( $post_type );
[34] Fix | Delete
$can_publish = current_user_can( $post_type_object->cap->publish_posts );
[35] Fix | Delete
?>
[36] Fix | Delete
<div class="submitbox" id="submitpost">
[37] Fix | Delete
[38] Fix | Delete
<div id="minor-publishing">
[39] Fix | Delete
[40] Fix | Delete
<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key. ?>
[41] Fix | Delete
<div style="display:none;">
[42] Fix | Delete
<?php submit_button( __( 'Save' ), '', 'save' ); ?>
[43] Fix | Delete
</div>
[44] Fix | Delete
[45] Fix | Delete
<div id="minor-publishing-actions">
[46] Fix | Delete
<div id="save-action">
[47] Fix | Delete
<?php
[48] Fix | Delete
if ( ! in_array( $post->post_status, array( 'publish', 'future', 'pending' ), true ) ) {
[49] Fix | Delete
$private_style = '';
[50] Fix | Delete
if ( 'private' === $post->post_status ) {
[51] Fix | Delete
$private_style = 'style="display:none"';
[52] Fix | Delete
}
[53] Fix | Delete
?>
[54] Fix | Delete
<input <?php echo $private_style; ?> type="submit" name="save" id="save-post" value="<?php esc_attr_e( 'Save Draft' ); ?>" class="button" />
[55] Fix | Delete
<span class="spinner"></span>
[56] Fix | Delete
<?php } elseif ( 'pending' === $post->post_status && $can_publish ) { ?>
[57] Fix | Delete
<input type="submit" name="save" id="save-post" value="<?php esc_attr_e( 'Save as Pending' ); ?>" class="button" />
[58] Fix | Delete
<span class="spinner"></span>
[59] Fix | Delete
<?php } ?>
[60] Fix | Delete
</div>
[61] Fix | Delete
[62] Fix | Delete
<?php
[63] Fix | Delete
if ( is_post_type_viewable( $post_type_object ) ) :
[64] Fix | Delete
?>
[65] Fix | Delete
<div id="preview-action">
[66] Fix | Delete
<?php
[67] Fix | Delete
$preview_link = esc_url( get_preview_post_link( $post ) );
[68] Fix | Delete
if ( 'publish' === $post->post_status ) {
[69] Fix | Delete
$preview_button_text = __( 'Preview Changes' );
[70] Fix | Delete
} else {
[71] Fix | Delete
$preview_button_text = __( 'Preview' );
[72] Fix | Delete
}
[73] Fix | Delete
[74] Fix | Delete
$preview_button = sprintf(
[75] Fix | Delete
'%1$s<span class="screen-reader-text"> %2$s</span>',
[76] Fix | Delete
$preview_button_text,
[77] Fix | Delete
/* translators: Accessibility text. */
[78] Fix | Delete
__( '(opens in a new tab)' )
[79] Fix | Delete
);
[80] Fix | Delete
?>
[81] Fix | Delete
<a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview-<?php echo $post_id; ?>" id="post-preview"><?php echo $preview_button; ?></a>
[82] Fix | Delete
<input type="hidden" name="wp-preview" id="wp-preview" value="" />
[83] Fix | Delete
</div>
[84] Fix | Delete
<?php
[85] Fix | Delete
endif;
[86] Fix | Delete
[87] Fix | Delete
/**
[88] Fix | Delete
* Fires before the post time/date setting in the Publish meta box.
[89] Fix | Delete
*
[90] Fix | Delete
* @since 4.4.0
[91] Fix | Delete
*
[92] Fix | Delete
* @param WP_Post $post WP_Post object for the current post.
[93] Fix | Delete
*/
[94] Fix | Delete
do_action( 'post_submitbox_minor_actions', $post );
[95] Fix | Delete
?>
[96] Fix | Delete
<div class="clear"></div>
[97] Fix | Delete
</div>
[98] Fix | Delete
[99] Fix | Delete
<div id="misc-publishing-actions">
[100] Fix | Delete
<div class="misc-pub-section misc-pub-post-status">
[101] Fix | Delete
<?php _e( 'Status:' ); ?>
[102] Fix | Delete
<span id="post-status-display">
[103] Fix | Delete
<?php
[104] Fix | Delete
switch ( $post->post_status ) {
[105] Fix | Delete
case 'private':
[106] Fix | Delete
_e( 'Privately Published' );
[107] Fix | Delete
break;
[108] Fix | Delete
case 'publish':
[109] Fix | Delete
_e( 'Published' );
[110] Fix | Delete
break;
[111] Fix | Delete
case 'future':
[112] Fix | Delete
_e( 'Scheduled' );
[113] Fix | Delete
break;
[114] Fix | Delete
case 'pending':
[115] Fix | Delete
_e( 'Pending Review' );
[116] Fix | Delete
break;
[117] Fix | Delete
case 'draft':
[118] Fix | Delete
case 'auto-draft':
[119] Fix | Delete
_e( 'Draft' );
[120] Fix | Delete
break;
[121] Fix | Delete
}
[122] Fix | Delete
?>
[123] Fix | Delete
</span>
[124] Fix | Delete
[125] Fix | Delete
<?php
[126] Fix | Delete
if ( 'publish' === $post->post_status || 'private' === $post->post_status || $can_publish ) {
[127] Fix | Delete
$private_style = '';
[128] Fix | Delete
if ( 'private' === $post->post_status ) {
[129] Fix | Delete
$private_style = 'style="display:none"';
[130] Fix | Delete
}
[131] Fix | Delete
?>
[132] Fix | Delete
<a href="#post_status" <?php echo $private_style; ?> class="edit-post-status hide-if-no-js" role="button"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit status' ); ?></span></a>
[133] Fix | Delete
[134] Fix | Delete
<div id="post-status-select" class="hide-if-js">
[135] Fix | Delete
<input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo esc_attr( ( 'auto-draft' === $post->post_status ) ? 'draft' : $post->post_status ); ?>" />
[136] Fix | Delete
<label for="post_status" class="screen-reader-text"><?php _e( 'Set status' ); ?></label>
[137] Fix | Delete
<select name="post_status" id="post_status">
[138] Fix | Delete
<?php if ( 'publish' === $post->post_status ) : ?>
[139] Fix | Delete
<option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e( 'Published' ); ?></option>
[140] Fix | Delete
<?php elseif ( 'private' === $post->post_status ) : ?>
[141] Fix | Delete
<option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e( 'Privately Published' ); ?></option>
[142] Fix | Delete
<?php elseif ( 'future' === $post->post_status ) : ?>
[143] Fix | Delete
<option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e( 'Scheduled' ); ?></option>
[144] Fix | Delete
<?php endif; ?>
[145] Fix | Delete
<option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e( 'Pending Review' ); ?></option>
[146] Fix | Delete
<?php if ( 'auto-draft' === $post->post_status ) : ?>
[147] Fix | Delete
<option<?php selected( $post->post_status, 'auto-draft' ); ?> value='draft'><?php _e( 'Draft' ); ?></option>
[148] Fix | Delete
<?php else : ?>
[149] Fix | Delete
<option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e( 'Draft' ); ?></option>
[150] Fix | Delete
<?php endif; ?>
[151] Fix | Delete
</select>
[152] Fix | Delete
<a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e( 'OK' ); ?></a>
[153] Fix | Delete
<a href="#post_status" class="cancel-post-status hide-if-no-js button-cancel"><?php _e( 'Cancel' ); ?></a>
[154] Fix | Delete
</div>
[155] Fix | Delete
<?php
[156] Fix | Delete
}
[157] Fix | Delete
?>
[158] Fix | Delete
</div>
[159] Fix | Delete
[160] Fix | Delete
<div class="misc-pub-section misc-pub-visibility" id="visibility">
[161] Fix | Delete
<?php _e( 'Visibility:' ); ?>
[162] Fix | Delete
<span id="post-visibility-display">
[163] Fix | Delete
<?php
[164] Fix | Delete
if ( 'private' === $post->post_status ) {
[165] Fix | Delete
$post->post_password = '';
[166] Fix | Delete
$visibility = 'private';
[167] Fix | Delete
$visibility_trans = __( 'Private' );
[168] Fix | Delete
} elseif ( ! empty( $post->post_password ) ) {
[169] Fix | Delete
$visibility = 'password';
[170] Fix | Delete
$visibility_trans = __( 'Password protected' );
[171] Fix | Delete
} elseif ( 'post' === $post_type && is_sticky( $post_id ) ) {
[172] Fix | Delete
$visibility = 'public';
[173] Fix | Delete
$visibility_trans = __( 'Public, Sticky' );
[174] Fix | Delete
} else {
[175] Fix | Delete
$visibility = 'public';
[176] Fix | Delete
$visibility_trans = __( 'Public' );
[177] Fix | Delete
}
[178] Fix | Delete
[179] Fix | Delete
echo esc_html( $visibility_trans );
[180] Fix | Delete
?>
[181] Fix | Delete
</span>
[182] Fix | Delete
[183] Fix | Delete
<?php if ( $can_publish ) { ?>
[184] Fix | Delete
<a href="#visibility" class="edit-visibility hide-if-no-js" role="button"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit visibility' ); ?></span></a>
[185] Fix | Delete
[186] Fix | Delete
<div id="post-visibility-select" class="hide-if-js">
[187] Fix | Delete
<input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo esc_attr( $post->post_password ); ?>" />
[188] Fix | Delete
<?php if ( 'post' === $post_type ) : ?>
[189] Fix | Delete
<input type="checkbox" style="display:none" name="hidden_post_sticky" id="hidden-post-sticky" value="sticky" <?php checked( is_sticky( $post_id ) ); ?> />
[190] Fix | Delete
<?php endif; ?>
[191] Fix | Delete
[192] Fix | Delete
<input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo esc_attr( $visibility ); ?>" />
[193] Fix | Delete
<input type="radio" name="visibility" id="visibility-radio-public" value="public" <?php checked( $visibility, 'public' ); ?> /> <label for="visibility-radio-public" class="selectit"><?php _e( 'Public' ); ?></label><br />
[194] Fix | Delete
[195] Fix | Delete
<?php if ( 'post' === $post_type && current_user_can( 'edit_others_posts' ) ) : ?>
[196] Fix | Delete
<span id="sticky-span"><input id="sticky" name="sticky" type="checkbox" value="sticky" <?php checked( is_sticky( $post_id ) ); ?> /> <label for="sticky" class="selectit"><?php _e( 'Stick this post to the front page' ); ?></label><br /></span>
[197] Fix | Delete
<?php endif; ?>
[198] Fix | Delete
[199] Fix | Delete
<input type="radio" name="visibility" id="visibility-radio-password" value="password" <?php checked( $visibility, 'password' ); ?> /> <label for="visibility-radio-password" class="selectit"><?php _e( 'Password protected' ); ?></label><br />
[200] Fix | Delete
<span id="password-span"><label for="post_password"><?php _e( 'Password:' ); ?></label> <input type="text" name="post_password" id="post_password" value="<?php echo esc_attr( $post->post_password ); ?>" maxlength="255" /><br /></span>
[201] Fix | Delete
[202] Fix | Delete
<input type="radio" name="visibility" id="visibility-radio-private" value="private" <?php checked( $visibility, 'private' ); ?> /> <label for="visibility-radio-private" class="selectit"><?php _e( 'Private' ); ?></label><br />
[203] Fix | Delete
[204] Fix | Delete
<p>
[205] Fix | Delete
<a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e( 'OK' ); ?></a>
[206] Fix | Delete
<a href="#visibility" class="cancel-post-visibility hide-if-no-js button-cancel"><?php _e( 'Cancel' ); ?></a>
[207] Fix | Delete
</p>
[208] Fix | Delete
</div>
[209] Fix | Delete
<?php } ?>
[210] Fix | Delete
</div>
[211] Fix | Delete
[212] Fix | Delete
<?php
[213] Fix | Delete
/* translators: Publish box date string. 1: Date, 2: Time. See https://www.php.net/manual/datetime.format.php */
[214] Fix | Delete
$date_string = __( '%1$s at %2$s' );
[215] Fix | Delete
/* translators: Publish box date format, see https://www.php.net/manual/datetime.format.php */
[216] Fix | Delete
$date_format = _x( 'M j, Y', 'publish box date format' );
[217] Fix | Delete
/* translators: Publish box time format, see https://www.php.net/manual/datetime.format.php */
[218] Fix | Delete
$time_format = _x( 'H:i', 'publish box time format' );
[219] Fix | Delete
[220] Fix | Delete
if ( 0 !== $post_id ) {
[221] Fix | Delete
if ( 'future' === $post->post_status ) { // Scheduled for publishing at a future date.
[222] Fix | Delete
/* translators: Post date information. %s: Date on which the post is currently scheduled to be published. */
[223] Fix | Delete
$stamp = __( 'Scheduled for: %s' );
[224] Fix | Delete
} elseif ( 'publish' === $post->post_status || 'private' === $post->post_status ) { // Already published.
[225] Fix | Delete
/* translators: Post date information. %s: Date on which the post was published. */
[226] Fix | Delete
$stamp = __( 'Published on: %s' );
[227] Fix | Delete
} elseif ( '0000-00-00 00:00:00' === $post->post_date_gmt ) { // Draft, 1 or more saves, no date specified.
[228] Fix | Delete
$stamp = __( 'Publish <b>immediately</b>' );
[229] Fix | Delete
} elseif ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // Draft, 1 or more saves, future date specified.
[230] Fix | Delete
/* translators: Post date information. %s: Date on which the post is to be published. */
[231] Fix | Delete
$stamp = __( 'Schedule for: %s' );
[232] Fix | Delete
} else { // Draft, 1 or more saves, date specified.
[233] Fix | Delete
/* translators: Post date information. %s: Date on which the post is to be published. */
[234] Fix | Delete
$stamp = __( 'Publish on: %s' );
[235] Fix | Delete
}
[236] Fix | Delete
$date = sprintf(
[237] Fix | Delete
$date_string,
[238] Fix | Delete
date_i18n( $date_format, strtotime( $post->post_date ) ),
[239] Fix | Delete
date_i18n( $time_format, strtotime( $post->post_date ) )
[240] Fix | Delete
);
[241] Fix | Delete
} else { // Draft (no saves, and thus no date specified).
[242] Fix | Delete
$stamp = __( 'Publish <b>immediately</b>' );
[243] Fix | Delete
$date = sprintf(
[244] Fix | Delete
$date_string,
[245] Fix | Delete
date_i18n( $date_format, strtotime( current_time( 'mysql' ) ) ),
[246] Fix | Delete
date_i18n( $time_format, strtotime( current_time( 'mysql' ) ) )
[247] Fix | Delete
);
[248] Fix | Delete
}
[249] Fix | Delete
[250] Fix | Delete
if ( ! empty( $args['args']['revisions_count'] ) ) :
[251] Fix | Delete
?>
[252] Fix | Delete
<div class="misc-pub-section misc-pub-revisions">
[253] Fix | Delete
<?php
[254] Fix | Delete
/* translators: Post revisions heading. %s: The number of available revisions. */
[255] Fix | Delete
printf( __( 'Revisions: %s' ), '<b>' . number_format_i18n( $args['args']['revisions_count'] ) . '</b>' );
[256] Fix | Delete
?>
[257] Fix | Delete
<a class="hide-if-no-js" href="<?php echo esc_url( get_edit_post_link( $args['args']['revision_id'] ) ); ?>"><span aria-hidden="true"><?php _ex( 'Browse', 'revisions' ); ?></span> <span class="screen-reader-text"><?php _e( 'Browse revisions' ); ?></span></a>
[258] Fix | Delete
</div>
[259] Fix | Delete
<?php
[260] Fix | Delete
endif;
[261] Fix | Delete
[262] Fix | Delete
if ( $can_publish ) : // Contributors don't get to choose the date of publish.
[263] Fix | Delete
?>
[264] Fix | Delete
<div class="misc-pub-section curtime misc-pub-curtime">
[265] Fix | Delete
<span id="timestamp">
[266] Fix | Delete
<?php printf( $stamp, '<b>' . $date . '</b>' ); ?>
[267] Fix | Delete
</span>
[268] Fix | Delete
<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" role="button">
[269] Fix | Delete
<span aria-hidden="true"><?php _e( 'Edit' ); ?></span>
[270] Fix | Delete
<span class="screen-reader-text"><?php _e( 'Edit date and time' ); ?></span>
[271] Fix | Delete
</a>
[272] Fix | Delete
<fieldset id="timestampdiv" class="hide-if-js">
[273] Fix | Delete
<legend class="screen-reader-text"><?php _e( 'Date and time' ); ?></legend>
[274] Fix | Delete
<?php touch_time( ( 'edit' === $action ), 1 ); ?>
[275] Fix | Delete
</fieldset>
[276] Fix | Delete
</div>
[277] Fix | Delete
<?php
[278] Fix | Delete
endif;
[279] Fix | Delete
[280] Fix | Delete
if ( 'draft' === $post->post_status && get_post_meta( $post_id, '_customize_changeset_uuid', true ) ) :
[281] Fix | Delete
?>
[282] Fix | Delete
<div class="notice notice-info notice-alt inline">
[283] Fix | Delete
<p>
[284] Fix | Delete
<?php
[285] Fix | Delete
printf(
[286] Fix | Delete
/* translators: %s: URL to the Customizer. */
[287] Fix | Delete
__( 'This draft comes from your <a href="%s">unpublished customization changes</a>. You can edit, but there&#8217;s no need to publish now. It will be published automatically with those changes.' ),
[288] Fix | Delete
esc_url(
[289] Fix | Delete
add_query_arg(
[290] Fix | Delete
'changeset_uuid',
[291] Fix | Delete
rawurlencode( get_post_meta( $post_id, '_customize_changeset_uuid', true ) ),
[292] Fix | Delete
admin_url( 'customize.php' )
[293] Fix | Delete
)
[294] Fix | Delete
)
[295] Fix | Delete
);
[296] Fix | Delete
?>
[297] Fix | Delete
</p>
[298] Fix | Delete
</div>
[299] Fix | Delete
<?php
[300] Fix | Delete
endif;
[301] Fix | Delete
[302] Fix | Delete
/**
[303] Fix | Delete
* Fires after the post time/date setting in the Publish meta box.
[304] Fix | Delete
*
[305] Fix | Delete
* @since 2.9.0
[306] Fix | Delete
* @since 4.4.0 Added the `$post` parameter.
[307] Fix | Delete
*
[308] Fix | Delete
* @param WP_Post $post WP_Post object for the current post.
[309] Fix | Delete
*/
[310] Fix | Delete
do_action( 'post_submitbox_misc_actions', $post );
[311] Fix | Delete
?>
[312] Fix | Delete
</div>
[313] Fix | Delete
<div class="clear"></div>
[314] Fix | Delete
</div>
[315] Fix | Delete
[316] Fix | Delete
<div id="major-publishing-actions">
[317] Fix | Delete
<?php
[318] Fix | Delete
/**
[319] Fix | Delete
* Fires at the beginning of the publishing actions section of the Publish meta box.
[320] Fix | Delete
*
[321] Fix | Delete
* @since 2.7.0
[322] Fix | Delete
* @since 4.9.0 Added the `$post` parameter.
[323] Fix | Delete
*
[324] Fix | Delete
* @param WP_Post|null $post WP_Post object for the current post on Edit Post screen,
[325] Fix | Delete
* null on Edit Link screen.
[326] Fix | Delete
*/
[327] Fix | Delete
do_action( 'post_submitbox_start', $post );
[328] Fix | Delete
?>
[329] Fix | Delete
<div id="delete-action">
[330] Fix | Delete
<?php
[331] Fix | Delete
if ( current_user_can( 'delete_post', $post_id ) ) {
[332] Fix | Delete
if ( ! EMPTY_TRASH_DAYS ) {
[333] Fix | Delete
$delete_text = __( 'Delete permanently' );
[334] Fix | Delete
} else {
[335] Fix | Delete
$delete_text = __( 'Move to Trash' );
[336] Fix | Delete
}
[337] Fix | Delete
?>
[338] Fix | Delete
<a class="submitdelete deletion" href="<?php echo get_delete_post_link( $post_id ); ?>"><?php echo $delete_text; ?></a>
[339] Fix | Delete
<?php
[340] Fix | Delete
}
[341] Fix | Delete
?>
[342] Fix | Delete
</div>
[343] Fix | Delete
[344] Fix | Delete
<div id="publishing-action">
[345] Fix | Delete
<span class="spinner"></span>
[346] Fix | Delete
<?php
[347] Fix | Delete
if ( ! in_array( $post->post_status, array( 'publish', 'future', 'private' ), true ) || 0 === $post_id ) {
[348] Fix | Delete
if ( $can_publish ) :
[349] Fix | Delete
if ( ! empty( $post->post_date_gmt ) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) :
[350] Fix | Delete
?>
[351] Fix | Delete
<input name="original_publish" type="hidden" id="original_publish" value="<?php echo esc_attr_x( 'Schedule', 'post action/button label' ); ?>" />
[352] Fix | Delete
<?php submit_button( _x( 'Schedule', 'post action/button label' ), 'primary large', 'publish', false ); ?>
[353] Fix | Delete
<?php
[354] Fix | Delete
else :
[355] Fix | Delete
?>
[356] Fix | Delete
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Publish' ); ?>" />
[357] Fix | Delete
<?php submit_button( __( 'Publish' ), 'primary large', 'publish', false ); ?>
[358] Fix | Delete
<?php
[359] Fix | Delete
endif;
[360] Fix | Delete
else :
[361] Fix | Delete
?>
[362] Fix | Delete
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Submit for Review' ); ?>" />
[363] Fix | Delete
<?php submit_button( __( 'Submit for Review' ), 'primary large', 'publish', false ); ?>
[364] Fix | Delete
<?php
[365] Fix | Delete
endif;
[366] Fix | Delete
} else {
[367] Fix | Delete
?>
[368] Fix | Delete
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Update' ); ?>" />
[369] Fix | Delete
<?php submit_button( __( 'Update' ), 'primary large', 'save', false, array( 'id' => 'publish' ) ); ?>
[370] Fix | Delete
<?php
[371] Fix | Delete
}
[372] Fix | Delete
?>
[373] Fix | Delete
</div>
[374] Fix | Delete
<div class="clear"></div>
[375] Fix | Delete
</div>
[376] Fix | Delete
[377] Fix | Delete
</div>
[378] Fix | Delete
<?php
[379] Fix | Delete
}
[380] Fix | Delete
[381] Fix | Delete
/**
[382] Fix | Delete
* Display attachment submit form fields.
[383] Fix | Delete
*
[384] Fix | Delete
* @since 3.5.0
[385] Fix | Delete
*
[386] Fix | Delete
* @param WP_Post $post
[387] Fix | Delete
*/
[388] Fix | Delete
function attachment_submit_meta_box( $post ) {
[389] Fix | Delete
?>
[390] Fix | Delete
<div class="submitbox" id="submitpost">
[391] Fix | Delete
[392] Fix | Delete
<div id="minor-publishing">
[393] Fix | Delete
[394] Fix | Delete
<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key. ?>
[395] Fix | Delete
<div style="display:none;">
[396] Fix | Delete
<?php submit_button( __( 'Save' ), '', 'save' ); ?>
[397] Fix | Delete
</div>
[398] Fix | Delete
[399] Fix | Delete
[400] Fix | Delete
<div id="misc-publishing-actions">
[401] Fix | Delete
<div class="misc-pub-section curtime misc-pub-curtime">
[402] Fix | Delete
<span id="timestamp">
[403] Fix | Delete
<?php
[404] Fix | Delete
$uploaded_on = sprintf(
[405] Fix | Delete
/* translators: Publish box date string. 1: Date, 2: Time. See https://www.php.net/manual/datetime.format.php */
[406] Fix | Delete
__( '%1$s at %2$s' ),
[407] Fix | Delete
/* translators: Publish box date format, see https://www.php.net/manual/datetime.format.php */
[408] Fix | Delete
date_i18n( _x( 'M j, Y', 'publish box date format' ), strtotime( $post->post_date ) ),
[409] Fix | Delete
/* translators: Publish box time format, see https://www.php.net/manual/datetime.format.php */
[410] Fix | Delete
date_i18n( _x( 'H:i', 'publish box time format' ), strtotime( $post->post_date ) )
[411] Fix | Delete
);
[412] Fix | Delete
/* translators: Attachment information. %s: Date the attachment was uploaded. */
[413] Fix | Delete
printf( __( 'Uploaded on: %s' ), '<b>' . $uploaded_on . '</b>' );
[414] Fix | Delete
?>
[415] Fix | Delete
</span>
[416] Fix | Delete
</div><!-- .misc-pub-section -->
[417] Fix | Delete
[418] Fix | Delete
<?php
[419] Fix | Delete
/**
[420] Fix | Delete
* Fires after the 'Uploaded on' section of the Save meta box
[421] Fix | Delete
* in the attachment editing screen.
[422] Fix | Delete
*
[423] Fix | Delete
* @since 3.5.0
[424] Fix | Delete
* @since 4.9.0 Added the `$post` parameter.
[425] Fix | Delete
*
[426] Fix | Delete
* @param WP_Post $post WP_Post object for the current attachment.
[427] Fix | Delete
*/
[428] Fix | Delete
do_action( 'attachment_submitbox_misc_actions', $post );
[429] Fix | Delete
?>
[430] Fix | Delete
</div><!-- #misc-publishing-actions -->
[431] Fix | Delete
<div class="clear"></div>
[432] Fix | Delete
</div><!-- #minor-publishing -->
[433] Fix | Delete
[434] Fix | Delete
<div id="major-publishing-actions">
[435] Fix | Delete
<div id="delete-action">
[436] Fix | Delete
<?php
[437] Fix | Delete
if ( current_user_can( 'delete_post', $post->ID ) ) {
[438] Fix | Delete
if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {
[439] Fix | Delete
echo "<a class='submitdelete deletion' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Move to Trash' ) . '</a>';
[440] Fix | Delete
} else {
[441] Fix | Delete
$delete_ays = ! MEDIA_TRASH ? " onclick='return showNotice.warn();'" : '';
[442] Fix | Delete
echo "<a class='submitdelete deletion'$delete_ays href='" . get_delete_post_link( $post->ID, null, true ) . "'>" . __( 'Delete permanently' ) . '</a>';
[443] Fix | Delete
}
[444] Fix | Delete
}
[445] Fix | Delete
?>
[446] Fix | Delete
</div>
[447] Fix | Delete
[448] Fix | Delete
<div id="publishing-action">
[449] Fix | Delete
<span class="spinner"></span>
[450] Fix | Delete
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Update' ); ?>" />
[451] Fix | Delete
<input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update' ); ?>" />
[452] Fix | Delete
</div>
[453] Fix | Delete
<div class="clear"></div>
[454] Fix | Delete
</div><!-- #major-publishing-actions -->
[455] Fix | Delete
[456] Fix | Delete
</div>
[457] Fix | Delete
[458] Fix | Delete
<?php
[459] Fix | Delete
}
[460] Fix | Delete
[461] Fix | Delete
/**
[462] Fix | Delete
* Display post format form elements.
[463] Fix | Delete
*
[464] Fix | Delete
* @since 3.1.0
[465] Fix | Delete
*
[466] Fix | Delete
* @param WP_Post $post Post object.
[467] Fix | Delete
* @param array $box {
[468] Fix | Delete
* Post formats meta box arguments.
[469] Fix | Delete
*
[470] Fix | Delete
* @type string $id Meta box 'id' attribute.
[471] Fix | Delete
* @type string $title Meta box title.
[472] Fix | Delete
* @type callable $callback Meta box display callback.
[473] Fix | Delete
* @type array $args Extra meta box arguments.
[474] Fix | Delete
* }
[475] Fix | Delete
*/
[476] Fix | Delete
function post_format_meta_box( $post, $box ) {
[477] Fix | Delete
if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) ) :
[478] Fix | Delete
$post_formats = get_theme_support( 'post-formats' );
[479] Fix | Delete
[480] Fix | Delete
if ( is_array( $post_formats[0] ) ) :
[481] Fix | Delete
$post_format = get_post_format( $post->ID );
[482] Fix | Delete
if ( ! $post_format ) {
[483] Fix | Delete
$post_format = '0';
[484] Fix | Delete
}
[485] Fix | Delete
// Add in the current one if it isn't there yet, in case the current theme doesn't support it.
[486] Fix | Delete
if ( $post_format && ! in_array( $post_format, $post_formats[0], true ) ) {
[487] Fix | Delete
$post_formats[0][] = $post_format;
[488] Fix | Delete
}
[489] Fix | Delete
?>
[490] Fix | Delete
<div id="post-formats-select">
[491] Fix | Delete
<fieldset>
[492] Fix | Delete
<legend class="screen-reader-text"><?php _e( 'Post Formats' ); ?></legend>
[493] Fix | Delete
<input type="radio" name="post_format" class="post-format" id="post-format-0" value="0" <?php checked( $post_format, '0' ); ?> /> <label for="post-format-0" class="post-format-icon post-format-standard"><?php echo get_post_format_string( 'standard' ); ?></label>
[494] Fix | Delete
<?php foreach ( $post_formats[0] as $format ) : ?>
[495] Fix | Delete
<br /><input type="radio" name="post_format" class="post-format" id="post-format-<?php echo esc_attr( $format ); ?>" value="<?php echo esc_attr( $format ); ?>" <?php checked( $post_format, $format ); ?> /> <label for="post-format-<?php echo esc_attr( $format ); ?>" class="post-format-icon post-format-<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></label>
[496] Fix | Delete
<?php endforeach; ?>
[497] Fix | Delete
</fieldset>
[498] Fix | Delete
</div>
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function