Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Folks,
there is a bit problem with register_setting is not working, actually it's not add option in options.php
here is code wrap in class and hook with admin_init function.

C#
public function as_themeFunction(){
    register_setting('as_theme_settings','as_theme_settings',array($this,'dataValidation'));
    add_settings_section('as_theme_section','Theme Settings',array($this,'as_theme_setting_section'),'theme_options');
    add_settings_field('as_theme_field','Theme Background',array($this,'as_theme_background_input'),'theme_options','as_theme_section');
    //Working Here
}



here hook with admin init

add_action('admin_init','themeAdminInit');
function themeAdminInit(){
	$themeSetupClass = new themeInitialClass;
	$themeSetupClass->as_themeFunction();
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900