); function mytheme_add_admin() { global $themename, $shortname, $options; if ( $_GET['page'] == basename(__FILE__) ) { if ( 'save' == $_REQUEST['action'] ) { foreach ($options as $value) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } foreach ($options as $value) { if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } } header("Location: themes.php?page=theme-options.php&saved=true"); die; } else if( 'reset' == $_REQUEST['action'] ) { foreach ($options as $value) { delete_option( $value['id'] ); } header("Location: themes.php?page=theme-options.php&reset=true"); die; } else if ( 'reset_widgets' == $_REQUEST['action'] ) { $null = null; update_option('sidebars_widgets',$null); header("Location: themes.php?page=theme-options.php&reset=true"); die; } } add_theme_page($themename." Options", "Bibliteca Options", 'edit_themes', basename(__FILE__), 'mytheme_admin'); } function mytheme_admin() { global $themename, $shortname, $options; if ( $_REQUEST['saved'] ) echo '

'.$themename.' '.__('settings saved.','thematic').'

'; if ( $_REQUEST['reset'] ) echo '

'.$themename.' '.__('settings reset.','thematic').'

'; if ( $_REQUEST['reset_widgets'] ) echo '

'.$themename.' '.__('widgets reset.','thematic').'

'; ?>

Options

" />

$option) { $radio_setting = get_option($value['id']); if($radio_setting != ''){ if ($key == get_option($value['id']) ) { $checked = "checked=\"checked\""; } else { $checked = ""; } }else{ if($key == $value['std']){ $checked = "checked=\"checked\""; }else{ $checked = ""; } }?> />
/>

Biblioteca theme.