WordPress: Require wp-blog-header “Object of class LocaleMap could not be converted to string” in l10n.php

I’m trying to add a wordpress blog to a company website. I’ve got my website files in the folder mySite in rootFolder. I’ve installed wordpress in another folder called wordpress in that same rootFolder. Using xampp I have changed DocumentRoot & < Directory> in httpd.config from htdocs to my rootFolder.

I’ve created a new file called blog.php in the mySite folder.
When I try to run <?php require('../wordpress/wp-blog-header.php');?> on my blog page (localhost/mySite/blog) I get this error message:

Read More

Catchable fatal error: Object of class LocaleMap could not be converted to string in C: (…)rootFolderwordpresswp-includesl10n.php on line 558

The relevant code in l10n.php looks like this:

function load_default_textdomain( $locale = null ) {
if ( null === $locale ) {
    $locale = get_locale();
}

// Unload previously loaded strings so we can switch translations.
unload_textdomain( 'default' );

$return = load_textdomain( 'default', WP_LANG_DIR . "/$locale.mo" );

The last line being from where the fatal error originates, apparently.

I have no idea what the problem is here. Is it about the language settings or does it have something to do with the linking of the wp-blog-header.php? Or something else entirely?

Related posts

1 comment

  1. Okay, I’ve solved it.
    It was one of our own global variables (used on the site) with the same name that replaced the $locale which wp-blog-header was looking for. Once I changed our own variable’s name, things started working.

Comments are closed.