When deleting a page from /wp-admin/edit-pages.php by clicking Delete under the Action column in the interface the page deletes but any function hooked into ‘delete_post’ doesn’t _seem_ to be executed from my plugin. This all worked fine in WordPress 2.3.1 as I was developing it; the expected functionality executed as expected: WordPress deletes the Page and my plugin’s class member functions are called and they clean up some external DB table records associated with the Page.
Although I’m having this issue deleting from /wp-admin/edit-pages.php when clicking ‘Delete’ everything works as expected when the page is deleted using these methods (one being a hack):
Opening the page in the page editor
and clicking the ‘Delete this page’.
from /wp-admin/edit-pages.php in the admin interface copy the URL from the Delete link under the Action column, paste it in the web browser’s address box, and execute it from there. The post deletes as expected and the records associated with my plugin are deleted too (the desired action). yet when you click the Delete link only the record disappears and my hooked functions never get called (it would seem; I’ve thrown some wp_die()’s in the called functions and WP doesn’t skip a beat so I assume execution doesn’t even reach them…”
Problem is browser independent…Tested clicking the Delete link under FF and Safari and same problem…
Tested under two installs of WordPress 2.3.2 — same issue. tested under PHP 4.3.10 on a Linux box and PHP 5.2.4 under Mac OS X 10.5.
I wrote a very simple plugin to test if the hook is being called when the ‘Delete’ link is clicked – the test proved positive, it calls the hooked delete_post successfully. So I am even more confused…
wp_die(“– $post_id –“);
I am at a loss….I don’t want to force users to delete a page using one of the alternate methods because it should work from /wp-admin/edit-pages.php like it had in older versions of WP. Could this be AJAX related?
I don’t understand how it can not work from this one part of the admin panel but delete fine from the Edit Page admin page…
- The topic ‘Odd 2.3.2 Delete Post behavior’ is closed to new replies.