Given two custom post types: Automatically add meta fields from one custom post type to another
-
06-11-2019 - |
質問
Custom post type "Company" has:
Restaurant name field
Restaurant description field
..and other more fields
Custom post type "Restaurant" has:
Restaurant name field
Restaurant description field
How can I make it so that whenever I add a new Company (the restaurant fields are filled out), it will automatically add a new Restaurant whose fields/details are the same with the newly added Company?
My idea is:
Whenever I create a new Company, I will add the restaurant details to a "restaurants" table in the database
Also, whenever I create a new company, I will get the latest entry from "restaurants" table and somehow append them to create a new Restaurant post
Is this even possible? If not or if you have another idea to solve the problem, please share.
Feel free to suggest multiple plugins if they manage to get the job done.
Providing an example would be extremely helpful. Thanks!
正しい解決策はありません