do_action( 'deleted_theme',
$stylesheet,
$deleted );
if ( !
$deleted ) { return new WP_Error( 'could_not_remove_theme',
/* translators: %s: Theme name. */
sprintf( __( 'Could not fully remove the theme %s.'
),
$stylesheet ) );
} $theme_translations =
wp_get_installed_translations( 'themes'
);
// Remove language files, silently.
if ( !
empty( $theme_translations[ $stylesheet ] ) ) { $translations =
$theme_translations[ $stylesheet ];
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 ) {