admin管理员组文章数量:1430489
I created a plugin which has a shortcode that displays a button in a form. I would like to track the button clicks with an onclick() script and save the amount of clicks to a meta field. I am just not sure where to save this data. I don't want this data to be saved to a posts meta field, as this isn't post specific. Should such data be saved to the wp-options table? What's the best way to do this?
Thanks!
I created a plugin which has a shortcode that displays a button in a form. I would like to track the button clicks with an onclick() script and save the amount of clicks to a meta field. I am just not sure where to save this data. I don't want this data to be saved to a posts meta field, as this isn't post specific. Should such data be saved to the wp-options table? What's the best way to do this?
Thanks!
Share Improve this question asked May 22, 2019 at 4:30 harveyharvey 2151 gold badge4 silver badges13 bronze badges 2- Depending on the amount of details you want to save, you could also create a table for it. – user167290 Commented May 22, 2019 at 6:29
- Thanks for your input. I only need to save 2 pieces of data so I think wp-options should suffice. Please correct me if I'm wrong. – harvey Commented May 22, 2019 at 19:02
1 Answer
Reset to default 1If it's not post specific then it should be saved as an option in wp_options
with add_option()
or update_option()
.
本文标签: Where can I save plugin data
版权声明:本文标题:Where can I save plugin data? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745474702a2659907.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论