WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#5295 closed defect (bug) (fixed)

wp-links-opml.php will not display a single link category

Reported by: vrypan Owned by: westi
Milestone: 2.5 Priority: normal
Severity: major Version: 2.3.1
Component: General Keywords: opml
Focuses: Cc:

Description

wp-links-opml.php when called using ?link_cat=category_number should return an OPML including ONLY the category specified. However, it doesn't (it shows all link categories).

This can be fixed by replacing the line
$cats = array (get_category($link_cat));
with
$cats = get_categories('type=link&hierarchical=0&include='.$link_cat);

Change History (5)

comment:1 follow-up: @ryan7 years ago

I think get_term($link_cat, 'link_category') will work.

comment:2 @foolswisdom7 years ago

  • Version set to 2.3.1

comment:3 @westi7 years ago

  • Owner changed from anonymous to westi
  • Status changed from new to assigned

comment:4 in reply to: ↑ 1 @westi7 years ago

  • Milestone changed from 2.3.2 to 2.4

Replying to ryan:

I think get_term($link_cat, 'link_category') will work.

That doesn't work with the current code.

The suggest change in the ticket does though.

comment:5 @westi7 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [6308]) Allow wp-links-opml.php to return the links for just one category. Fixes #5295 props vrypan.

Note: See TracTickets for help on using tickets.