Support » Plugin: WP REST API (WP API) » Retrieve custom post from one site and insert it into another

  • Resolved robert.glez

    (@robertglez)


    Hello,

    I have a client who wants to interconnect two wordpress sites of his, in which there is the custom post type “car”. He would like to be able to retrieve a car post from one site and insert it into the other, via admin panel.

    Would this be achieved with the JSON REST API at its current stage? I mean can I interconnect the two systems like that? Of course the admin panel would have to be developed by myself, I’d only like to know if it’s possible.

    Is there any documentation as a starting point for this API? I feel a bit lost.

    Thank you very much.

    Best regards,

    Robert

    https://wordpress.org/plugins/json-rest-api/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Ryan McCue

    (@rmccue)

    Hi!

    That should certainly be possible, however you’ll need to write the logic to bring it across yourself. Theoretically, you could do something like…

    $response = wp_remote_get( 'http://example.com/wp-json/posts/4' );
    $new_response = wp_remote_post( 'http://example.org/wp-json/posts' );

    With regards to documentation, take a look at the GitHub repo for that.

    Thanks.

    Thanks a lot Ryan for putting me on track

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Retrieve custom post from one site and insert it into another’ is closed to new replies.