WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wanted to develop a duplicate General Settings Page instead of the built in one and all the settings on the built-in General Settings Page will also be displayed on the new General Settings Page.. the purpose of this is add some codes like inserting some options of a new table. How to accomplish this?

share|improve this question

You don’t. You would have to keep your new page in sync with the core file each time WordPress is updated … that would not be very pragmatic.
Hook into the do_settings_sections('general'); with register_setting() and add your code here.

There is a third parameter for register_setting(): you can register a callback function here which used before the value is saved to the database.

See the @Otto’s WordPress Settings API Tutorial for some examples. In one of my own plugins I do the same: Public Contact Data. See the method function add_contact_fields() for details.

share|improve this answer
I basically want to run a mysql query upon submission of the general settings form.. like inserting the site title to a new table.. i want to accomplish this.. – Ken Jun 11 '12 at 11:40
@Ken See my update. – toscho Jun 11 '12 at 11:45
If I understand correct you only wish to change the site title from the options-general.php and from a custom theme options page themes.php?page=theme_options? In that case I've recently asked a similar question here: wpquestions.com/question/show/id/4052 (just about the WP tagline) – Cor van Noorloos Jun 11 '12 at 15:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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