WordPress.org

Make WordPress Core

Changes between Version 2 and Version 3 of Ticket #14490, comment 3


Ignore:
Timestamp:
03/10/11 21:42:32 (4 years ago)
Author:
MikeNGarrett
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #14490, comment 3

    v2 v3  
    55More details:  
    66I tried to change the category name to use a tick mark, ' , instead, but the saved value was always considered a smart fancy quote ’. Seems like the problem stems from the category, not get_cat_id(). Both should be modified to handle fancy quotes. 
     7 
     8---- 
     9 
     10I just realized that single_cat_title() should only be used for displaying the current category on a page. That's probably where the fancy quotes come from. I've seen this function being used to retrieve the name of the category page, which is then used to retrieve the category id. The better process is to do the following:  
     11 
     12{{{ 
     13 global $wp_query; 
     14if(is_category() || is_single()){ 
     15  $cid = get_query_var('cat'); 
     16} 
     17}}} 
     18 
     19Or you could get the category slug from the url and work that way. Neither seems ideal unless I'm missing something.