Problem:
Installing Simple Tags (1.5.7) on WordPress with Gengo (2.5.3) results in a classic localization problem:
Fatal error: Call to a member function on a non-object in [...]/wp-includes/classes.php on line 38
Solution:
Open [...]/wp-content/plugins/simple-tags/2.5/simple-tags.client.php and find in SimpleTags() function:
// Localization
$locale = get_locale();
if ( !empty( $locale ) ) {
$mofile = str_replace('/2.5', '', $this->info['install_dir'])
.'/languages/simpletags-'.$locale.'.mo';
load_textdomain('simpletags', $mofile);
}
Remove this part and place it in a separate function (just before add_action(‘plugins_loaded’, ‘st_init’);) like this:
function locale_init() {
global $simple_tags;
// Localization
$locale = get_locale();
if ( !empty( $locale ) ) {
$mofile = str_replace('/2.5', '', $simple_tags->info['install_dir']).
'/languages/simpletags-'.$locale.'.mo';
load_textdomain('simpletags', $mofile);
}
}
After add_action(‘plugins_loaded’, ‘st_init’); add this line:
add_action('init', 'locale_init');
This way the localization part gets postponed till Gengo establishes all the needed stuff. Use at your own risk – not thoroughly tested yet.






Recent Comments