Home > Software engineering >  PHP Fatal error: Uncaught Error: Object of class mcs_subdomain could not be converted to string in W
PHP Fatal error: Uncaught Error: Object of class mcs_subdomain could not be converted to string in W

Time:05-29

please help.

There is a PHP Error Message that comes from a Plugin.

PHP Fatal error: Uncaught Error: Object of class mcs_subdomain could not be converted to string

public function bloginfo_url($output, $show ) {

    if('url' == $show)
        return $this->$this->subdomain_home;
    
    if( $show == 'rdf_url' || $show == 'rss_url' || $show == 'rss2_url' || $show == 'atom_url') {
        return $this->replace_to_subdomain_link( $this->subdomain->slug, $output );
    }
        
    return $output;
}

this code error "return $this->$this->subdomain_home;"

How to Fix.

CodePudding user response:

return $this->subdomain_home;

Just remove extra "$this->"

  • Related