WordPress.org

Make WordPress Core

Ticket #4881: get_bookmark.diff

File get_bookmark.diff, 652 bytes (added by filosofo, 7 years ago)
  • wp-includes/bookmark.php

     
    44        global $wpdb; 
    55 
    66        $bookmark_id = (int) $bookmark_id; 
    7         $link = $wpdb->get_row("SELECT * FROM $wpdb->links WHERE link_id = '$bookmark_id'"); 
    8         $link->link_category = wp_get_link_cats($bookmark_id); 
     7        $link = $wpdb->get_row("SELECT * FROM $wpdb->links WHERE link_id = '$bookmark_id' LIMIT 1"); 
     8        $link->link_category = array_unique( wp_get_object_terms($link_id, 'link_category', 'fields=ids') ); 
    99 
    1010        $link = sanitize_bookmark($link, $filter); 
    1111