Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter callerc1

    (@callerc1)

    All done.

    Cheers

    Thread Starter callerc1

    (@callerc1)

    Hi scribu,

    Good point. I agree if this was the case the parent should be reset. My fix doesn’t work in this situation. I overlooked that.

    However i think its probably more than likely that if a user moves a child term they would move a parent at the same time. Which leads to the following user journey:

    User selects parent and its child terms and changes the tax to another that has hierarchical support. (Hierarchy is lost at convert on all children as they where selected along with the parent)

    I guess this is more more of a UX discussion now as it sounds like its handled this way by design.

    Would be great if the plugin could handle the above situation as well. ie check if parent term_id is in the term_ids array before reseting. something like this?:

    if ( $term->parent ) {
        if (!in_array($term->parent,$term_ids)) {
            $wpdb->update( $wpdb->term_taxonomy,
                array( 'parent' => 0 ),
                array( 'term_taxonomy_id' => $term->term_taxonomy_id )
            );
        }
    }

    Thanks

    Thread Starter callerc1

    (@callerc1)

    Hi scribu,

    After further debugging i believe there is a small bug in the handle_change_tax method. on line 173 of the term_management_tools.php

    array( 'parent' => 0 ),
    should be
    array( 'parent' => $term->parent ),

    essentially if the current term has a parent make sure we preserve it on tax change.

    Would be great to here you thoughts on this?

    Many Thanks

    Chris

Viewing 3 replies - 1 through 3 (of 3 total)