rebase on oct-10-2023
This commit is contained in:
@@ -469,10 +469,20 @@ function attachment_submit_meta_box( $post ) {
|
||||
<?php
|
||||
if ( current_user_can( 'delete_post', $post->ID ) ) {
|
||||
if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {
|
||||
echo "<a class='submitdelete deletion' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Move to Trash' ) . '</a>';
|
||||
printf(
|
||||
'<a class="submitdelete deletion" href="%1$s">%2$s</a>',
|
||||
get_delete_post_link( $post->ID ),
|
||||
__( 'Move to Trash' )
|
||||
);
|
||||
} else {
|
||||
$delete_ays = ! MEDIA_TRASH ? " onclick='return showNotice.warn();'" : '';
|
||||
echo "<a class='submitdelete deletion'$delete_ays href='" . get_delete_post_link( $post->ID, '', true ) . "'>" . __( 'Delete permanently' ) . '</a>';
|
||||
$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' )
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1662,8 +1672,10 @@ function register_and_do_post_meta_boxes( $post ) {
|
||||
*/
|
||||
do_action_deprecated( 'dbx_post_advanced', array( $post ), '3.7.0', 'add_meta_boxes' );
|
||||
|
||||
// Allow the Discussion meta box to show up if the post type supports comments,
|
||||
// or if comments or pings are open.
|
||||
/*
|
||||
* Allow the Discussion meta box to show up if the post type supports comments,
|
||||
* or if comments or pings are open.
|
||||
*/
|
||||
if ( comments_open( $post ) || pings_open( $post ) || post_type_supports( $post_type, 'comments' ) ) {
|
||||
add_meta_box( 'commentstatusdiv', __( 'Discussion' ), 'post_comment_status_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );
|
||||
}
|
||||
@@ -1675,8 +1687,10 @@ function register_and_do_post_meta_boxes( $post ) {
|
||||
$stati[] = 'private';
|
||||
|
||||
if ( in_array( get_post_status( $post ), $stati, true ) ) {
|
||||
// If the post type support comments, or the post has comments,
|
||||
// allow the Comments meta box.
|
||||
/*
|
||||
* If the post type support comments, or the post has comments,
|
||||
* allow the Comments meta box.
|
||||
*/
|
||||
if ( comments_open( $post ) || pings_open( $post ) || $post->comment_count > 0 || post_type_supports( $post_type, 'comments' ) ) {
|
||||
add_meta_box( 'commentsdiv', __( 'Comments' ), 'post_comment_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user