elegantthemes / create-divi-extension

MIT License
186 stars 59 forks source link

Pulling and saving custom field data from Custom Post Types into a custom module #107

Closed antonkor closed 6 years ago

antonkor commented 6 years ago

I have a CPT called property and i store some various information (Title, Price, Image) in some custom fields/metaboxes. What i would like to do is create a custom module you select a property from a dropdown and the module's fields would be pre-populated from the CPT custom fields. then when saving the module/page, those new values get published to the CPT custom fields.

Are there any examples of doing this with Divi custom modules? this is kinda new territory for me.

I don't think i need this module to be FB compatible.

xxtesaxx commented 6 years ago

Have a look at the questions about Ajax. I gave an example of how you can make an Ajax call to load something. Basically yo make an Ajax call to the backend, providing the selected field together with the ID of the current post and in the backend then load the meta value for this field and return it back to the module. Then you can display it on the VB.