Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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 ?

Any idea ? Thx

share|improve this question
2  
You need to mark the solution as accepted instead of renaming the title with (resolved) –  Joshua Abenazer Oct 5 '12 at 11:00
add comment

1 Answer

up vote 1 down vote accepted

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 )

share|improve this answer
    
Setting $force_delete to "true" is the solution. Thank you Joshua:) –  Gilles Vauvarin Oct 5 '12 at 10:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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