0
votes

I am working on a wordpress website and I am using Advanced Custom Fields and Custom post type UI plugins. What I want to do is that: The website I am working on was in native php and I want to migrate from native to wordpress but I face this problem, I can't achieve the relations that I had in mysql, in the form of post type and custom field groups in wordpress and ACF. SO any have an Idea how to do this. I also checked reusable fields but It actually won't help

https://github.com/tybruffy/ACF-Reusable-Field-Group

1

1 Answers

1
votes

You didn't post your Data Model so it's hard to tell what the issues are or to give you an example based on it.

However, regarding the way Wordpress handles custom post type and meta value, I suggest that you consider post types as entities while meta values (custom fields here as you used ACF) usually their properties.

Usually, modelling 1-M or M-M relationships can be done in Wordpress by introducing custom taxonomies normally solve the problem, since it works as a mechanism to classify, to categorize and to group your entities. An example of this is the way Woocommerce give options to treat their product attributes as custom taxonomies. You can view the code from the link below.

https://docs.woocommerce.com/wc-apidocs/source-class-WC_Product.html#1398-1417