fix Object of class WP_Post could not be converted to string

Today i was working on adding to a site french language using qtranslate  and i got this problem

Catchable fatal error: Object of class WP_Post could not be converted to string in ../wp-content/plugins/qtranslate/qtranslate_core.php on line 455

 

after some search i found the soultion it was simply in changing the qtranslate_core.php

(i know it is hard when u keep updating plugin but u can keep track by writing the changes in a file and put in the site directory )

 

as we said here  wp-content/plugins/qtranslate/qtranslate_core.php

before


function qtrans_dateFromPostForCurrentLanguage($old_date, $format ='', $before = '', $after = '') {

global $post;

 return qtrans_strftime(qtrans_convertDateFormat($format), mysql2date('U',$post->post_date), $old_date, $before, $after);

}

after


function qtrans_dateFromPostForCurrentLanguage($old_date, $format ='') {

global $post;

 return qtrans_strftime(qtrans_convertDateFormat($format), mysql2date('U',$post->post_date), $old_date);

}

we just removed ($before = '', $after = '' )

Advertisements

3 thoughts on “fix Object of class WP_Post could not be converted to string

Leave a Reply :)

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s