I18N: Remove JSON translations when deleting a theme or a plugin.
See #29860. Fixes #45467. Built from https://develop.svn.wordpress.org/trunk@44675 git-svn-id: http://core.svn.wordpress.org/trunk@44506 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7daa39eb1d
commit
1c0849c2b2
|
@ -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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.1-beta1-44674';
|
||||
$wp_version = '5.1-beta1-44675';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue