admin管理员组文章数量:1304199
I have a poll functionality that uses custom post type & taxonomy to define actual polls.
CPT: poll_entity
Taxonomy: poll_year
Now I need to store votes on user to highlight on voting page.
I'm saving as serialized array to voted_for
meta key.
Currently it looks like:
[
2020 => [1, 2, 5] // (id of chosen poll custom post / voting entity),
2021 => [2, 4, 5]
]
While it's working fine, I'm wondering if it's a bad practice and if there is a better way to store hierarchies like that?
本文标签: Arrays in custom fields or is there a better way
版权声明:本文标题:Arrays in custom fields or is there a better way? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741780383a2397274.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论