WordPress.org

Ready to get started?Download WordPress

Forums

Advanced ordering of get_tags function results (3 posts)

  1. claudiusta
    Member
    Posted 6 years ago #

    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.
    Thx.

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

  2. Kafkaesqui

    Posted 6 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:

    get_tags('orderby=oject_id')

    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
    Member
    Posted 6 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

Tags