WordPress.org

Make WordPress Core

Opened 20 months ago

Last modified 4 months ago

#36654 new enhancement

New function `has_terms`

Reported by: sebastian.pisula Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords: has-patch needs-unit-tests reporter-feedback
Focuses: Cc:

Description

I suggest add new function:

if(has_terms('category')) {
the_terms(x, 'category');
}

Attachments (1)

36654.patch (877 bytes) - added by sebastian.pisula 20 months ago.

Download all attachments as: .zip

Change History (3)

#1 @swissspidy
10 months ago

  • Keywords has-patch needs-unit-tests added

#2 @Mte90
4 months ago

  • Keywords reporter-feedback added

What is the difference with has_term?
I think that are the same but only with different code approach, instead has_terms has 3 parameter that add the support for term and not only for taxonomy.

Note: See TracTickets for help on using tickets.