I am using the code by Chip Bennett to create a settings options page for my plugin. The problem is that I am getting a Warning error as indicated below that I cannot figure it out. Any help is appreciated.
Warning: call_user_func(ch_settings_defaults_style_section_text) [function.call-user-func]: First argument is expected to be a valid callback in /home/loc123/public_html/domaindvb.com/wp-admin/includes/template.php on line 1083
<?php
function ch_admin_options_page() {
global $pagenow;
?>
<div class="wrap">
<?php
/* Calls function to add tabs */
ch_admin_options_page_tabs ();
/* adds the "updated" admin notice */
if ( isset( $_GET['settings-updated'] ) ) {
echo "<div class='updated'><p>Custom Header settings updated successfully.</p></div>";
}
?>
<form action="options.php" method="post">
<?php
settings_fields('mycustom_options');
do_settings_sections('mycustom');
?>
<?php
if ( 'themes.php' == $pagenow && isset( $_GET['page'] ) && 'ch-settings' == $_GET['page'] ) :
if ( isset ( $_GET['tab'] ) ) :
$tab = $_GET['tab'];
else:
$tab = 'general';
endif;
switch ( $tab ) :
case 'general' :
require ('options-register-defaults.php') ;
break;
case 'Home Page' :
require( 'options-register-homepage.php' );
break;
endswitch;
endif;
?>
<p></br></p>
<input name="mycustom_options[submit-<?php echo $tab; ?>]" type="submit" class="button-primary" value="<?php esc_attr_e('Save Settings', 'default'); ?>" />
<?php /* Add a Reset Button */ ?>
<input name="mycustom_options[reset-<?php echo $tab; ?>]" type="submit" class="button-secondary" value="<?php esc_attr_e('Reset Defaults', 'default'); ?>" />
</form>
</div>
<?php
}
?>
<?php
add_action('admin_init', 'chr_settings');
function chr_settings() {
/* register_setting( $option_group, $option_name, $sanitize_callback )- Associates an option group passed to settings_fields with database entry */
register_setting( 'mycustom_options', 'mycustom_options', 'ch_options_validate' );
add_settings_section('ch_settings_defaults_style', 'Style Options', 'ch_settings_defaults_style_section_text', 'mycustom');
}
?>
File: options-register-defaults.php
<?php
function ch_settings_defaults_style_section_text() { ?>
<p><?php _e( 'Manage Header options for the Oenology Theme. Refer to the contextual help screen for descriptions and help regarding each theme option.', 'mycustom' ); ?></p>
<?php
}
?>
options-register-defaults.php
included?