'1B1B1B',
'border' => '0A0A0A',
'text' => 'DDDDDD',
'link' => '6DCFF6'
);
$content_width = 510; // pixels
// And thus begins the Sandbox guts! Registers our default
// options, specifically loads the 2c-1.css file as default skin
function sandbox_get_option($name) {
$defaults = array(
'skin' => '2c-l',
);
$options = array_merge($defaults, (array) get_option('sandbox_options'));
if ( isset($options[$name]) )
return $options[$name];
return false;
}
// Andy really goes nuts with arrays, which has been a good thing. Very good.
function sandbox_set_options($new_options) {
$options = (array) get_option('sandbox_options');
$options = array_merge($options, (array) $new_options);
return update_option('sandbox_options', $options);
}
// Template tag: echoes a stylesheet link if one is selected
function sandbox_stylesheets() {
$skin = sandbox_get_option('skin');
if ( $skin != 'none' ) {
?>
" title="Sandbox" />
'.__('Skip navigation', 'sandbox').'
';
}
// Template tag: echoes a page list for navigation if the
// global_navigation option is set to "Y" in the skin file
function sandbox_globalnav() {
echo "
documentation for help installing new skins and information on the rich semantic markup that makes the Sandbox unique.', 'sandbox'), get_template_directory_uri() . '/readme.html'); ?>
wp_filter_kses($_GET['skin']),
'globalnav' => bool_from_yn($info['global_navigation'])
));
wp_redirect('themes.php?page=skins&message=updated');
}
}
// Sandbox skins menu: tells WordPress (nicely) to load the skins menu
function sandbox_admin_menu() {
add_theme_page(__('Sandbox Skins', 'sandbox'), __('Sandbox Skins', 'sandbox'), 'switch_themes', 'skins', 'sandbox_admin_skins');
}
// Sandbox widgets: initializes Widgets for the Sandbox
function sandbox_widgets_init() {
// Overrides the Widgets default and uses
's for sidebar headings
$p = array(
'before_title' => "
",
'after_title' => "
\n",
);
// How many? Two?! That's it?
register_sidebars(2, $p);
// Registers the widgets specific to the Sandbox, as set earlier
unregister_widget('WP_Widget_Search');
wp_register_sidebar_widget('search', __('Search', 'sandbox'), 'widget_sandbox_search');
unregister_widget('WP_Widget_Meta');
wp_register_sidebar_widget('meta', __('Meta', 'sandbox'), 'widget_sandbox_meta');
unregister_widget('WP_Widget_Links');
wp_register_sidebar_widget('links', __('Links', 'sandbox'), 'widget_sandbox_links');
register_sidebar_widget(array('Home Link', 'widgets'), 'widget_sandbox_homelink');
register_widget_control(array('Home Link', 'widgets'), 'widget_sandbox_homelink_control', null, 125);
register_sidebar_widget(array('RSS Links', 'widgets'), 'widget_sandbox_rsslinks');
register_widget_control(array('RSS Links', 'widgets'), 'widget_sandbox_rsslinks_control', null, 90);
}
// Runs our code at the end to check that everything needed has loaded
add_action('init', 'sandbox_init', 1);
add_action('widgets_init', 'sandbox_widgets_init');
#add_action('admin_menu', 'sandbox_admin_menu');
// Adds filters for greater compliance
add_filter('archive_meta', 'wptexturize');
add_filter('archive_meta', 'convert_smilies');
add_filter('archive_meta', 'convert_chars');
add_filter('archive_meta', 'wpautop');
?>