首页 > 新闻资讯 > 如何解决Pingback失效的问题

如何解决Pingback失效的问题

1条评论
标签:
更多

从WordPress 2.7开始就有用户反映Pingback功能有时无法正常工作。 WordPress用请求函数wp-includes/cron.php (注意:请不要混淆wp-includes/cron.php函数与wp-cron.php函数)来运行Pingback,操作有0.01秒的时限,在某些环境下这个时间可能有点短。 大多数配置都能在这个时限下正常运行,因此WordPress开发人员没有特意改变时限,参见Trac ticket 8923

但到了WordPress 2.8,在某些安装环境下,Pingback问题仍然存在。 用户可以选择把时限从0.01改成1,之后Pingback就可以恢复正常了。 如果不想更改时限,那么只好保佑2.8.1版本能够修正这个问题了。

WordPress 2.8中的原始代码

$cron_url = get_option( 'siteurl' ) . '/wp-cron.php?doing_wp_cron';
wp_remote_post( $cron_url, array('timeout' => 0.01, 'blocking' => false, 'sslverify' => apply_filters('https_local_ssl_verify', true)) );

改变时限值后的代码

$cron_url = get_option( 'siteurl' ) . '/wp-cron.php?doing_wp_cron';
wp_remote_post( $cron_url, array('timeout' => 1, 'blocking' => false, 'sslverify' => apply_filters('https_local_ssl_verify', true)) );

原文:Ping Problem?

* 版权声明:作者WordPress啦! 转载请注明出处。

#1
seo tools 打酱油~~

发表新评论

此内容将保密,不会被其他人看见。
  • 自动将网址与电子邮件地址转变为链接。
  • 允许HTML标签:<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • 自动断行和分段。

更多关於格式化选项的信息

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.