临时解决baidusubmit在SAE上面WordPress中提交或修改文章报错现象

最初的baidusubmit插件,安装验证网址之后,当提交或者修改文章的时候会报如下错误:

[php]Catchable fatal error: Argument 1 passed to BaidusubmitSitemap::filterContent() must be an instance of WP_Post, instance of stdClass given, called in /wp-content/plugins/baidusubmit/inc/sitemap.php on line 427 and defined in wp-content/plugins/baidusubmit/inc/sitemap.php on line 87[/php]

观察代码之后,var_dump输出,确定已经获取到数据,但是并不是WP_Post的静态实例,尝试强制转换未生效,临时的解决方案是将inc/sitemap中第87行去掉强制转换修改为如下

[php]
static function filterContent(post, &multimedia)
[/php]

5条留言
  1. 过来支持一下,期待回访!

  2. 百度sitemap你有提交记录吗?在sae上