wordpress错误日志出现Catchable fatal error: Object of class WP_Error could not be converted to string的解决办法

付费节点推荐


免费节点


节点使用教程


最近查看wordpress的错误日志时发现有这样的提示:Catchable fatal error: Object of class WP_Error could not be converted to string,于是苦心搜索找到了解决办法

该问题是因为网页没有分类导致get_category_parents($categories[0]->term_id, TRUE, ‘ > ‘)获取错误,于是按照以下方式修改就行了。

将get_category_parents($categories[0]->term_id, TRUE, ‘ > ‘)修改为

is_wp_error($cat_parents=get_category_parents($categories[0]->term_id, TRUE, ‘ > ‘))?””:$cat_parents)即可

未经允许不得转载:Bcoder资源网 » wordpress错误日志出现Catchable fatal error: Object of class WP_Error could not be converted to string的解决办法

相关推荐

更多优质资源关注微信公众号: bcoder

bcoder
赞 (5)
分享到:更多 ()

评论 0

评论前必须登录!

登陆 注册