[wp-hackers] get_links_list() and get_links() can be improved.

Mike Little mike at zed1.com
Fri Jul 9 09:50:35 UTC 2004


Carthik Sharma wrote:

> The function (okay, template tag) get_links_list() allows one to order
> the link categories by name or id, right now...
> It does not let one specify the order in which the links themselves
> are displayed. It may be useful to add parameters to help decide this
> order and the other things that get_links() uses.
> get_links_list is the default template tag in the wp index.php file,
> which is why it would be nice to be able to specify more parameters,
> if needed.
> 

Again, this function will use the settings configured for each category 
in the link category admin page.

> Also , 
> 
> get_links shows links in reverse order of freshness if  'updated' is
> specified as the order-by parameter, and shows them newest on top if
> '_updated' is specified as the parameter, though the inline comments
> in wp-includes/links.php says that adding _ before the param will
> reverse the order. This behaviour might confuse an end user.
> 

There is nothing confusing here. If you specify 'name' as the sort order 
it displays the links in ascending alphabetical order. Similarly if you 
select 'updated' as the sort order is displays them in ascending updated 
date order.

Now, you will probably /want/ to always specify 'updated' to be reversed 
so that it displays the newest ones first, but that is no reason to 
change the logic of the function for that one case.
You might say the same for 'rating', in that you would probably want to 
display the links with the highest rated ones first, but then you have 
two special cases, and things start to get out of hand...

Mike
-- 
Mike Little
http://zed1.com/journalized/



More information about the hackers mailing list