#18234 closed defect (bug) (fixed)

get_bookmarks not order by id

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

Description

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 22 months ago.

Download all attachments as: .zip

Change History (7)

  • 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.

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

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

comment:3 follow-up: ↓ 4   SergeyBiryukov22 months ago

  • Keywords has-patch added

comment:4 in reply to: ↑ 3   psophy22 months ago

Replying to SergeyBiryukov:
Thank you for your patch SergeyBiryukov!

In [18470]:

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

  • 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.