[wp-trac] [WordPress Trac] #15264: Deleting a term shared across taxonomies deletes all associated nav menus.
WordPress Trac
wp-trac at lists.automattic.com
Sun Oct 31 14:10:13 UTC 2010
#15264: Deleting a term shared across taxonomies deletes all associated nav menus.
--------------------------+-------------------------------------------------
Reporter: michelwppi | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Taxonomy | Version: 3.0.1
Severity: major | Keywords: needs-patch
--------------------------+-------------------------------------------------
Description changed by scribu:
Old description:
> Using other taxonomies since WP 2.3 in
> [http://wordpress.org/extend/plugins/xili-dictionary/ plugin xili-
> dictionary] , I just discover that now (since WP. 3.0) when deleting a
> term of his taxonomy, ''a menu item can disappear''. [[BR]]
> '''In which conditions ?''' When the term (i.e. news) is shared by
> taxonomy category and the plugin taxonomy named dictionary ? [[BR]]
> After deep tests (thanks to the night when time changes from summer to
> winter time), I can also reproduce it in current conditions : when a term
> is shared between taxonomies category and post_tag : If you delete the
> tag (i.e my test), if a category 'my test' exists and was active inside a
> navigation menu : the nav menu item disappear (unpleasant)- . [[BR]]
> [[BR]]
> The cause of this unexpected erasing, was the action hook ''delete_term''
> at end of '''wp_delete_term''' function and precisely the default filter
> ''_wp_delete_tax_menu_item''.
> The add_action in default-filter.php (line 233) don't pass the 3
> parameters and the function (menu-nav.php line 700) don't verify if it is
> possible to delete the menu item (as well done for term in other
> taxonomies in wp_delete_term itself) by testing the params and the
> taxonomy of the menu item content.[[BR]]
> [[BR]]
> Today workaround in plugins using new taxonomies : remove filter before
> deleting a term on concerned taxonomies and add it after. [[BR]]
>
> Hope that explanations were explicit.
>
> Best regards
New description:
Using other taxonomies since WP 2.3 in
[http://wordpress.org/extend/plugins/xili-dictionary/ plugin xili-
dictionary] , I just discover that now (since WP. 3.0) when deleting a
term of his taxonomy, ''a menu item can disappear''.
'''In which conditions ?'''
When the term (i.e. news) is shared by taxonomy category and the plugin
taxonomy named dictionary ?
After deep tests (thanks to the night when time changes from summer to
winter time), I can also reproduce it in current conditions : when a term
is shared between taxonomies category and post_tag : If you delete the tag
(i.e my test), if a category 'my test' exists and was active inside a
navigation menu : the nav menu item disappear (unpleasant).
The cause of this unexpected erasing, was the action hook ''delete_term''
at end of '''wp_delete_term''' function and precisely the default filter
''_wp_delete_tax_menu_item''.
The add_action in default-filter.php (line 233) don't pass the 3
parameters and the function (menu-nav.php line 700) don't verify if it is
possible to delete the menu item (as well done for term in other
taxonomies in wp_delete_term itself) by testing the params and the
taxonomy of the menu item content.
Today workaround in plugins using new taxonomies : remove filter before
deleting a term on concerned taxonomies and add it after.
Hope that explanations were explicit.
Best regards
--
--
Ticket URL: <http://core.trac.wordpress.org/ticket/15264#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list