First and foremost, I need to stress how greatly I appreciate anyone who takes the time to respond - In advance, thank you, thank you, THANK YOU!
I feel pictures are of great service to explaining things, so to start off, here's something of an illustration of the issue:
http://i.stack.imgur.com/b9OXR.png
Preface:
- My site has about 400 Posts under the "dir_listing" Custom Post Type
- Each "dir_listing" Post can be associated with Terms from the "listing category" Custom Taxonomy and/or "listing_region" Custom Taxonomy
- I have about 210 "listing_category" Terms, and 155 "listing region" Terms
The Issue in Summary:
When Publishing or Updating a "dir_listing" Post Type, sometimes the Term IDs get recorded into the 'term_relationships' table without issue, and other times are recorded erroneously.
Even so, when I go back to edit one of the "dir_listing" Post Types the checkboxes for the desired Parent/Child Terms are correctly marked.
Actions that could be Related?
A number of the "listing_category" terms have been shuffled around. (e.g. A Parent term has become a Child term, or vice-versa, or a Child term has been moved to another Parent.)
Both Parent & Child Terms have been renamed without making any changes to the "dir_listing" Post types. (I don't think this matters, since Posts are supposed to be related to Terms by ID #)
A number of Parent Terms and Child Terms may have been deleted by another Admin-level user. This also seems to happen with Child-Terms of the "listing_regions" taxonomy.
How I've Investigated / Tried to Fix It:
Extensively searched WordPress trac (No similar issues reported)
Searched Google for things like *"wordpress tax_input bug"*, "wordpress taxonomy id bug", "wordpress custom taxonomy bug", etc. and found no matching issues
Disabled all plugins, custom rewrites, and other taxonomies
Ensured the checkbox inputs had the correct Taxonomy as their 'name' and Term ID as their 'value'
Hacked the /wp-admin/includes/post.php core file to try to fix it myself. (No luck.)
Posted issue to [WordPress "How-To and Troubleshooting" forum][3] this morning (No replies)
Posted issue to Reddit /r/web_design this afternoon (Also no replies)
I've spent the better part of 8 hours trying to determine the cause of this, or if I'm missing a step by using a custom MySQL query to directly get a list of Posts related to a particular Term ID.
Again, any thoughts or suggestions anyone might have are VERY MUCH appreciated - Thanks!