def blog__get_tags(
      order: nil,
      language: nil,
      search: nil,
      page: nil,
      per_page: nil
    )
      tags = LatoBlog::Tag.all

      # apply filters
      order = order && order == 'ASC' ? 'ASC' : 'DESC'
      tags = _tags_filter_by_order(tags, order)
      tags = _tags_filter_by_language(tags, language)
      tags = _tags_filter_search(tags, search)

      # take tags uniqueness
      tags = tags.uniq(&:id)

      # save total tags
      total = tags.length

      # manage pagination
      page = page&.to_i || 1
      per_page = per_page&.to_i || 20
      tags = core__paginate_array(tags, per_page, page)

      # return result
      {
        tags: tags && !tags.empty? ? tags.map(&:serialize) : [],
        page: page,
        per_page: per_page,
        order: order,
        total: total
      }
    end
def blog__get_tags(
      order: nil,
      language: nil,
      search: nil,
      page: nil,
      per_page: nil
    )
      tags = LatoBlog::Tag.all

      # apply filters
      order = order && order == 'ASC' ? 'ASC' : 'DESC'
      tags = _tags_filter_by_order(tags, order)
      tags = _tags_filter_by_language(tags, language)
      tags = _tags_filter_search(tags, search)

      # take tags uniqueness
      tags = tags.uniq(&:id)

      # save total tags
      total = tags.length

      # manage pagination
      page = page&.to_i || 1
      per_page = per_page&.to_i || 20
      tags = core__paginate_array(tags, per_page, page)

      # return result
      {
        tags: tags && !tags.empty? ? tags.map(&:serialize) : [],
        page: page,
        per_page: per_page,
        order: order,
        total: total
      }
    end
This function returns an object with the list of tags with some filters.