Adding Tags with commas in them?
-
I have a taxonomy that I imported into WordPress. When tagging my post I ran into the issue of terms being broken into two when there was a comma in them. I can see why this happens since the comma is what WordPress uses to seperate multiple tags in an input field. The problem comes up when you have a taxonomy filled with people’s names in the format “Lastname, First name” or in large dollar amount like “$10,000 – $19,000”.
After hacking around with some of the core JavaScript, I can easily fix this for the suggest/autocomplete functionality. A simple regular expression is used to get the tag value and replace the comma with the HTML entity for a comma & #44;
This will let me add the tag successfully, as one tag and not two. The problem is when I save the post, some PHP function breaks up the tags at the comma and my post now has two tags instead of the expected one.
I would be happy to write a plugin to modify this behavior if only I knew of the right filter or action to hook on to for the parsing of the tags on the backend. Does anyone know?
Or does anyone have an idea on how to add tags that have commas in them?
With the new custom taxonomy features in WordPress 3.0 I fear this will become more and more of a problem and I don’t think it would be that hard to fix it if I just knew the right place to look.
- The topic ‘Adding Tags with commas in them?’ is closed to new replies.