WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Need help with wp.newPost and multisite (2 posts)

  1. keha76
    Member
    Posted 2 years ago #

    I'm trying create a post to a WordPress multisite with wp.newPost, I've got this working on my localhost, wich is NOT setup as a multisite though. The blog_id is set to 1 and the site on my multisite that I want to post to has the id of 1, this should be right or am I wrong?

    Here's the code I'm using: XMLRPC wp.newPost

    I run the script from an online location and all I get when running it with the multisite xmlrpc url, is a blank page. But when I switch to my development url it works just fine (running the script from the same location).

    The username and password is properly setup on both sites with the contributor role, this is because I want the posts to be pending for approval before published. Both installs is running WP v3.4.

    Suggestions on how to make this work on my multisite?

  2. keha76
    Member
    Posted 2 years ago #

    The multisite install were NOT the problem, but my server setup was. To pass the request internally I had to add this line of code:

    curl_setopt( $ch, CURLOPT_PROXY, 'localhost:80' );

    Now it works like a charm! :)

Topic Closed

This topic has been closed to new replies.

About this Topic