Index: wp-includes/general-template.php
===================================================================
--- wp-includes/general-template.php	(revision 15830)
+++ wp-includes/general-template.php	(working copy)
@@ -1,5 +1,24 @@
 <?php
 /**
+ * Stub function allowing filters on get_(header|footer|sidebar|template_part) functions.
+ * Plugins can take over template elements giving a lot more versatility to template designers.
+ * 
+ * @author 5ubliminal
+ * @internal
+ * @param string $template
+ * @param array $templates
+ * @return array
+ */
+function apply_templates_filter($template, $templates){
+	// If plugins don't return a valid array just return the defaults
+	if(!is_array($tpls = apply_filters("{$template}_templates", $templates)) || empty($tpls)) return $templates;
+	// Try and validate existance of a file in new template array... if not found fade back to defaults
+	if((!$tpl = locate_template($tpls)) || empty($tpl)) return $templates;
+	// Return the new array here (previous line can be skipped but better safe than sorry)
+	return $tpls;
+}
+
+/**
  * General template tags that can go anywhere in a template.
  *
  * @package WordPress
@@ -29,6 +48,12 @@
 		$templates[] = "header-{$name}.php";
 
 	$templates[] = "header.php";
+	
+	/**
+	 * Allow plugins to hook in here and add / remove templates.
+	 * @see apply_templates_filter()
+	 */
+	$templates = apply_templates_filter('header', $templates);
 
 	// Backward compat code will be removed in a future release
 	if ('' == locate_template($templates, true))
@@ -59,6 +84,12 @@
 
 	$templates[] = "footer.php";
 
+	/**
+	 * Allow plugins to hook in here and add / remove templates.
+	 * @see apply_templates_filter()
+	 */
+	$templates = apply_templates_filter('footer', $templates);
+
 	// Backward compat code will be removed in a future release
 	if ('' == locate_template($templates, true))
 		load_template( ABSPATH . WPINC . '/theme-compat/footer.php');
@@ -88,6 +119,12 @@
 
 	$templates[] = "sidebar.php";
 
+	/**
+	 * Allow plugins to hook in here and add / remove templates.
+	 * @see apply_templates_filter()
+	 */
+	$templates = apply_templates_filter('sidebar', $templates);
+
 	// Backward compat code will be removed in a future release
 	if ('' == locate_template($templates, true))
 		load_template( ABSPATH . WPINC . '/theme-compat/sidebar.php');
@@ -125,6 +162,12 @@
 
 	$templates[] = "{$slug}.php";
 
+	/**
+	 * Allow plugins to hook in here and add / remove templates.
+	 * @see apply_templates_filter()
+	 */
+	$templates = apply_templates_filter("part-{$slug}", $templates);
+	
 	locate_template($templates, true, false);
 }
 
