[/code][attach]5236[/attach][[i] 本 ... WordPress Chinese Forums WordPress 中文论坛,致力于 WordPress 在中国的推广和发展 - Discuz! Archiver" />

查看完整版本: wordpress XML-RPC PHP发表带有html代码的文章

119977 2008-10-6 20:34

wordpress XML-RPC PHP发表带有html代码的文章

[code]<?php
  include("xmlrpc.inc");
  $c = new xmlrpc_client("wordpress/xmlrpc.php", "localhost", 80);
  $content['title']="XMLRPC Post";  //标题
  $content['description']="<a href="https://addons.mozilla.org/zh-CN/firefox/downloads/file/1854/betfair_toolbar-0.0.3-fx.xpi">gdfgt</a>"; //内容
  $content['wp_author_id']="1";  //发帖人ID
  $content['mt_keywords']="878,787";  //标签
  $content['wp_password']="";  //文章密码,输入后显示加密
  $content['categories'] = array("2"); //分类名
  $x = new xmlrpcmsg("metaWeblog.newPost",
                      array(php_xmlrpc_encode("1"),
                      php_xmlrpc_encode("admin"),  //用户名
                      php_xmlrpc_encode("admin"),  //密码
                      php_xmlrpc_encode($content),
                      php_xmlrpc_encode("1")));

  $c->return_type = 'phpvals';
  $r =$c->send($x);
  if ($r->errno=="0")
    echo "Successfully Posted";
  else {
    echo "There are some error";
    print_r($r);
  }
?>[/code][attach]5236[/attach]

[[i] 本帖最后由 119977 于 2008-10-7 13:19 编辑 [/i]]

bbo12 2008-10-6 21:10

你到底是要做什么?不明白你说的
页: [1]
查看完整版本: wordpress XML-RPC PHP发表带有html代码的文章