Writing a wordpress plugin: add_meta_box vs. add_settings_field?

I’m writing a custom wordpress plugin and trying to incorporate some functionality from a third-party plugin. That plugin seems to use add_meta_box to create the fields for settings options on the plugin admin pages. I searched the entire source code of the plugin for add_settings_field and it doesn’t occur once. Are the two functions basically interchangeable? From the WP Codex, it seems that add_meta_box is primarily for the purpose of adding “a custom section to the post and page editing screens” — i.e. not so much intended for the admin settings/options forms. On the other hand, the 3rd-party plugin seems to work very well, which is why I’m borrowing from it…

So in short my question is this: can someone please explain correct usage for the add_meta_box and add_settings_field functions? Thanks! Please let me know if anything about this question is unclear and I will do my best to rephrase.

Related posts

Leave a Reply

1 comment