Created
February 15, 2015 18:40
-
-
Save r-a-y/86a0c7416b6f43884ed4 to your computer and use it in GitHub Desktop.
Disable automatic translations by WordPress.org / GlotPress for BuddyPress.
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: BP Disable Auto Translation | |
Description: Disables automatic translations by WordPress.org / GlotPress for BuddyPress. | |
Author: r-a-y | |
License: GPLv2 or later | |
*/ | |
/** | |
* Disables automatic translations for BuddyPress. | |
* | |
* @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 ray_disable_bp_auto_translation( $retval, $item ) { | |
// disable automatic translations for BuddyPress | |
if ( 'plugin' === $item->type && 'buddypress' === $item->slug ) { | |
return false; | |
} | |
return $retval; | |
} | |
add_filter( 'auto_update_translation', 'ray_disable_bp_auto_translation', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great !