[wp-trac] [WordPress Trac] #18346: orderby="title" does not work properly in WP_Query

WordPress Trac wp-trac at lists.automattic.com
Sat Aug 6 20:54:26 UTC 2011


#18346: orderby="title" does not work properly in WP_Query
--------------------------+-----------------------------
 Reporter:  jobjorn       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Query         |    Version:  3.2.1
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 I am running a homemade plugin that displays an alphabetical post index.
 It didn't take me long to notice that "Äppelpaj med knäcktäcke" was sorted
 immediately after "Ajvarpasta med solrosfrön", that is, Ä after A rather
 than at the end of the alphabet - the swedish alphabet is like the english
 one but with three extra letters, Å Ä Ö, at the end. Since I did not
 really expect WordPress to handle the quirks of all languages, I ignored
 this.

 However. It soon turned out that "Asiatisk gryta med tofu och plommon" was
 sorted after "Äppelpaj med knäcktäcke", meaning that the sort goes AÄA. Ä
 is treated as an A by WordPress.

 In the get_posts loop, I'm adding a new header for each letter, based on
 when the first letter of the post changes from the first letter of the
 previous post. But since WordPress seems to treat Ä as A, and PHP rightly
 does not, I end up with two "A" headers with an "Ä" header in the middle.

 This can't be right, can it?

 I'm attaching my little (not entirely finished) plugin.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18346>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list