Created
April 3, 2020 10:05
-
-
Save MaximeCulea/27f36c41381eb15f177a571644606a70 to your computer and use it in GitHub Desktop.
Allow to download a lang despite DISALLOW_FILE_MODS to true
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Allow to download a lang despite DISALLOW_FILE_MODS to true | |
* @author Maxime Culea | |
*/ | |
add_filter( 'file_mod_allowed', function ( $value, $context ) { | |
if ( $context == 'can_install_language_pack' ) { | |
return true; | |
} | |
return $value; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment