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.

Read More

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

Related posts

1 comment

  1. 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 ).

Comments are closed.