#3714 closed defect (bug) (invalid)
wp_get_linksbyname shows all categories
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | major | Version: | 2.1 |
Component: | Administration | Keywords: | |
Focuses: | Cc: |
Description
i using the wp_get_linksbyname in diferent instances showed by categories, in 2.1 the wp_get_linksbyname can´t filter categories and shows all links in all instances
Change History (11)
#3
@
18 years ago
- Resolution wontfix deleted
- Status changed from closed to reopened
The huge number of themes in the wild will be using deprecated API for some time. I think we should not break those themes. I'll reopen and take a look.
tandilboy, how are you using wp_get_linksbyname()? Can you tell us exactly what arguments your theme is passing to it?
#5
@
18 years ago
<?php wp_get_linksbyname('Secciones','orderby=rating&before=<li>&after=</li>&show_description=0'); ?>
2.1 cant filter the links by category
i using this code. any case reply me with the new code to update the theme
#6
in reply to:
↑ description
@
18 years ago
Replying to tandilboy:
i using the wp_get_linksbyname in diferent instances showed by categories, in 2.1 the wp_get_linksbyname can´t filter categories and shows all links in all instances
It appears that the problem is not in wp_get_linksbyname it's in wp_get_links (bookmark-template.php).
parse_str($args) messes up the first var it's trying to parse in $args because it starts with something like '/?varname=var'. So, in the case where it's trying to look up a category, $category never gets set and will lookup all categories. My temp fix was to strip out everything up to the '?' and it now works as it should.
A quick grep through the code base show lots of parse_str($args) and I would imagine that this problem would also be happening there.
wp_get_linksbyname()
has been deprecated. Look toget_bookmarks()