Ticket #15208: 15208.patch
File 15208.patch, 2.8 KB (added by , 13 years ago) |
---|
-
wp-admin/options-reading.php
61 61 <form name="form1" method="post" action="options.php"> 62 62 <?php settings_fields( 'reading' ); ?> 63 63 64 <?php if ( ! get_pages() ) : ?>65 <input name="show_on_front" type="hidden" value="posts" />66 <table class="form-table">67 64 <?php 68 if ( 'posts' != get_option( 'show_on_front' ) ) : 65 $no_pages = false; 66 if ( ! get_pages() ) { 67 $no_pages = true; 68 if ( 'posts' != get_option( 'show_on_front' ) ) 69 69 update_option( 'show_on_front', 'posts' ); 70 endif; 71 72 else : 73 if ( 'page' == get_option( 'show_on_front' ) && ! get_option( 'page_on_front' ) && ! get_option( 'page_for_posts' ) ) 74 update_option( 'show_on_front', 'posts' ); 70 } elseif ( 'page' == get_option( 'show_on_front' ) && ! get_option( 'page_on_front' ) && ! get_option( 'page_for_posts' ) ) { 71 update_option( 'show_on_front', 'posts' ); 72 } 75 73 ?> 76 74 <table class="form-table"> 77 75 <tr valign="top"> … … 83 81 </label> 84 82 </p> 85 83 <p><label> 84 <?php if ( ! $no_pages ) : ?> 86 85 <input name="show_on_front" type="radio" value="page" class="tog" <?php checked( 'page', get_option( 'show_on_front' ) ); ?> /> 87 86 <?php printf( __( 'A <a href="%s">static page</a> (select below)' ), 'edit.php?post_type=page' ); ?> 87 <?php else : ?> 88 <input name="show_on_front" type="radio" value="page" class="tog" disabled="disabled" <?php checked( 'page', get_option( 'show_on_front' ) ); ?> /> 89 <?php printf( __( 'A <a href="%s">static page</a> (you need to <strong>publish</strong> a page if you wish to use it as your site\'s front page)' ), 'edit.php?post_type=page' ); ?> 90 <?php endif; ?> 88 91 </label> 89 92 </p> 93 <?php if ( ! $no_pages ) : ?> 90 94 <ul> 91 95 <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> 92 96 <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> 93 97 </ul> 98 <?php endif; ?> 94 99 <?php if ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) == get_option( 'page_on_front' ) ) : ?> 95 100 <div id="front-page-warning" class="error inline"><p><?php _e( '<strong>Warning:</strong> these pages should not be the same!' ); ?></p></div> 96 101 <?php endif; ?> 97 102 </fieldset></td> 98 103 </tr> 99 <?php endif; ?>100 104 <tr valign="top"> 101 105 <th scope="row"><label for="posts_per_page"><?php _e( 'Blog pages show at most' ); ?></label></th> 102 106 <td>