• Hi Guys,

    I’ve got a question about the admin. I inserted a new meta box with my own feature and added a field to the mysql database.
    Now, I have to update the saving method to update my new feature but I don’t know where the saving function is.
    Could somebody tell me the secret?

    Thanks a lot.

    — Benjamin

Viewing 1 replies (of 1 total)
  • See this Codex article:

    http://codex.ww.wp.xz.cn/Function_Reference/add_meta_box

    Especially look for myplugin_save_postdata.

    A function by that name is added as an action to the save_post action hook:

    /* Do something with the data entered */
    add_action( 'save_post', 'myplugin_save_postdata' );

    At the bottom of the sample function there are comments suggesting what to do to save the data:

    // Do something with $mydata
      // probably using add_post_meta(), update_post_meta(), or
      // a custom table (see Further Reading section below)
Viewing 1 replies (of 1 total)

The topic ‘Where is the saving function in WP-Admin?’ is closed to new replies.