The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Advanced ordering of get_tags function results (3 posts)

  1. claudiusta
    Posted 8 years ago #


    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

  2. Kafkaesqui

    Posted 8 years ago #

    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.

  3. claudiusta
    Posted 8 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic