Support » Developing with WordPress » Advanced ordering of get_tags function results

  • Hy,

    I would like to know if it is possible to order the results that the get_tags function returns. Is is possible to show first the tags from the latest post, then the tags from previous post etc… ?
    And a second question, does get_tags function accept any arguments? and if so what are they? i couldn’t find anywhere the get_tags documentation.

    ps. both my questions are related to the get_tags function defined in wp-includes\category.php

Viewing 2 replies - 1 through 2 (of 2 total)
  • get_tags() is considered more of an internal function, which is why the docs on it are scarce (that, and it being so new).

    You could try to order your tags like so:


    But that’s conjecture on my part. You can also pass order=DESC or order=ASC.

    Look over the get_terms() function (wp-includes/taxonomy.php) for an idea of the arguments you can pass, since get_tags() acts as a sort of wrapper (for tag retrieval) to this more general function.

    thanks for the support, was really helpful;
    congrats to wordpress team.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Advanced ordering of get_tags function results’ is closed to new replies.