Create posts without login from frontend
You should not allow anonymous users to publish anything on your website without authentication. If you need to store custom data that is specified by users, you should use the custom fields instead. In your case, add_post_meta() comes in handy. After creating a post using wp_insert_post(), pass its ID to add_post_meta() and add custom fields … Read more