My theme options save routine is below. I'm finding that if the $value['id'] being passed from my options array has a period in it, the data does not get passed and the options appear to break at that point. Should I opt for another character or is theirthere a workaround for using the period character asin an option name?
For example, this works fine:
"id" => "myTheme_color|sidebar",
but this does not (no data is passed for the value):
"id" => "myTheme_color.sidebar",
The save function is:
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'], stripslashes($_REQUEST[$value['id']]) );
}
foreach ($options as $value)
{
if( isset( $_REQUEST[ $value['id'] ] ) )
{
update_option( $value['id'], stripslashes($_REQUEST[ $value['id'] ]) );
echo $value['id'].": ".$_REQUEST[$value['id']]."<br>";
echo $value['id'].": ".stripslashes($_REQUEST[$value['id']])."<br>";
}
}
}
}