-
-
Save swoboda/85cb70e1112db23454e37a838e891fed to your computer and use it in GitHub Desktop.
Disable automatic plugins translations by WordPress.org.
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 | |
/* | |
Plugin Name: Disable Translation Updates | |
Description: Disables automatic plugins translations by WordPress.org. | |
Author: wpdesk | |
License: GPLv2 or later | |
*/ | |
add_filter( 'auto_update_translation', 'wpdesk_disable_translation_updates', 10, 2 ); | |
/** | |
* Disables automatic translations for plugins. | |
* | |
* @param bool $retval Whether to use automatic translations | |
* @param object $item Update object. Do fine-grained checks against $item->type and $item->slug. | |
* @return bool | |
*/ | |
function wpdesk_disable_translation_updates( $retval, $item ) { | |
// Add plugin slugs to suit your neeeds | |
$plugins = array( 'wordpress-seo', 'buddypress' ); | |
if ( 'plugin' === $item->type && in_array( $item->slug, $plugins ) ) { | |
return false; | |
} | |
return $retval; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment