Php Curl post to Wordpress删除我的<;视频>&书信电报;来源>;标签

Php Curl post to Wordpress删除我的<;视频>&书信电报;来源>;标签,php,wordpress,curl,oauth,html5-video,Php,Wordpress,Curl,Oauth,Html5 Video,我目前正在从我的软件发布到Wordpress。到目前为止,我在通过我的帖子传递任何文本或html标记时都没有遇到任何问题。由于某种原因,每当我的代码被发布到Wordpress时,我就会丢失该代码中的标记 以下是我试图传递给Wordpress的内容的样子。 <video controls="controls" height="1440" id="248" poster="" width="1920"><source src="http://virpublisher.info/wp

我目前正在从我的软件发布到Wordpress。到目前为止,我在通过我的帖子传递任何文本或html标记时都没有遇到任何问题。由于某种原因,每当我的
代码被发布到Wordpress时,我就会丢失该代码中的
标记

以下是我试图传递给Wordpress的内容的样子。

<video controls="controls" height="1440" id="248" poster="" width="1920"><source src="http://virpublisher.info/wp-content/uploads/2016/04/GOPR0241.mp4" type="video/mp4" />Your browser does not support the video tag</video>
日志记录:

$qParams    = array(
                'access_token' => $at,
                'title'=>$title,
                'content'=>$content,
                'excerpt'=>$excerpt,
                'status'=>$wpStatus,
                'categories'=>$wpCategories,
                'featured_media'=>$wpFeaturedMediaId);

Util::error_log('====ARTICLE POST PARAMS===');
Util::debugArr($qParams);

$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$postUrl);
curl_setopt($ch,CURLOPT_POST, 1);
curl_setopt($ch,CURLOPT_POSTFIELDS,http_build_query($qParams)); //I seem to lose my <source> tag here
curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
$resp = curl_exec($ch);
curl_close ($ch);

Util::error_log('====RESP DEBUG===');
Util::debugArr($resp);

$resp = Util::jsonDecode($resp);
[14-Apr-2016 14:16:51 America/Chicago] INFO: ====ARTICLE POST PARAMS===
[14-Apr-2016 14:16:51 America/Chicago] ==== START debugArr: ====
[14-Apr-2016 14:16:51 America/Chicago] Array(
[access_token] => fjeter5hjhiyezhrvhcy7o1mogavbmadoos5n745
[title] => Mountain Biking
[content] => <video controls="controls" height="1440" id="248" poster="" width="1920"><source src="http://virpublisher.info/wp-content/uploads/2016/04/GOPR0241.mp4" type="video/mp4" />Your browser does not support the video tag</video>
[excerpt] => 
[status] => draft
[categories] => Array
    (
    )
[featured_media] => 174
)
[14-Apr-2016 14:16:51 America/Chicago] ==== END debugArr: ====


[14-Apr-2016 14:16:53 America/Chicago] INFO: ====RESP DEBUG===
[14-Apr-2016 14:16:53 America/Chicago] ==== START debugArr: ====
[14-Apr-2016 14:16:53 America/Chicago] {"id":286,"date":"2016-04-14T19:16:53","date_gmt":null,"guid":{"rendered":"http:\/\/virpublisher.info?p=286&#038;preview_id=286","raw":"http:\/\/virpublisher.info?p=286&#038;preview_id=286"},"modified":"2016-04-14T19:16:53","modified_gmt":"2016-04-14T19:16:53","password":"","slug":"mountain-biking-2","status":"draft","type":"post","link":"http:\/\/virpublisher.info?p=286&preview_id=286","title":{"raw":"Mountain Biking","rendered":"Mountain Biking"},"content":{"raw":"<video controls=\"controls\" height=\"1440\" id=\"248\" poster=\"\" width=\"1920\">Your browser does not support the video tag<\/video>\n","rendered":"<p><video controls=\"controls\" height=\"1440\" id=\"248\" poster=\"\" width=\"1920\">Your browser does not support the video tag<\/video><\/p>\n"},"excerpt":{"raw":"","rendered":"<p>Your browser does not support the video tag<\/p>\n"},"author":1,"featured_media":174,"comment_status":"closed","ping_status":"open","sticky":false,"format":"standard","categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/virpublisher.info\/wp-json\/wp\/v2\/posts\/286"}],"collection":[{"href":"http:\/\/virpublisher.info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/virpublisher.info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/virpublisher.info\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/virpublisher.info\/wp-json\/wp\/v2\/comments?post=286"}],"version-history":[{"href":"http:\/\/virpublisher.info\/wp-json\/wp\/v2\/posts\/286\/revisions"}],"https:\/\/api.w.org\/featuredmedia":[{"embeddable":true,"href":"http:\/\/virpublisher.info\/wp-json\/wp\/v2\/media\/174"}],"https:\/\/api.w.org\/attachment":[{"href":"http:\/\/virpublisher.info\/wp-json\/wp\/v2\/media?parent=286"}],"https:\/\/api.w.org\/term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/virpublisher.info\/wp-json\/wp\/v2\/categories?post=286"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/virpublisher.info\/wp-json\/wp\/v2\/tags?post=286"}]}}
[14-Apr-2016 14:16:51美国/芝加哥]信息:==文章发布参数===
[2016年4月14日14:16:51美国/芝加哥]===开始调试:====
[14-Apr-2016 14:16:51美国/芝加哥]阵列(
[访问令牌]=>FJETER5HJHIYEZHRVHCY7O1Mogavmados5N745
[标题]=>山地自行车赛
[内容]=>您的浏览器不支持视频标签
[摘录]=>
[状态]=>草稿
[类别]=>数组
(
)
[特色媒体]=>174
)
[2016年4月14日14:16:51美国/芝加哥]===调试结束:====
[14-Apr-2016 14:16:53美国/芝加哥]信息:===响应调试===
[2016年4月14日14:16:53美国/芝加哥]==开始调试:====
[14-Apr-2016 14:16:53 America/Chicago]{“id”:286,“date”:“2016-04-14T19:16:53”,“date\u gmt”:null,“guid”:“rendered”:“http:\/\/virpublisher.info?p=286&;preview\u id=286”,“raw”:“http:\/\/\/virpublisher.info?p=286&358;preview\u id=286”;“modified”:“2016-04-14T19:16:53”,“modified u gmt”:“2016-04-14T19:53”,“mountain”;“mountain”;“mountain-status”:“mountain”;“mountain”;“mountain”;“mountain”;“mountain”:“草稿”,“键入”:“发布”,“链接”:“http:\/\/virpublisher.info?p=286&preview\u id=286”,“标题”:{“原始”:“山地自行车”,“渲染”:“山地自行车”},“内容”:{“原始”:“您的浏览器不支持视频标记”\n”,“渲染”:“您的浏览器不支持视频标记”},“摘录”:{“原始”:“渲染”:”您的浏览器不支持视频标签\n“},“作者”:1,“特色媒体”:174,“评论状态”:“关闭”,“ping\u状态”:“打开”,“粘滞”:false,“格式”:“标准”,“类别”:[1],“标签”:[],“\u链接”:{“自我”:[{”href:“http:\/\/virpublisher.info\/wp json\/wp\/v2\/posts\/286”,“收藏”:[{“href”:”http:\/\/virpublisher.info\/wp json\/wp\/v2\/posts“}],“关于”[{“href”:“http:\/\/virpublisher.info\/wp json\/wp\/v2\/types\/post”}],“作者”:[{“可嵌入的”:true,“href”:“http:\/\/virpublisher.info\/wp json\/wp\/v2\/users\/1”}],“回复”:[{“可嵌入的”:true,“href”:“http:/\/virpublisher.info\/wp json\/wp\/v2 post”[{“href”:“http:\/\/virpublisher.info\/wp-json\/wp\/v2\/posts\/286\/revisions”;“https:\/\/api.w.org\/featuredmedia:[{“Embeddeble”:true,“href”:“http:\/\/virpublisher.info\/wp-json\/wp\/v2\/media\/174”;“https:\/\/api.w.org\/attachment:[{“href”:“http:\/\/virpublisher.info\/wp\/wp\/media\/wp\/wp\/v2”;“http:/api.org”;“http:///wp\/wp\/wp\/v2分类法“:“category”,“embeddeble”:true,“href”:“http:\/\/virpublisher.info\/wp json\/wp\/v2\/categories?post=286”},{“taxonomy”:“post\u tag”,“embeddeble”:true,“href”:“http:\/\/virpublisher.info\/wp json\/wp\/v2\/tags?post=286”}”

我敢打赌,破坏内容的既不是
http\u build\u query
也不是cURL。可能WordPress正在进行的一些HTML过滤正在删除它。可能是因为缺少结束标记(这是不需要的)尽管如此,它还是被剥离了。你在WordPress中调用了什么API端点或RPC方法?@drew010很遗憾,我单独记录了http_build_查询,其中还包含源代码标记。我正在使用OAuth服务器WordPress插件和REST API。这看起来是在帖子的响应中发生的。我试图弄清楚为什么dpress可以做到这一点。每当我手动将视频代码添加到Wordpress并保存在UI中时,它都会包含源标记,没有问题。我还尝试了以下格式,该格式也去除了源标记。我还尝试了容器中的其他类型的标记,例如,

,它们都保留了下来。
[14-Apr-2016 14:16:51 America/Chicago] INFO: ====ARTICLE POST PARAMS===
[14-Apr-2016 14:16:51 America/Chicago] ==== START debugArr: ====
[14-Apr-2016 14:16:51 America/Chicago] Array(
[access_token] => fjeter5hjhiyezhrvhcy7o1mogavbmadoos5n745
[title] => Mountain Biking
[content] => <video controls="controls" height="1440" id="248" poster="" width="1920"><source src="http://virpublisher.info/wp-content/uploads/2016/04/GOPR0241.mp4" type="video/mp4" />Your browser does not support the video tag</video>
[excerpt] => 
[status] => draft
[categories] => Array
    (
    )
[featured_media] => 174
)
[14-Apr-2016 14:16:51 America/Chicago] ==== END debugArr: ====


[14-Apr-2016 14:16:53 America/Chicago] INFO: ====RESP DEBUG===
[14-Apr-2016 14:16:53 America/Chicago] ==== START debugArr: ====
[14-Apr-2016 14:16:53 America/Chicago] {"id":286,"date":"2016-04-14T19:16:53","date_gmt":null,"guid":{"rendered":"http:\/\/virpublisher.info?p=286&#038;preview_id=286","raw":"http:\/\/virpublisher.info?p=286&#038;preview_id=286"},"modified":"2016-04-14T19:16:53","modified_gmt":"2016-04-14T19:16:53","password":"","slug":"mountain-biking-2","status":"draft","type":"post","link":"http:\/\/virpublisher.info?p=286&preview_id=286","title":{"raw":"Mountain Biking","rendered":"Mountain Biking"},"content":{"raw":"<video controls=\"controls\" height=\"1440\" id=\"248\" poster=\"\" width=\"1920\">Your browser does not support the video tag<\/video>\n","rendered":"<p><video controls=\"controls\" height=\"1440\" id=\"248\" poster=\"\" width=\"1920\">Your browser does not support the video tag<\/video><\/p>\n"},"excerpt":{"raw":"","rendered":"<p>Your browser does not support the video tag<\/p>\n"},"author":1,"featured_media":174,"comment_status":"closed","ping_status":"open","sticky":false,"format":"standard","categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/virpublisher.info\/wp-json\/wp\/v2\/posts\/286"}],"collection":[{"href":"http:\/\/virpublisher.info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/virpublisher.info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/virpublisher.info\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/virpublisher.info\/wp-json\/wp\/v2\/comments?post=286"}],"version-history":[{"href":"http:\/\/virpublisher.info\/wp-json\/wp\/v2\/posts\/286\/revisions"}],"https:\/\/api.w.org\/featuredmedia":[{"embeddable":true,"href":"http:\/\/virpublisher.info\/wp-json\/wp\/v2\/media\/174"}],"https:\/\/api.w.org\/attachment":[{"href":"http:\/\/virpublisher.info\/wp-json\/wp\/v2\/media?parent=286"}],"https:\/\/api.w.org\/term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/virpublisher.info\/wp-json\/wp\/v2\/categories?post=286"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/virpublisher.info\/wp-json\/wp\/v2\/tags?post=286"}]}}