diff --git bp-core/bp-core-functions.php bp-core/bp-core-functions.php
index affe353..2f10822 100644
|
|
function bp_verify_nonce_request( $action = '', $query_arg = '_wpnonce' ) { |
1316 | 1316 | * @package BuddyPress Core |
1317 | 1317 | */ |
1318 | 1318 | function bp_core_load_buddypress_textdomain() { |
1319 | | $locale = apply_filters( 'buddypress_locale', get_locale() ); |
1320 | | $mofile = sprintf( 'buddypress-%s.mo', $locale ); |
1321 | | $mofile_global = WP_LANG_DIR . '/' . $mofile; |
1322 | | $mofile_local = BP_PLUGIN_DIR . 'bp-languages/' . $mofile; |
1323 | | |
1324 | | if ( file_exists( $mofile_global ) ) |
1325 | | return load_textdomain( 'buddypress', $mofile_global ); |
1326 | | elseif ( file_exists( $mofile_local ) ) |
1327 | | return load_textdomain( 'buddypress', $mofile_local ); |
1328 | | else |
1329 | | return false; |
| 1319 | // Try to load via load_plugin_textdomain() first, for future |
| 1320 | // wordpress.org translation downloads |
| 1321 | if ( load_plugin_textdomain( 'buddypress', false, 'buddypress/bp-languages' ) ) { |
| 1322 | return true; |
| 1323 | } |
| 1324 | |
| 1325 | // Nothing found in bp-languages, so try to load from WP_LANG_DIR |
| 1326 | $locale = apply_filters( 'buddypress_locale', get_locale() ); |
| 1327 | $mofile = WP_LANG_DIR . '/buddypress-' . $locale . '.mo'; |
| 1328 | |
| 1329 | return load_textdomain( 'buddypress', $mofile ); |
1330 | 1330 | } |
1331 | 1331 | add_action ( 'bp_core_loaded', 'bp_core_load_buddypress_textdomain' ); |
1332 | 1332 | |