go-wordpress icon indicating copy to clipboard operation
go-wordpress copied to clipboard

Why Tags are int ?

Open n0v3xx opened this issue 5 years ago • 3 comments
trafficstars

Hi, i think in wordpress are Tags normaly "strings" why i should put a slice of ints to the tags when i create a post?

Tags []int json:"tags,omitempty"

How does it work?

I want to tag my post with "apple, banana, test" and so on.

n0v3xx avatar Feb 13 '20 13:02 n0v3xx

I believe it's because the tags in this case are integer primary keys.

robbiet480 avatar Feb 13 '20 21:02 robbiet480

@robbiet480 do you have an idea how i can achive this?

// create non existent tags or take existent and put id to int slice func SetOrCreateTags(tags []strings) *[]int {}

n0v3xx avatar Feb 14 '20 15:02 n0v3xx

@n0v3xx I'm sorry, i'm not in a position to help as I no longer use this library, let alone WordPress.

robbiet480 avatar Feb 16 '20 21:02 robbiet480