'.__("Twenty Ten Weaver advanced options saved.",$ttwTrans).'
';
update_option('ttw_head_opts', str_replace("\\", "", $_POST['ttw_head_opts']));
update_option('ttw_theme_head_opts', str_replace("\\", "", $_POST['ttw_theme_head_opts']));
update_option('ttw_end_opts', str_replace("\\", "", $_POST['ttw_end_opts']));
update_option('ttw_footer_opts', str_replace("\\", "", $_POST['ttw_footer_opts']));
update_option('ttw_header_insert', str_replace("\\", "", $_POST['ttw_header_insert']));
}
if ($_POST['setsubtheme'] || $_POST['setsubtheme2']) { /* seems like Mozilla doesn't like 2 sets of select inputs
on same page, so we make up 2 ids/names to use */
if ($_POST['setsubtheme']) $pID = 'ttw_subtheme';
else $pID = 'ttw_subtheme2';
$cur_subtheme = $_POST[ $pID]; /* must have been set to get here */
if ($cur_subtheme == '') $cur_subtheme = 'Default'; /* but just in case */
update_option('ttw_subtheme', $cur_subtheme); /* and save it */
/* we will be resetting everything, no matter what, so clear 'em all from $options */
foreach ($options as $value) {
delete_option( $value['id'] );
}
/* Hmmm... what do we do? Clear EVERYTHING, or just the theme_head_opts? - Let's do only head_opts for now. */
foreach (array (/*'ttw_head_opts', 'ttw_footer_opts', 'ttw_end_opts', */ 'ttw_theme_head_opts') as $value) {
delete_option( $value ); /* these are the advanced options + special theme head opts */
}
/* now, if something other than "Default" theme, set all values for theme */
if ($cur_subtheme != "Default")
st_set_subtheme($cur_subtheme);
$t = get_option('ttw_subtheme'); if ($t == '') $t = "Default"; /* did we save a theme? */
echo '
'.__("Twenty Ten Weaver options reset to sub-theme: ",$ttwTrans).$t.
'. '.__('Remember to set Background color to match!',$ttwTrans).'
';
}
if ($_POST['savemytheme']) {
update_option('ttw_subtheme', "My Saved Theme"); /* and save it */
ttw_savemytheme();
echo '
'.__('All current main and advanced options saved in My Saved Theme.',$ttwTrans).'
';
}
if ($_POST['exporttheme']) {
ttw_export_theme();
}
if ($_POST['uploadtheme']) {
if (ttw_upload_theme()) {
$t = get_option('ttw_subtheme'); if ($t == '') $t = "Default"; /* did we save a theme? */
echo '
'.__("Twenty Ten Weaver options reset to uploaded theme, saved as: ",$ttwTrans).$t.
'. '.__('Remember to set Background color to match!',$ttwTrans).'
'); /* and add the extended option admin tab if exists */ ?>
',
'
'); /* and add the extended option admin tab if exists */ ?>
Preview of site. Displays current look after you save options or select sub-theme.
\n");
/* here, we output our style sheet overrides */ ?>
\n");
} /* end mytheme_wp_head */
function childtheme_set_hi_height($def) {
global $themename, $options;
/* filter to change the height of the default header image */
$val = t_get_text_option_value("ttw_header_image_height");
return (int) $val;
}
require_once("ttw-options.php"); /* add the rest of our files */
require_once("ttw-advancedopts.php");
require_once("ttw-help.php");
require_once("ttw-subthemes.php");
require_once("ttw-extend.php");
require_once("2010functions.php"); /* load the parent */
/* This is where the theme hooks into the rest of Wordpress */
add_filter('twentyten_header_image_height', 'childtheme_set_hi_height');
add_action('after_setup_theme', 'weaver2010_setup' );
add_action('wp_head', 'mytheme_wp_head');
add_action('admin_menu', 'mytheme_add_admin');
?>