WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 7 years ago

#13081 closed enhancement (fixed)

Make $taxonomy optional in get_term_link()

Reported by: scribu Owned by: scribu
Milestone: 3.1 Priority: low
Severity: normal Version:
Component: Taxonomy Keywords: has-patch commit
Focuses: Cc:

Description

When get_term_link() receives an object as the first argument, it shouldn't require the second $taxonomy argument, since the $term object already has it.

Attachments (1)

get_term_link.diff (1.9 KB) - added by scribu 8 years ago.

Download all attachments as: .zip

Change History (7)

@scribu
8 years ago

#1 follow-up: @nacin
8 years ago

if !is_object($term) we would need to then return WP_Error if we don't get a $taxonomy either.

#2 @filosofo
8 years ago

  • Owner changed from filosofo to scribu
  • Status changed from new to assigned

#3 @nacin
8 years ago

  • Milestone changed from 3.0 to 3.1

#4 in reply to: ↑ 1 @scribu
7 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Triage to 3.1

Replying to nacin:

if !is_object($term) we would need to then return WP_Error if we don't get a $taxonomy either.

We would get a WP_Error from get_term() or get_term_by() so it's taken care of.

Patch still applies clean.

#5 @scribu
7 years ago

Related: #14156

#6 @markjaquith
7 years ago

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

(In [15586]) Make the second (taxonomy) parameter for get_term_link() optional if you pass in a term object as the first argument (which has the taxonomy in it). fixes #13081. props scribu

Note: See TracTickets for help on using tickets.