[wp-trac] [WordPress Trac] #14490: function "get cat ID" fails if category name has an apostrophe

WordPress Trac noreply at wordpress.org
Sun Mar 3 16:58:01 UTC 2019


#14490: function "get cat ID" fails if category name has an apostrophe
---------------------------------------------+-------------------------
 Reporter:  iamronen                         |       Owner:  (none)
     Type:  defect (bug)                     |      Status:  closed
 Priority:  normal                           |   Milestone:
Component:  Taxonomy                         |     Version:  3.1
 Severity:  minor                            |  Resolution:  worksforme
 Keywords:  reporter-feedback bulk-reopened  |     Focuses:
---------------------------------------------+-------------------------

Comment (by MikeNGarrett):

 Have to try and remember what was going on 8 years ago, but I'll give it a
 shot.

 Handling taxonomy terms has greatly changed since 3.1, so the original
 issue is definitely no longer present. For example, `get_cat_ID(
 'Some’thing' );` and `get_cat_ID( "Some'thing" );` now return their exact
 matches.

 The only thing I could find that might cause issues is the category
 listing `/wp-admin/edit-tags.php?taxonomy=category` does not differentiate
 these characters in displaying the term name. Tick marks, `'` and `"`, are
 converted to their fancy counterparts, `‘’` and `“”`.

 Screenshot: http://files.copper-note.com/mODwgNC

 **Why is this a problem?**
 Tick marks are used in measurement, eg `5'10"` while fancy quotes are used
 everywhere else, especially when `“Someone says something”`.

 WordPress converts ticks to fancy quotes nearly universally, so I don't
 see any reason to change in this context.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/14490#comment:17>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list