Add Field to General Settings Page

if you need to add new settings in WordPress for easy use to your customer you can use this snippets

$new_general_setting = new new_general_setting();

class new_general_setting {
function new_general_setting( ) {
add_filter( 'admin_init' , array( &$this , 'register_fields' ) );
}
function register_fields() {
register_setting( 'general', 'favorite_inspired', 'esc_attr' );
add_settings_field('fav_color', ''.__('Favorite Inspired?' , 'favorite_inspired' ).'' , array(&$this, 'fields_html') , 'general' );
}
function fields_html() {
$value = get_option( 'favorite_inspired', '' );
echo '';
}
}

Advertisements

Leave a Reply :)

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s