I have a simple, bare-bones PHP script, shown below, that deletes a WordPress post:
Line 15 calls the WordPress wp_delete_post() routine to remove the page from WordPress. The code below that removes any images that were uploaded for the page.
The script is called by a $.post call that passes the page id to delete.
The problem I'm having is that PHP complains that wp_delete_post() is undefined. What do I need to declare at the top of my PHP script to expose it?