Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Does anyone know if there is a way to change the callback function for a tag-like custom taxonomy so that it breaks terms after a semicolon instead of a comma? I realize I can rewrite the whole meta box, but I'd rather not if there's an easier way.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

The tag delimiter is made translatable:

$comma = _x( ',', 'tag delimiter' );

So this can be changed with a simple filter:

add_filter( 'gettext_with_context', 't5_semicolon_tag_delimiter', 10, 4 );

function t5_semicolon_tag_delimiter( $translated, $text, $context, $domain )
{
    if ( 'default' !== $domain or 'tag delimiter' !== $context or ',' !== $text )
        return $translated;

    return ';';
}

Install as plugin; works without any side effects.

What is tricky: changing the string Separate tags with commas to say semicolon. You cannot use the same solution, because you don’t know the language of your users. Not sure how to handle that.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.