I have running a wordpress site on - lets say - "site.com" and another site "input.com" hosted in completely different locations. As the name suggests, "input.com" should be used as a input site with a very simple form (for example: title and content). The entered information should then be sent to "site.com" and posted as a blogpost, just like somebody entered the information using the wp-admin panel.
Usually I would use cURL for this, but since wp-admin panel is pretty complicated (login and stuff) I looked for other ways to do it. Unfortunatly the wordpress rest API seems to be limited to getting data from "site.com" but offers no option to send data to it. All other APIs I found did not work properly (or at all) because they were either outdated or badly documented.
Is there any simple way to do this without coding a cURL programm? The most promising thing I found so far is this: https://github.com/HarriBellThomas/Wordpress_PostController But I was not able to make it work yet. I would really appreciate your help!
<?php set_time_limit(0); error_reporting(E_ALL); ini_set('display_errors', 1); include("./wp-includes/post.php"); // Create post object $my_post = array( 'post_title' => "test",//wp_strip_all_tags( $_POST['post_title'] ), 'post_content' => "teeeeeeeessssssssssttttttttttt",// $_POST['post_content'], 'post_status' => 'publish', 'post_author' => 1, 'post_category' => array( 1,2 ) ); // Insert the post into the database wp_insert_post( $my_post ); ?>