admin管理员组文章数量:1126967
I’ve created a Custom Post Type Name 'Campaigns' and now, I would like the users of my site (only registered ones) to indicate their interest in promoting the campaign by just clicking the promote on each campaign single page. On the campaign page, they would just click on "Promote" button and they would be associated with the camp (no need for tickets, payment, …). I have no clue on where to look at to implement that (taxonomies, meta, …, ?) and how this will be stored (on user entity, on event custom post type entity)? I need help!
I’ve created a Custom Post Type Name 'Campaigns' and now, I would like the users of my site (only registered ones) to indicate their interest in promoting the campaign by just clicking the promote on each campaign single page. On the campaign page, they would just click on "Promote" button and they would be associated with the camp (no need for tickets, payment, …). I have no clue on where to look at to implement that (taxonomies, meta, …, ?) and how this will be stored (on user entity, on event custom post type entity)? I need help!
Share Improve this question edited Jan 17, 2024 at 8:03 bueltge 17.1k7 gold badges61 silver badges97 bronze badges asked Jan 16, 2024 at 12:20 Joshua EhimareJoshua Ehimare 11 bronze badge 1- note that there may not be a single correct answer for this, and you need to be able to mark a single answer as the official canonically correct answer, not just the most useful response – Tom J Nowell ♦ Commented Jan 16, 2024 at 13:17
1 Answer
Reset to default 0You can use the update_user_meta
function in WordPress to store information about the user's interest in promoting a campaign
// Assuming $user_id is the current user's ID and $campaign_id is the ID of the campaign.
update_user_meta($user_id, 'promoted_campaigns', $campaign_id, true);
本文标签: How to Connect my Users to a custom post type I Labelled Campaign
版权声明:本文标题:How to Connect my Users to a custom post type I Labelled Campaign 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736688229a1947775.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论