Fix AJAX comment ops for single pages. Props mdawaffe. fixes #6165

git-svn-id: http://svn.automattic.com/wordpress/trunk@7248 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-03-11 20:26:10 +00:00
parent 4416bcf555
commit 66e8bdb87f
1 changed files with 10 additions and 8 deletions

View File

@ -34,9 +34,6 @@ if ( isset($_GET['deleteit']) && isset($_GET['delete']) ) {
$title = __('Pages'); $title = __('Pages');
$parent_file = 'edit.php'; $parent_file = 'edit.php';
wp_enqueue_script('admin-forms'); wp_enqueue_script('admin-forms');
if ( 1 == $_GET['c'] )
wp_enqueue_script( 'admin-comments' );
require_once('admin-header.php');
$post_stati = array( // array( adj, noun ) $post_stati = array( // array( adj, noun )
'publish' => array(__('Published'), __('Published pages'), __('Published (%s)')), 'publish' => array(__('Published'), __('Published pages'), __('Published (%s)')),
@ -54,6 +51,15 @@ if ( isset($_GET['post_status']) && in_array( $_GET['post_status'], array_keys($
$post_status_q .= '&perm=readable'; $post_status_q .= '&perm=readable';
} }
$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";
$query_str = apply_filters('manage_pages_query', $query_str);
wp($query_str);
if ( is_singular() )
wp_enqueue_script( 'admin-comments' );
require_once('admin-header.php');
?> ?>
<div class="wrap"> <div class="wrap">
<form id="posts-filter" action="" method="get"> <form id="posts-filter" action="" method="get">
@ -122,10 +128,6 @@ endif;
<br style="clear:both;" /> <br style="clear:both;" />
<?php <?php
$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";
$query_str = apply_filters('manage_pages_query', $query_str);
wp($query_str);
$all = !( $h2_search || $post_status_q ); $all = !( $h2_search || $post_status_q );
@ -164,7 +166,7 @@ if ($posts) {
<?php <?php
if ( 1 == count($posts) && isset( $_GET['page_id'] ) ) : if ( 1 == count($posts) && is_singular() ) :
$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved != 'spam' ORDER BY comment_date"); $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved != 'spam' ORDER BY comment_date");
if ( $comments ) : if ( $comments ) :