Plugins: Make sure Hello Dolly translations are deleted when the plugin is deleted.

Follow-up to [19965], [29856].

Props costdev, Otshelnik-Fm, JeffPaul, SergeyBiryukov.
Fixes #52817.

git-svn-id: https://develop.svn.wordpress.org/trunk@51064 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2021-06-02 15:11:54 +00:00
parent 39043f8799
commit e37b85fcd7

View File

@@ -999,8 +999,13 @@ function delete_plugins( $plugins, $deprecated = '' ) {
continue;
}
// Remove language files, silently.
$plugin_slug = dirname( $plugin_file );
if ( 'hello.php' === $plugin_file ) {
$plugin_slug = 'hello-dolly';
}
// Remove language files, silently.
if ( '.' !== $plugin_slug && ! empty( $plugin_translations[ $plugin_slug ] ) ) {
$translations = $plugin_translations[ $plugin_slug ];