Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why Tags are int ? #3

Open
n0v3xx opened this issue Feb 13, 2020 · 3 comments
Open

Why Tags are int ? #3

n0v3xx opened this issue Feb 13, 2020 · 3 comments

Comments

@n0v3xx
Copy link

n0v3xx commented Feb 13, 2020

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.

@robbiet480
Copy link
Owner

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

@n0v3xx
Copy link
Author

n0v3xx commented Feb 14, 2020

@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 {}

@robbiet480
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants