百度推送Wordpress代码
//WordPress百度主动推送功能
add_action('save_post', 'fanly_save_post_notify_baidu_zz', 10, 3);
function fanly_save_post_notify_baidu_zz(\(post_id, \)post, \(update){
if(\)post->post_status != 'publish') return;
$baidu_zz_api_url ='http://data.zz.baidu.com/urls?site=geelun.com&token=你百度统计的token值';
//请到百度站长后台获取你的站点的专属提交链接
\(response = wp_remote_post(\)baidu_zz_api_url, array(
'headers' => array('Accept-Encoding'=>'','Content-Type'=>'text/plain'),
'sslverify' => false,
'blocking' => false,
'body' => get_permalink($post_id)
));
© 著作权归作者所有
文章评论(0)