WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/03/2017 05:12:41 PM (4 years ago)
Author:
johnbillion
Message:

Plugins: Introduce a singular and plural form for the plugin deletion error message.

Props eddhurst, SergeyBiryukov

Fixes #38918

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/plugin.php

    r41671 r41713  
    892892    }
    893893
    894     if ( ! empty($errors) )
    895         return new WP_Error('could_not_remove_plugin', sprintf(__('Could not fully remove the plugin(s) %s.'), implode(', ', $errors)) );
     894    if ( ! empty( $errors ) ) {
     895        if ( 1 === count( $errors ) ) {
     896            /* translators: %s: plugin filename */
     897            $message = __( 'Could not fully remove the plugin %s.' );
     898        } else {
     899            /* translators: %s: comma-separated list of plugin filenames */
     900            $message = __( 'Could not fully remove the plugins %s.' );
     901        }
     902
     903        return new WP_Error( 'could_not_remove_plugin', sprintf( $message, implode( ', ', $errors ) ) );
     904    }
    896905
    897906    return true;
Note: See TracChangeset for help on using the changeset viewer.