I18N: Remove JSON translations when deleting a theme or a plugin.
See #29860. Fixes #45467. git-svn-id: https://develop.svn.wordpress.org/trunk@44675 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
2caa621b0d
commit
51726c6092
@ -1048,6 +1048,11 @@ function delete_plugins( $plugins, $deprecated = '' ) {
|
||||
foreach ( $translations as $translation => $data ) {
|
||||
$wp_filesystem->delete( WP_LANG_DIR . '/plugins/' . $plugin_slug . '-' . $translation . '.po' );
|
||||
$wp_filesystem->delete( WP_LANG_DIR . '/plugins/' . $plugin_slug . '-' . $translation . '.mo' );
|
||||
|
||||
$json_translation_files = glob( WP_LANG_DIR . '/plugins/' . $plugin_slug . '-' . $translation . '-*.json' );
|
||||
if ( $json_translation_files ) {
|
||||
array_map( array( $wp_filesystem, 'delete' ), $json_translation_files );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -88,6 +88,11 @@ function delete_theme( $stylesheet, $redirect = '' ) {
|
||||
foreach ( $translations as $translation => $data ) {
|
||||
$wp_filesystem->delete( WP_LANG_DIR . '/themes/' . $stylesheet . '-' . $translation . '.po' );
|
||||
$wp_filesystem->delete( WP_LANG_DIR . '/themes/' . $stylesheet . '-' . $translation . '.mo' );
|
||||
|
||||
$json_translation_files = glob( WP_LANG_DIR . '/themes/' . $stylesheet . '-' . $translation . '-*.json' );
|
||||
if ( $json_translation_files ) {
|
||||
array_map( array( $wp_filesystem, 'delete' ), $json_translation_files );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user