Index: .
===================================================================
--- .	(revision 23310)
+++ .	(working copy)

Property changes on: .
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,2 ##
+wordpress
+wp-config.php
Index: wp-admin/includes/nav-menu.php
===================================================================
--- wp-admin/includes/nav-menu.php	(revision 23310)
+++ wp-admin/includes/nav-menu.php	(working copy)
@@ -724,7 +724,13 @@
 				$args['walker'] = $walker;
 
 				// if we're dealing with pages, let's put a checkbox for the front page at the top of the list
-				if ( 'page' == $post_type_name ) {
+				// do we have a custom homepage? if not inject a Home page link into the pages list
+				//what page type is it add the front_or_home = true to the set page
+				
+				// check we don't have a custom home page and if so get the post type
+				$post_type_show_on_front = 'page' == get_option('show_on_front') ? get_post_type((int) get_option( 'page_on_front' )) : 'page';
+	
+				if ( $post_type_show_on_front == $post_type_name ) {
 					$front_page = 'page' == get_option('show_on_front') ? (int) get_option( 'page_on_front' ) : 0;
 					if ( ! empty( $front_page ) ) {
 						$front_page_obj = get_post( $front_page );
Index: wp-admin/options-reading.php
===================================================================
--- wp-admin/options-reading.php	(revision 23310)
+++ wp-admin/options-reading.php	(working copy)
@@ -114,7 +114,41 @@
 	</label>
 	</p>
 <ul>
-	<li><label for="page_on_front"><?php printf( __( 'Front page: %s' ), wp_dropdown_pages( array( 'name' => 'page_on_front', 'echo' => 0, 'show_option_none' => __( '&mdash; Select &mdash;' ), 'option_none_value' => '0', 'selected' => get_option( 'page_on_front' ) ) ) ); ?></label></li>
+	<?php
+	// this is in the wwrong place here for code and test need to be moved - not sure where
+	
+	/**
+	* this fillter adds all the post types that have 'show_in_home_page_list' => true set 
+	* to the 'post_type' array in the past in $args array
+	*
+	* @uses get_post_types
+	*
+	* @param array $args 
+	* @return $args
+	*
+	*/
+	function filter_register_post_type_add_to_front_or_home_list($args) {
+	// do we have any custom post types to add in to the list
+	//var $custom_post_types_for_homePage	= null;
+	$custom_post_types_for_homePage = get_post_types(array('show_in_home_page_list' => true, ));
+		foreach ($custom_post_types_for_homePage as $custom_post_type) {
+			if(array_key_exists('post_type', $args) && in_array('page',$args ) ){
+				if(is_array($args['post_type'])){
+					$args['post_type'] = array_merge( $args['post_type'], array($custom_post_type ));
+				}else{
+					$args['post_type'] = array($args['post_type'] ,$custom_post_type );
+				}
+			}else{
+				$args['post_type'] = array('page', $custom_post_type );
+			}
+		}
+		//print_r($args);
+	return $args;
+	}
+	// add via filter for now
+	add_filter('options-front-page' , 'filter_register_post_type_add_to_front_or_home_list');
+	?>
+	<li><label for="page_on_front"><?php printf( __( 'Front page: %s' ), wp_dropdown_pages( apply_filters('options-front-page',array( 'name' => 'page_on_front', 'echo' => 0, 'show_option_none' => __( '&mdash; Select &mdash;' ), 'option_none_value' => '0', 'selected' => get_option( 'page_on_front' ) ) ) ) ); ?></label></li>
 	<li><label for="page_for_posts"><?php printf( __( 'Posts page: %s' ), wp_dropdown_pages( array( 'name' => 'page_for_posts', 'echo' => 0, 'show_option_none' => __( '&mdash; Select &mdash;' ), 'option_none_value' => '0', 'selected' => get_option( 'page_for_posts' ) ) ) ); ?></label></li>
 </ul>
 <?php if ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) == get_option( 'page_on_front' ) ) : ?>
Index: wp-content/themes
===================================================================
--- wp-content/themes	(revision 23310)
+++ wp-content/themes	(working copy)

Property changes on: wp-content/themes
___________________________________________________________________
Added: svn:ignore
## -0,0 +1 ##
+twentytwelveTesting
Index: wp-includes/link-template.php
===================================================================
--- wp-includes/link-template.php	(revision 23310)
+++ wp-includes/link-template.php	(working copy)
@@ -103,7 +103,10 @@
 	if ( empty($post->ID) )
 		return false;
 
-	if ( $post->post_type == 'page' )
+	// check we don't have a custom home page and if so get the post type
+	$post_type_show_on_front = 'page' == get_option('show_on_front') ? get_post_type((int) get_option( 'page_on_front' )) : 'page';
+
+	if ( $post->post_type == $post_type_show_on_front )
 		return get_page_link($post->ID, $leavename, $sample);
 	elseif ( $post->post_type == 'attachment' )
 		return get_attachment_link( $post->ID, $leavename );
Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php	(revision 23310)
+++ wp-includes/post.php	(working copy)
@@ -1226,7 +1226,7 @@
 		'taxonomies' => array(), 'show_ui' => null, 'menu_position' => null, 'menu_icon' => null,
 		'can_export' => true,
 		'show_in_nav_menus' => null, 'show_in_menu' => null, 'show_in_admin_bar' => null,
-		'delete_with_user' => null,
+		'delete_with_user' => null,'show_in_home_page_list'=> null,
 	);
 	$args = wp_parse_args($args, $defaults);
 	$args = (object) $args;
