Posts, Post Types: Clarify some "Error in deleting" messages, use more specific strings for attachments.

Props dingo_d.
See #50546.
Built from https://develop.svn.wordpress.org/trunk@48312


git-svn-id: http://core.svn.wordpress.org/trunk@48081 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2020-07-05 10:41:10 +00:00
parent 40a660461e
commit e0be0aef8b
4 changed files with 12 additions and 12 deletions

View File

@ -117,7 +117,7 @@ if ( $doaction ) {
} }
if ( ! wp_trash_post( $post_id ) ) { if ( ! wp_trash_post( $post_id ) ) {
wp_die( __( 'Error in moving to Trash.' ) ); wp_die( __( 'Error in moving the item to Trash.' ) );
} }
$trashed++; $trashed++;
@ -140,7 +140,7 @@ if ( $doaction ) {
} }
if ( ! wp_untrash_post( $post_id ) ) { if ( ! wp_untrash_post( $post_id ) ) {
wp_die( __( 'Error in restoring from Trash.' ) ); wp_die( __( 'Error in restoring the item from Trash.' ) );
} }
$untrashed++; $untrashed++;
@ -158,11 +158,11 @@ if ( $doaction ) {
if ( 'attachment' === $post_del->post_type ) { if ( 'attachment' === $post_del->post_type ) {
if ( ! wp_delete_attachment( $post_id ) ) { if ( ! wp_delete_attachment( $post_id ) ) {
wp_die( __( 'Error in deleting.' ) ); wp_die( __( 'Error in deleting the attachment.' ) );
} }
} else { } else {
if ( ! wp_delete_post( $post_id ) ) { if ( ! wp_delete_post( $post_id ) ) {
wp_die( __( 'Error in deleting.' ) ); wp_die( __( 'Error in deleting the item.' ) );
} }
} }
$deleted++; $deleted++;

View File

@ -258,7 +258,7 @@ switch ( $action ) {
} }
if ( ! wp_trash_post( $post_id ) ) { if ( ! wp_trash_post( $post_id ) ) {
wp_die( __( 'Error in moving to Trash.' ) ); wp_die( __( 'Error in moving the item to Trash.' ) );
} }
wp_redirect( wp_redirect(
@ -288,7 +288,7 @@ switch ( $action ) {
} }
if ( ! wp_untrash_post( $post_id ) ) { if ( ! wp_untrash_post( $post_id ) ) {
wp_die( __( 'Error in restoring from Trash.' ) ); wp_die( __( 'Error in restoring the item from Trash.' ) );
} }
wp_redirect( add_query_arg( 'untrashed', 1, $sendback ) ); wp_redirect( add_query_arg( 'untrashed', 1, $sendback ) );
@ -312,11 +312,11 @@ switch ( $action ) {
if ( 'attachment' === $post->post_type ) { if ( 'attachment' === $post->post_type ) {
$force = ( ! MEDIA_TRASH ); $force = ( ! MEDIA_TRASH );
if ( ! wp_delete_attachment( $post_id, $force ) ) { if ( ! wp_delete_attachment( $post_id, $force ) ) {
wp_die( __( 'Error in deleting.' ) ); wp_die( __( 'Error in deleting the attachment.' ) );
} }
} else { } else {
if ( ! wp_delete_post( $post_id, true ) ) { if ( ! wp_delete_post( $post_id, true ) ) {
wp_die( __( 'Error in deleting.' ) ); wp_die( __( 'Error in deleting the item.' ) );
} }
} }

View File

@ -156,7 +156,7 @@ if ( $doaction ) {
} }
if ( ! wp_trash_post( $post_id ) ) { if ( ! wp_trash_post( $post_id ) ) {
wp_die( __( 'Error in moving to Trash.' ) ); wp_die( __( 'Error in moving the item to Trash.' ) );
} }
} }
$location = add_query_arg( $location = add_query_arg(
@ -177,7 +177,7 @@ if ( $doaction ) {
} }
if ( ! wp_untrash_post( $post_id ) ) { if ( ! wp_untrash_post( $post_id ) ) {
wp_die( __( 'Error in restoring from Trash.' ) ); wp_die( __( 'Error in restoring the item from Trash.' ) );
} }
} }
$location = add_query_arg( 'untrashed', count( $post_ids ), $location ); $location = add_query_arg( 'untrashed', count( $post_ids ), $location );
@ -192,7 +192,7 @@ if ( $doaction ) {
} }
if ( ! wp_delete_attachment( $post_id_del ) ) { if ( ! wp_delete_attachment( $post_id_del ) ) {
wp_die( __( 'Error in deleting.' ) ); wp_die( __( 'Error in deleting the attachment.' ) );
} }
} }
$location = add_query_arg( 'deleted', count( $post_ids ), $location ); $location = add_query_arg( 'deleted', count( $post_ids ), $location );

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.5-alpha-48311'; $wp_version = '5.5-alpha-48312';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.