With the advent of wordpress 2.1 the get_links() and associated tags have been depreciated and replaced with the new wp_list_bookmarks() call.
However for dyadica.net I needed to be able to manipulate the returned link data a little more deeply than wp_list_bookmarks() allows e.g. the ability to be able to exclude by category.
Take a look at the following:
<?phpglobal $wpdb;
$terms = $wpdb->get_results(“SELECT term_taxonomy_id, taxonomy, term_id, count FROM $wpdb->term_taxonomy WHERE ‘link_category’ = taxonomy”);
foreach ( (array) $terms as $term ) {
$items = $wpdb->get_results(“SELECT name, term_id FROM $wpdb->terms WHERE term_id = $term->term_id”);
foreach ( (array) $items as $item ) {
$links = wp_list_bookmarks(“echo=0&title_li=0&show_images=0&categorize=0&category=”.$item->term_id);
if ($links) {
echo “<h3 class=’post-title’>”.$item->name.”</h3>”.”<br />”;
echo “<ul class=’ilist’>”;
echo $links;
echo “</ul>”;
}
}
}
?>
Above is a custom call to the wordpress database that acts as a wrapper for the wp_list_bookmarks() providing facility for additional filtering / functionality as required.
