<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[15227] trunk: Fix warnings related to static pages.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/15227">15227</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2010-06-11 17:04:06 +0000 (Fri, 11 Jun 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Fix warnings related to static pages. props zeo for initial patch. fixes <a href="http://trac.wordpress.org/ticket/13830">#13830</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesschemaphp">trunk/wp-admin/includes/schema.php</a></li>
<li><a href="#trunkwpadminoptionsreadingphp">trunk/wp-admin/options-reading.php</a></li>
<li><a href="#trunkwpincludesformattingphp">trunk/wp-includes/formatting.php</a></li>
<li><a href="#trunkwpincludesgeneraltemplatephp">trunk/wp-includes/general-template.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesschemaphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/schema.php (15226 => 15227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/schema.php        2010-06-11 16:55:41 UTC (rev 15226)
+++ trunk/wp-admin/includes/schema.php        2010-06-11 17:04:06 UTC (rev 15227)
</span><span class="lines">@@ -314,6 +314,10 @@
</span><span class="cx">         'embed_autourls' => 1,
</span><span class="cx">         'embed_size_w' => '',
</span><span class="cx">         'embed_size_h' => 600,
</span><ins>+
+        // 3.0
+        'page_for_posts' => 0,
+        'page_on_front' => 0,
</ins><span class="cx">         );
</span><span class="cx">
</span><span class="cx">         // 3.0 multisite
</span></span></pre></div>
<a id="trunkwpadminoptionsreadingphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/options-reading.php (15226 => 15227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/options-reading.php        2010-06-11 16:55:41 UTC (rev 15226)
+++ trunk/wp-admin/options-reading.php        2010-06-11 17:04:06 UTC (rev 15227)
</span><span class="lines">@@ -38,7 +38,10 @@
</span><span class="cx"> <?php if ( ! get_pages() ) : ?>
</span><span class="cx"> <input name="show_on_front" type="hidden" value="posts" />
</span><span class="cx"> <table class="form-table">
</span><del>-<?php else : ?>
</del><ins>+<?php else :
+        if ( 'page' == get_option( 'show_on_front' ) && ! get_option( 'page_on_front' ) && ! get_option( 'page_for_posts' ) )
+                update_option( 'show_on_front', 'posts' );
+?>
</ins><span class="cx"> <table class="form-table">
</span><span class="cx"> <tr valign="top">
</span><span class="cx"> <th scope="row"><?php _e( 'Front page displays' ); ?></th>
</span><span class="lines">@@ -54,8 +57,8 @@
</span><span class="cx">         </label>
</span><span class="cx">         </p>
</span><span class="cx"> <ul>
</span><del>-        <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;' ), '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;' ), 'selected' => get_option( 'page_for_posts' ) ) ) ); ?></label></li>
</del><ins>+        <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>
+        <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>
</ins><span class="cx"> </ul>
</span><span class="cx"> <?php if ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) == get_option( 'page_on_front' ) ) : ?>
</span><span class="cx"> <div id="front-page-warning" class="error inline"><p><?php _e( '<strong>Warning:</strong> these pages should not be the same!' ); ?></p></div>
</span></span></pre></div>
<a id="trunkwpincludesformattingphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/formatting.php (15226 => 15227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/formatting.php        2010-06-11 16:55:41 UTC (rev 15226)
+++ trunk/wp-includes/formatting.php        2010-06-11 17:04:06 UTC (rev 15227)
</span><span class="lines">@@ -2402,6 +2402,7 @@
</span><span class="cx">                 case 'mailserver_port':
</span><span class="cx">                 case 'comment_max_links':
</span><span class="cx">                 case 'page_on_front':
</span><ins>+                case 'page_for_posts':
</ins><span class="cx">                 case 'rss_excerpt_length':
</span><span class="cx">                 case 'default_category':
</span><span class="cx">                 case 'default_email_category':
</span></span></pre></div>
<a id="trunkwpincludesgeneraltemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/general-template.php (15226 => 15227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/general-template.php        2010-06-11 16:55:41 UTC (rev 15226)
+++ trunk/wp-includes/general-template.php        2010-06-11 17:04:06 UTC (rev 15227)
</span><span class="lines">@@ -585,7 +585,7 @@
</span><span class="cx">         // If there is a post
</span><span class="cx">         if ( is_single() || ( is_home() && !is_front_page() ) || ( is_page() && !is_front_page() ) ) {
</span><span class="cx">                 $post = $wp_query->get_queried_object();
</span><del>-                $title = apply_filters( 'single_post_title', empty( $post->post_title ) ? '' : $post->post_title );
</del><ins>+                $title = apply_filters( 'single_post_title', $post->post_title );
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         // If there's a taxonomy
</span></span></pre>
</div>
</div>
</body>
</html>