@@ -1267,6 +1267,9 @@
 
 	if ( null === $args->map_meta_cap )
 		$args->map_meta_cap = false;
+	// where to show this custom page type as an option for the home page
+	if ( null === $args->show_in_home_page_list )
+		$args->show_in_home_page_list = false;
 
 	$args->cap = get_post_type_capabilities( $args );
 	unset($args->capabilities);
@@ -1310,6 +1313,7 @@
 
 		if ( $args->hierarchical )
 			add_rewrite_tag("%$post_type%", '(.+?)', $args->query_var ? "{$args->query_var}=" : "post_type=$post_type&name=");
+			// check for if it can shown as home
 		else
 			add_rewrite_tag("%$post_type%", '([^/]+)', $args->query_var ? "{$args->query_var}=" : "post_type=$post_type&name=");
 
@@ -3606,6 +3610,17 @@
 }
 
 /**
+ * Checks for value is in the hierarchical_post_types
+ *
+ *@return bool 
+ */
+function filter_hierarchical_post_types($post_types){
+	$hierarchical_post_types = get_post_types( array( 'hierarchical' => true ) );
+	return in_array( $post_types, $hierarchical_post_types );
+}
+
+
+/**
  * Retrieve a list of pages.
  *
  * The defaults that can be overridden are the following: 'child_of',
@@ -3638,9 +3653,17 @@
 	$number = (int) $number;
 	$offset = (int) $offset;
 
-	// Make sure the post type is hierarchical
+	// Make sure we have a valid post type
+	if ( !is_array( $post_type ) )
+		$post_type = explode( ',', $post_type );
+	if ( array_diff( $post_type, get_post_types() ) )
+		return $pages;
+	// Make sure the all post types are hierarchical
 	$hierarchical_post_types = get_post_types( array( 'hierarchical' => true ) );
-	if ( !in_array( $post_type, $hierarchical_post_types ) )
+	// remove any elemnts not in $hierarchical_post_types 
+	$post_type = array_filter($post_type, "filter_hierarchical_post_types");
+	//then check one last time to make sure
+	if ( !$post_type )
 		return $pages;
 
 	// Make sure we have a valid post status
@@ -3746,11 +3769,19 @@
 	if ( $parent >= 0 )
 		$where .= $wpdb->prepare(' AND post_parent = %d ', $parent);
 
+	// Check if post_type is an array so that Custom Page types can be added to dropdowns and lists
+	if ( 1 == count( $post_type ) ) {	
+		$where_post_type = $wpdb->prepare("post_type = %s"  , array_shift( $post_type ) );
+	} else{
+		$post_type = implode( "', '", $post_type );
+		$where_post_type = "post_type IN ('$post_type')";
+	}
+
 	if ( 1 == count( $post_status ) ) {
-		$where_post_type = $wpdb->prepare( "post_type = %s AND post_status = %s", $post_type, array_shift( $post_status ) );
+		$where_post_type .= $wpdb->prepare( " AND post_status = %s",  array_shift( $post_status ) );
 	} else {
 		$post_status = implode( "', '", $post_status );
-		$where_post_type = $wpdb->prepare( "post_type = %s AND post_status IN ('$post_status')", $post_type );
+		$where_post_type .= "AND post_status IN ('$post_status')" ;
 	}
 
 	$orderby_array = array();
