admin管理员组文章数量:1122846
I have a custom post type - headstones, that contains pricing information in custom fields:
- Cost of Stone
- Cost of Carving
- Cost Total
- Retail Price of Stone
- Retail Price of Carving
- Retail Total
Of the above, the only two I should manually input or update are the Cost of Stone and the Cost of Carving fields. The remaining fields should be calculated based on some custom number fields in an options page.
Currently, I have this working when updating a single headstone, or adding a new one, the calculations are made and the retail prices added.
I can't quite figure out how to update all the headstones if I were to edit a field on the options page. For example, the options page holds the % margin to be added to each headstone cost. If I updated the margin on the options page, I would need to open every headstone and click update for the changes to take effect.
If possible, when the options page fields are saved, I need each headstone to be updated to.
I am also open to another method of doing this, it felt right at the time to store this info in an options page but if the update process can be made easier by storing the info elsewhere then I am happy to do so.
本文标签: ACFUpdating all posts of CPT when a custom field from options page is updated
版权声明:本文标题:ACF - Updating all posts of CPT when a custom field from options page is updated 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736298087a1930152.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论