Permissions error when using wp_insert_post externally
-
I have a php script that runs outside of wordpress.
All it contains is the following code.
require_once "../wp-load.php"; $imagePost = array( 'post_title' => 'Here', 'post_content' => 'Content added later.', 'post_status' => 'publish', 'post_author' => 1, 'tags_input' => "''", 'post_category' => array(1), 'post_type' => 'post' ); $postID = wp_insert_post($imagePost, true); die($postID);
I use to be able to run that without any issues however it now comes up with a white page and the message “Are you sure you want to do this?”. I am really at a loss as to how I should fix this.
Any help is much appreciated.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Permissions error when using wp_insert_post externally’ is closed to new replies.