Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.