Skip to content

Instantly share code, notes, and snippets.

@imath
Last active September 20, 2016 08:02
Show Gist options
  • Save imath/4490df55cb4e6c3e12ac1e896c68ba77 to your computer and use it in GitHub Desktop.
Save imath/4490df55cb4e6c3e12ac1e896c68ba77 to your computer and use it in GitHub Desktop.
put this in any random file into /wp-content/mu-plugins/ to get your custom language files back in bbPress
<?php
// Exit if accessed directly
defined( 'ABSPATH' ) || exit;
function fix_bbpress_custom_language_packs( $bbpress = null ) {
// No need to perform this action, it's too late!
remove_action( 'bbp_load_textdomain', array( $bbpress, 'load_textdomain' ), 5 );
/**
* To be sure the custom language pack is loaded, let's be the first to load the textdomain
*
* NB: bbp_loaded is hooking 'plugins_loaded' at 10. Hooking 'plugins_loaded' later than 10
* won't load the custom language pack
*/
add_action( 'bbp_loaded', array( $bbpress, 'load_textdomain' ), 0 );
}
add_action( 'bbp_after_setup_actions', 'fix_bbpress_custom_language_packs', 10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment