2

When I activate my plugin (register_activation_hook), I add a new specific page and a corresponding item menu in the custom menu. No problem here.

When I deactivate my plugin (register_deactivation_hook), I delete the specific page but I don't know how to delete the corresponding item menu from the custom menu?

0

1 Answer 1

2

WordPress automatically handles that if you force delete the page instead of thrashing it. The following function takes a parameter to force delete -> wp_delete_post( $postid, $force_delete )

1
  • Setting $force_delete to "true" is the solution. Thank you Joshua:) Oct 5, 2012 at 10:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.