WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#3714 closed defect (bug) (invalid)

wp_get_linksbyname shows all categories

Reported by: tandilboy 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)

comment:1 markjaquith7 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

wp_get_linksbyname() has been deprecated. Look to get_bookmarks()

comment:2 foolswisdom7 years ago

  • Milestone 2.1.1 deleted

comment:3 ryan7 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?

comment:4 foolswisdom7 years ago

  • Milestone set to 2.1.1

comment:5 tandilboy7 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

comment:6 in reply to: ↑ description Nothus7 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.

comment:7 Nazgul7 years ago

  • Milestone changed from 2.1.1 to 2.1.2

comment:8 foolswisdom7 years ago

  • Milestone changed from 2.1.3 to 2.3

comment:9 Nazgul7 years ago

  • Milestone changed from 2.3 to 2.5

comment:10 technosailor6 years ago

  • Resolution set to invalid
  • Status changed from reopened to closed

Any reason we're keeping this open? I believe [5444] fixes this.

comment:11 thee176 years ago

  • Milestone 2.9 deleted
Note: See TracTickets for help on using tickets.