WordPress.org

Ready to get started?Download WordPress

Forums

Posting HTML content via XML-RPC (2 posts)

  1. fncll
    Member
    Posted 8 years ago #

    How can I post an HTML formatted post via the XML-RPC interface? If I post the HTML code it gets converted to entities. If I preconvert content to entities, it doesn't get converted back (obviously) :)

    I am using PHP with the xml-rpc library. Example Code:


    $content = "Bold Statement;
    $xmlrpcurl = "http://127.0.0.1:2006/devwp/xmlrpc.php";

    $client = new xmlrpc_client($xmlrpcurl);

    $params[] = new xmlrpcval("n/a");
    $params[] = new xmlrpcval("n/a");
    $params[] = new xmlrpcval("admin");
    $params[] = new xmlrpcval("chrislottt");
    $params[] = new xmlrpcval(
    "<title>LinkLog</title>".
    "<category>2</category>".
    $content);
    $params[] = new xmlrpcval("true");

    $msg = new xmlrpcmsg("blogger.newPost",$params);

    Am I going to have to do a direct insert into the WP tables or use the internal WP functions??

  2. iolaire
    Member
    Posted 8 years ago #

    see - http://wordpress.org/support/topic/54927 I think you need disable
    $post_content = apply_filters('content_save_pre', $post_content);

Topic Closed

This topic has been closed to new replies.

About this Topic