Changeset 7077
- Timestamp:
- 02/27/08 23:57:00 (9 months ago)
- Files:
-
- trunk/wp-admin/edit-pages.php (modified) (2 diffs)
- trunk/wp-includes/widgets.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-admin/edit-pages.php
r7057 r7077 123 123 <?php 124 124 $query_str = "post_type=page&orderby=menu_order title&what_to_show=posts$post_status_q&posts_per_page=-1&posts_per_archive_page=-1&order=asc"; 125 if ( !empty($_GET['p']) ) { 126 $query_str .= "p= 127 } 125 128 $query_str = apply_filters('manage_pages_query', $query_str); 126 129 wp($query_str); … … 161 164 </div> 162 165 166 <?php 167 if ( 1 == count($posts) && isset( $_GET['p'] ) ) { 168 169 $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved != 'spam' ORDER BY comment_date"); 170 if ($comments) { 171 // Make sure comments, post, and post_author are cached 172 update_comment_cache($comments); 173 $post = get_post($id); 174 $authordata = get_userdata($post->post_author); 175 ?> 176 <h3 id="comments"><?php _e('Comments') ?></h3> 177 <ol id="the-comment-list" class="list:comment commentlist"> 178 <?php 179 $i = 0; 180 foreach ( $comments as $comment ) { 181 _wp_comment_list_item( $comment->comment_ID, ++$i ); 182 } 183 echo '</ol>'; 184 } // end if comments 185 ?> 186 <?php } ?> 187 163 188 </div> 164 189 trunk/wp-includes/widgets.php
r6983 r7077 648 648 $name = __('Text'); 649 649 650 // If there are none, we register the widget's existance with a generic template 651 if ( !$options ) { 652 wp_register_sidebar_widget( 'text-1', $name, 'wp_widget_text', $widget_ops, array( 'number' => -1 ) ); 653 wp_register_widget_control( 'text-1', $name, 'wp_widget_text_control', $control_ops, array( 'number' => -1 ) ); 654 } 655 650 $id = false; 656 651 foreach ( array_keys($options) as $o ) { 657 652 // Old widgets can have null values for some reason … … 661 656 wp_register_sidebar_widget($id, $name, 'wp_widget_text', $widget_ops, array( 'number' => $o )); 662 657 wp_register_widget_control($id, $name, 'wp_widget_text_control', $control_ops, array( 'number' => $o )); 658 } 659 660 // If there are none, we register the widget's existance with a generic template 661 if ( !$id ) { 662 wp_register_sidebar_widget( 'text-1', $name, 'wp_widget_text', $widget_ops, array( 'number' => -1 ) ); 663 wp_register_widget_control( 'text-1', $name, 'wp_widget_text_control', $control_ops, array( 'number' => -1 ) ); 663 664 } 664 665 } … … 809 810 $name = __( 'Categories' ); 810 811 811 // If there are none, we register the widget's existance with a generic template 812 if ( !$options ) { 813 wp_register_sidebar_widget( 'categories-1', $name, 'wp_widget_categories', $widget_ops, array( 'number' => -1 ) ); 814 wp_register_widget_control( 'categories-1', $name, 'wp_widget_categories_control', array( 'id_base' => 'categories' ), array( 'number' => -1 ) ); 815 } 816 812 $id = false; 817 813 foreach ( array_keys($options) as $o ) { 818 814 // Old widgets can have null values for some reason … … 824 820 } 825 821 822 // If there are none, we register the widget's existance with a generic template 823 if ( !$id ) { 824 wp_register_sidebar_widget( 'categories-1', $name, 'wp_widget_categories', $widget_ops, array( 'number' => -1 ) ); 825 wp_register_widget_control( 'categories-1', $name, 'wp_widget_categories_control', array( 'id_base' => 'categories' ), array( 'number' => -1 ) ); 826 } 826 827 } 827 828 … … 1298 1299 $name = __('RSS'); 1299 1300 1300 // If there are none, we register the widget's existance with a generic template 1301 if ( !$options ) { 1302 wp_register_sidebar_widget( 'rss-1', $name, 'wp_widget_rss', $widget_ops, array( 'number' => -1 ) ); 1303 wp_register_widget_control( 'rss-1', $name, 'wp_widget_rss_control', $control_ops, array( 'number' => -1 ) ); 1304 } 1305 1301 $id = false; 1306 1302 foreach ( array_keys($options) as $o ) { 1307 1303 // Old widgets can have null values for some reason … … 1311 1307 wp_register_sidebar_widget($id, $name, 'wp_widget_rss', $widget_ops, array( 'number' => $o )); 1312 1308 wp_register_widget_control($id, $name, 'wp_widget_rss_control', $control_ops, array( 'number' => $o )); 1309 } 1310 1311 // If there are none, we register the widget's existance with a generic template 1312 if ( !$id ) { 1313 wp_register_sidebar_widget( 'rss-1', $name, 'wp_widget_rss', $widget_ops, array( 'number' => -1 ) ); 1314 wp_register_widget_control( 'rss-1', $name, 'wp_widget_rss_control', $control_ops, array( 'number' => -1 ) ); 1313 1315 } 1314 1316 } … … 1490 1492 $name = __('Many'); 1491 1493 1492 // If there are none, we register the widget's existance with a generic template 1493 if ( !$options ) { 1494 wp_register_sidebar_widget( 'many-1', $name, 'widget_many', $widget_ops, array( 'number' => -1 ) ); 1495 wp_register_widget_control( 'many-1', $name, 'widget_many_control', $control_ops, array( 'number' => -1 ) ); 1496 } 1497 1494 $registered = false; 1498 1495 foreach ( array_keys($options) as $o ) { 1499 1496 // Old widgets can have null values for some reason … … 1503 1500 // $id should look like {$id_base}-{$o} 1504 1501 $id = "many-$o"; // Never never never translate an id 1502 $registered = true; 1505 1503 wp_register_sidebar_widget( $id, $name, 'wp_widget_text', $widget_ops, array( 'number' => $o ) ); 1506 1504 wp_register_widget_control( $id, $name, 'wp_widget_text_control', $control_ops, array( 'number' => $o ) ); 1507 1505 } 1506 1507 // If there are none, we register the widget's existance with a generic template 1508 if ( !$registered ) { 1509 wp_register_sidebar_widget( 'many-1', $name, 'widget_many', $widget_ops, array( 'number' => -1 ) ); 1510 wp_register_widget_control( 'many-1', $name, 'widget_many_control', $control_ops, array( 'number' => -1 ) ); 1511 } 1508 1512 } 1509 1513
