Bug or feature in Admin -> Blogroll -> Add Link ?

Posted by kent at 5 August 2006

Category: Dev

In the Categories-dropdown, only the categories which already have a link are listed.

To begin with I though the categories I added, wasn't added unless I added a link in that category as well. When I went into Admin -> Manage -> Categories all the categories I added indeed got added.

So I went into digging through the code and when I found the culprit, it seemed like this is a feature, not a bug. My question is, if this is feature, how are the users able to add a link to a "link-empty" category?

And if this is a bug, here is a fix that works for me. Note the "link_count >= 0". Originally it was "link_count > 0". This is around line 644 in 'admin-functions.php'.

function return_link_categories_list($parent = 0) {
    global $wpdb;
    return $wpdb->get_col("SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent AND link_count >= 0");
}

Here is a patch.
http://wp.freya.no:8081/diff/more-link-categories.patch

Leave a Reply

Leave a Reply
  • (required)
  • (required) (will not be published)