Add multiple custom fields to the general settings page

Posted by Prem Tiwari | Updated on

Well the second bit of code is technically the correct way to do it. However, at the end of the add_settings_field() you can pass arguements.

Please view the WordPress Add_Settings_Field function reference. This will help you in getting the best understanding of how the add_settings_field() function really works.

Now, with that said, you could use a ‘shared’ function for your callback. Such as I do in my options page when I develop themes.

Here is an example of how I do it.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers