0

I know how to make custom fields for my custom post types. I also know there is the Advanced Custom Fieldsplugin.

But I need to know how I can store my custom fields in my custom post type to my custom DB tables. I've been looking for tutorials, but I only find how to create SQL tables in plugins.

How can I fetch "my data" (and save it in my own tables) and at the same time save the other data for the page the normal way?

  • When you cay "fecth my data", you refer to the data in your custom table of the data in the custom field? – Tomás Cot Sep 8 '14 at 13:53
  • I mean the data that is entered into custom fields and submitted when I click the "save new post" button. I just want to store the data in my custom fields into my custom tables. – Steven Sep 8 '14 at 14:52
1

Steven, I think you are looking for the save_post action, you should create the function you want to use and use the add_action function.

You can find the data from the custom fields in the $_POST array.

You don't have to worry about the "other content", at least if with that you are referring to the title, content, categories.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.