dmanexe
dmanexe

Reputation: 1044

What is wrong with the way I am passing arguments to get_tags()?

This bit of code has been giving me a problem. Here's the snippet in question:

... strip_tags($product->get_tags(array('order', 'DESC'))) ...

Which should produce a reverse alphabetical list of tags from the product, however, something entirely different comes up on the front-end. While get_tags() does work without arguments, as soon as I add any argument it produces this error.

WTF get_tags

Following a commenter's suggestion of using this:

strip_tags($product->get_tags(array('order' => 'DESC')))

Produces this:

WTF get_tags() freaking out

Upvotes: 1

Views: 134

Answers (1)

Danijel
Danijel

Reputation: 12709

If you are talking about WC_Product class and get_tags() method then function definition is:

function get_tags( $sep = ', ', $before = '', $after = '' )

It returns list of term links ( in fact, just returns get_the_term_list() list ).

Upvotes: 1

Related Questions