WordPress.org

Make WordPress Core

#21465 closed defect (bug) (invalid)

Wrong operator in wp-includes/bookmark.php

Reported by: carmenDi0xide Owned by:
Milestone: Priority: normal
Severity: minor Version: 3.4.1
Component: General Keywords:
Focuses: Cc:

Description

On line 174 wp-includes/bookmark.php

"if ( $category = get_term_by('name', $category_name, 'link_category') ) {"

should be:

"if ( $category == get_term_by("

It would be nice if the reference to 'link_category' (bolded) was not there. I'd like to get links that belong to regular category terms without having to create duplicates. This was how I accidentally found the error. I'm new here so maybe I'm just missing something....but....

Change History (1)

comment:1 SergeyBiryukov21 months ago

  • Keywords needs-patch removed
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

The line works as intended. It's a check if the specified link category exists, not a comparison.

I'd like to get links that belong to regular category terms

Sounds like you're looking for get_category_link():
http://codex.wordpress.org/Function_Reference/get_category_link

Note: See TracTickets for help on using tickets.