. WordPress fast-tracks the API submission code (method: add the following code to the bottom of the fights.php file for your WordPress currently used theme, remember to add its own API interface address)./ WordPress fast-receiving API submission code
/ New 100-degree rapid call to api achieve receipt of add_action (‘save_post’, ‘fanly_baidu_dailysubmit’, 10, 3); funct_baidu_dailysubmit ($post_id, $post, $update) {$post->post_status != ‘publish’ || get_post_meta($post_id,’Fanly_Submit’,true)==’OK’) return;
$api = ‘GUwI6uKrTpu1q0T2’;//快速收录推送接口
$response = wp_remote_post($api, array(
‘headers’ => array(‘Accept-Encoding’=>”,’Content-Type’=>’text/plain’),
‘sslverify’ => false,
‘blocking’ => false,
‘body’ => get_permalink($post_id)
));
if ( !is_wp_error( $response ) ) {
$res = json_decode($response[‘body’], true);
if($res[‘success_daily’]==1)update_post_meta($post_id, ‘Fanly_Submit’, ‘OK’);// OK 避免重复提交
}
}
未经允许不得转载:萌萌Apprentissage » WordPress fast-tracks the API submission code SEO optimization.
Learn html_How websites work
WordPress Summary of Moving Methods: Migration of Hosts and Replacement of Domain Names
How to set auto-optimize auto-autoptimize plugins for your WordPress site
Installation and use of llinux environmentnode.js and npm install