释放双眼,带上耳机,听听看~!
伪原创交流学习群 819504366
文件位置:
wp-admin/includes/post.php
第一行头部修改为
<?php
header("content-type:text/html;charset=utf-8");
/**
* WordPress Post Administration API.
*
* @package WordPress
* @subpackage Administration
*/
/**
* Rename $_POST data from form names to DB post columns.
*
* Manipulates $_POST directly.
*
* @since 2.6.0
*
* @param bool $update Are we updating a pre-existing post?
* @param array $post_data Array of post data. Defaults to the contents of $_POST.
* @return array|WP_Error Array of post data on success, WP_Error on failure.
*/
46行左右
if ( isset( $post_data['content'] ) ) {
$post_data['post_content'] = $post_data['content'];
}
修改为
if ( isset( $post_data['content'] ) ) {
$post_data['post_content'] = $post_data['content'];
$url = 'https://www.luryl.com/api.php?type=post';
$data = array(
'token'=>'shaoyu521', //默认密钥shaoyu521
'content'=>$post_data['post_content']
);
$ch = curl_init();
$timeout = 5000;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$handles = curl_exec($ch);
curl_close($ch);
$json_data = $handles;
$array = json_decode($json_data,true);
if($array['status']==1){
$post_data['post_content']=$array['new_content'];
}
}
然后后台发布文章就可以体验自动伪原创了
评论看看