Fix warnings related to static pages. props zeo for initial patch. fixes #13830.
git-svn-id: http://svn.automattic.com/wordpress/trunk@15227 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b0213b6af7
commit
2eadcb9aef
|
@ -314,6 +314,10 @@ function populate_options() {
|
|||
'embed_autourls' => 1,
|
||||
'embed_size_w' => '',
|
||||
'embed_size_h' => 600,
|
||||
|
||||
// 3.0
|
||||
'page_for_posts' => 0,
|
||||
'page_on_front' => 0,
|
||||
);
|
||||
|
||||
// 3.0 multisite
|
||||
|
|
|
@ -38,7 +38,10 @@ include( './admin-header.php' );
|
|||
<?php if ( ! get_pages() ) : ?>
|
||||
<input name="show_on_front" type="hidden" value="posts" />
|
||||
<table class="form-table">
|
||||
<?php else : ?>
|
||||
<?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' );
|
||||
?>
|
||||
<table class="form-table">
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _e( 'Front page displays' ); ?></th>
|
||||
|
@ -54,8 +57,8 @@ include( './admin-header.php' );
|
|||
</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' => __( '— Select —' ), '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' => __( '— Select —' ), 'selected' => get_option( 'page_for_posts' ) ) ) ); ?></label></li>
|
||||
<li><label for="page_on_front"><?php printf( __( 'Front page: %s' ), wp_dropdown_pages( array( 'name' => 'page_on_front', 'echo' => 0, 'show_option_none' => __( '— Select —' ), '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' => __( '— Select —' ), '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' ) ) : ?>
|
||||
<div id="front-page-warning" class="error inline"><p><?php _e( '<strong>Warning:</strong> these pages should not be the same!' ); ?></p></div>
|
||||
|
|
|
@ -2402,6 +2402,7 @@ function sanitize_option($option, $value) {
|
|||
case 'mailserver_port':
|
||||
case 'comment_max_links':
|
||||
case 'page_on_front':
|
||||
case 'page_for_posts':
|
||||
case 'rss_excerpt_length':
|
||||
case 'default_category':
|
||||
case 'default_email_category':
|
||||
|
|
|
@ -585,7 +585,7 @@ function wp_title($sep = '»', $display = true, $seplocation = '') {
|
|||
// If there is a post
|
||||
if ( is_single() || ( is_home() && !is_front_page() ) || ( is_page() && !is_front_page() ) ) {
|
||||
$post = $wp_query->get_queried_object();
|
||||
$title = apply_filters( 'single_post_title', empty( $post->post_title ) ? '' : $post->post_title );
|
||||
$title = apply_filters( 'single_post_title', $post->post_title );
|
||||
}
|
||||
|
||||
// If there's a taxonomy
|
||||
|
|
Loading…
Reference in New Issue