Skip to content

Instantly share code, notes, and snippets.

@r-a-y
Created February 15, 2015 18:40
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save r-a-y/86a0c7416b6f43884ed4 to your computer and use it in GitHub Desktop.
Save r-a-y/86a0c7416b6f43884ed4 to your computer and use it in GitHub Desktop.
Disable automatic translations by WordPress.org / GlotPress for BuddyPress.
<?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 );
@Leeo97one
Copy link

Great !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment