tammyhart / Reusable-Custom-WordPress-Meta-Boxes

177 stars 97 forks source link

tax_checkboxes and tax_select won't work with hierarchical categories #26

Closed nomoreme closed 11 years ago

nomoreme commented 11 years ago

I have a custom_taxonomy that is hierarchical.

When i use either tax_checkboxes or tax_select it doesn't seem to work in the right way: if i choose one the child category, after saving the data, the parent category is selected (and saved, if the user press the update button)

tammyhart commented 11 years ago

I've set in a few conditionals that now check whether the taxonomy is hierarchical or not and saves the proper data accordingly.

nomoreme commented 11 years ago

Sorry, but i still have this issue :(

Now when I save, instead of saving the selected term, a new term is created (with the selected term-id as a name).

I've manage to solve the issue this way:

$term = intval($_POST[$field['id']]);

on line 590 of meta_box.php.

It seems to work in my case (it's a custom-taxonomy associated to a custom-post-type).

davshoward commented 11 years ago

@nomoreme - Thanks a bunch, I was having this issue as well.

MarioGiancini commented 11 years ago

Was having this issue to with just regular categories. This fixed it. Thank you.