$url = "http://192.168.201.214/wordpress/?json=posts/create_post&dev=1&nonce=".$_POST["nonace"].
"&title=".$_POST["title"]."&content=".$_POST["content"]."&slug=".$_POST["title"]."&status=draft";
//echo $url; exit;
$ch=curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIESESSION, false);
$r=curl_exec($ch);
curl_close($ch);
echo "<pre>";
$ar=json_decode($r);
//print_r($ar);
echo "status ------------------------------ ".$ar->status."<br>";
echo "Link ------------------------------ ".$ar->post->url."<br>";
这是我创建帖子的代码,一切都很好,但当我在标题或内容中创建一篇带有空格的帖子时,它只考虑第一个单词,而不考虑reamining
示例:没有空格的内容
在我返回的json对象中
"status": "draft",
"title": "sivaji",
"title_plain": "sivaji",
"content": "<p>ThisIsVeryGood<\\/p>\\n",
示例:带空格的内容
在我返回的json对象中
"status": "draft",
"title": "sivaji",
"title_plain": "sivaji",
"content": "<p>This<\\/p>\\n"
Iam使用ajax调用和文本框发布内容