Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#18234 closed defect (bug) (fixed)

get_bookmarks not order by id

Reported by: psophy Owned by: ryan
Milestone: 3.2.2 Priority: normal
Severity: normal Version: 3.2.1
Component: General Keywords: has-patch
Focuses: Cc:


When I use get_bookmarks() function to get links and I want to order by link id:

   $bookmarks = get_bookmarks(array(
        'orderby'        => 'id',
        'order'          => 'DESC',
         'category' => 6

But it not order by link id It still use link name to order and I see SQL result :

SELECT * FROM wp_links  INNER JOIN wp_term_relationships AS tr ON (wp_links.link_id = tr.object_id) 
INNER JOIN wp_term_taxonomy as tt ON tt.term_taxonomy_id = tr.term_taxonomy_id 
WHERE 1=1 AND link_visible = 'Y'  AND ( tt.term_id = 6 ) AND taxonomy = 'link_category' ORDER BY link_name DESC

Attachments (1)

18234.patch (628 bytes) - added by SergeyBiryukov 10 years ago.

Download all attachments as: .zip

Change History (7)

#1 @ocean90
10 years ago

  • Component changed from Filesystem to General
  • Keywords reporter-feedback removed
  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Since WordPress 3.2 it's link_id, see r18345.

#2 @nacin
10 years ago

  • Milestone set to 3.2.2
  • Resolution worksforme deleted
  • Status changed from closed to reopened

Man, I missed that. "id" used to work. Alright.

#3 follow-up: @SergeyBiryukov
10 years ago

  • Keywords has-patch added

#4 in reply to: ↑ 3 @psophy
10 years ago

Replying to SergeyBiryukov:
Thank you for your patch SergeyBiryukov!

#5 @ryan
10 years ago

In [18470]:

Allow sorting by id in get_bookmarks(). Props SergeyBiryukov. see #18234 for trunk

#6 @ryan
10 years ago

  • Owner set to ryan
  • Resolution set to fixed
  • Status changed from reopened to closed

In [18471]:

Allow sorting by id in get_bookmarks(). Props SergeyBiryukov. fixes #18234 for 3.2

Note: See TracTickets for help on using tickets.