Create new WordPress post [wp_insert_post] based on results of a WP_Query
Thanks to @Chinmoy Kumar Paul for his amazing help last night and for setting me on the right track. The issue was that because the code was being run inside an AJAX results DIV, WordPress couldn’t locate the ID correctly. It was necessary to post the data using AJAX too and this works fine. For … Read more