diff --git a/wp-admin/options-reading.php b/wp-admin/options-reading.php index f63606fd3a..d0dced01f3 100644 --- a/wp-admin/options-reading.php +++ b/wp-admin/options-reading.php @@ -9,7 +9,37 @@ include('admin-header.php');

-
+ + + +
+ + + + + + +
+

+ +

+

+ +

+

+
+ +

+
+
+ +
@@ -55,7 +85,7 @@ include('admin-header.php');

- +

diff --git a/wp-admin/upgrade-functions.php b/wp-admin/upgrade-functions.php index 3a75f29e83..71390ed62b 100644 --- a/wp-admin/upgrade-functions.php +++ b/wp-admin/upgrade-functions.php @@ -34,7 +34,7 @@ function upgrade_all() { if ( $wp_current_db_version < 3308 ) upgrade_160(); - if ( $wp_current_db_version < 3570 ) + if ( $wp_current_db_version < 3582 ) upgrade_210(); $wp_rewrite->flush_rules(); diff --git a/wp-admin/upgrade-schema.php b/wp-admin/upgrade-schema.php index e52ae0c080..65c6267550 100644 --- a/wp-admin/upgrade-schema.php +++ b/wp-admin/upgrade-schema.php @@ -242,6 +242,7 @@ function populate_options() { // 2.1 add_option('blog_public', 1); add_option('default_link_category', 2); + add_option('show_on_front', 'posts'); // Delete unused options $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog'); diff --git a/wp-includes/classes.php b/wp-includes/classes.php index adb0b92ae6..d777f9555d 100644 --- a/wp-includes/classes.php +++ b/wp-includes/classes.php @@ -293,6 +293,12 @@ class WP_Query { $q['what_to_show'] = 'posts'; } + if ( $this->is_home && ( 'page' == get_option('show_on_front') ) && get_option('page_on_front') ) { + $this->is_page = true; + $this->is_home = false; + $q['page_id'] = get_option('page_on_front'); + } + if (isset($q['page'])) { $q['page'] = trim($q['page'], '/'); $q['page'] = (int) $q['page']; @@ -363,12 +369,17 @@ class WP_Query { $reqpage = $reqpage->ID; else $reqpage = 0; - $q['pagename'] = str_replace('%2F', '/', urlencode(urldecode($q['pagename']))); - $page_paths = '/' . trim($q['pagename'], '/'); - $q['pagename'] = sanitize_title(basename($page_paths)); - $q['name'] = $q['pagename']; - $where .= " AND (ID = '$reqpage')"; + if ( ('page' == get_option('show_on_front') ) && ( $reqpage == get_option('page_for_posts') ) ) { + $this->is_page = false; + $this->is_home = true; + } else { + $q['pagename'] = str_replace('%2F', '/', urlencode(urldecode($q['pagename']))); + $page_paths = '/' . trim($q['pagename'], '/'); + $q['pagename'] = sanitize_title(basename($page_paths)); + $q['name'] = $q['pagename']; + $where .= " AND (ID = '$reqpage')"; + } } elseif ('' != $q['attachment']) { $q['attachment'] = str_replace('%2F', '/', urlencode(urldecode($q['attachment']))); $attach_paths = '/' . trim($q['attachment'], '/'); @@ -397,8 +408,13 @@ class WP_Query { if (($q['page_id'] != '') && (intval($q['page_id']) != 0)) { $q['page_id'] = intval($q['page_id']); - $q['p'] = $q['page_id']; - $where = ' AND ID = '.$q['page_id']; + if ( ('page' == get_option('show_on_front') ) && ( $q['page_id'] == get_option('page_for_posts') ) ) { + $this->is_page = false; + $this->is_home = true; + } else { + $q['p'] = $q['page_id']; + $where = ' AND ID = '.$q['page_id']; + } } // If a search pattern is specified, load the posts that match diff --git a/wp-includes/version.php b/wp-includes/version.php index f9bd898fbf..7430ed79e5 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -3,6 +3,6 @@ // This just holds the version number, in a separate file so we can bump it without cluttering the SVN $wp_version = '2.1-alpha1'; -$wp_db_version = 3570; +$wp_db_version = 3582; ?> \ No newline at end of file