mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-01 11:14:36 +00:00
Plugins: Introduce a singular and plural form for the plugin deletion error message.
Props eddhurst, SergeyBiryukov Fixes #38918 git-svn-id: https://develop.svn.wordpress.org/trunk@41713 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -891,8 +891,17 @@ function delete_plugins( $plugins, $deprecated = '' ) {
|
||||
set_site_transient( 'update_plugins', $current );
|
||||
}
|
||||
|
||||
if ( ! empty($errors) )
|
||||
return new WP_Error('could_not_remove_plugin', sprintf(__('Could not fully remove the plugin(s) %s.'), implode(', ', $errors)) );
|
||||
if ( ! empty( $errors ) ) {
|
||||
if ( 1 === count( $errors ) ) {
|
||||
/* translators: %s: plugin filename */
|
||||
$message = __( 'Could not fully remove the plugin %s.' );
|
||||
} else {
|
||||
/* translators: %s: comma-separated list of plugin filenames */
|
||||
$message = __( 'Could not fully remove the plugins %s.' );
|
||||
}
|
||||
|
||||
return new WP_Error( 'could_not_remove_plugin', sprintf( $message, implode( ', ', $errors ) ) );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user