简体   繁体   English

WordPress-将元数据分配给自定义帖子类型

[英]WordPress - Assign Meta Data to Custom Post Type

I have a website which uses a custom post type of Treatments, which we're using the CPT-onomies plugin to link as a taxonomy to other custom post types. 我有一个使用自定义帖子类型的“治疗”网站,我们使用CPT-onomies插件作为分类法链接到其他自定义帖子类型。

We have another post type, Practitioners, which I need to link related treatments too, this part is easy. 我们还有另一种类型,Practitioners,我也需要链接相关治疗,这部分很容易。 But we also need to enable them to save prices per treatment and have a POA (price on application) option too. 但是,我们还需要使它们能够节省每次治疗的价格,并具有POA(应用价格)选项。

At the momement this is rather awkwardly coded with serialised arrays, which makes long work of manipulating and reporting on the data. 目前,它很难用序列化的数组编码,这使得处理和报告数据的工作量很大。

What's the easiest approach to adding these two extra fields to the custom post type? 将这两个额外字段添加到自定义帖子类型的最简单方法是什么?

Have a look at Pods ( http://pods.io/ ). 看看Pods( http://pods.io/ )。 This plugin enables an interface to define custom post types with a lot of options. 这个插件使界面可以定义带有许多选项的自定义帖子类型。

Including relationships, so you can add records of POA, and then assign these to the pod Practitioners for instance. 包括关系,因此您可以添加POA记录,然后将它们分配给Pod Practitioners。

我最终使用ACF Pro解决了这一问题,特别是在Practitioner页面上某个字段组中的重复字段,允许他们选择多个处理并为每个处理分配价格。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM