Remove old preview stuff. Allow draft posts to be displayed if the logged in user has edit permissions on the draft. Don't use cruft-free links for drafts since they might not have a slug. http://mosquito.wordpress.org/view.php?id=1220

git-svn-id: https://develop.svn.wordpress.org/trunk@2523 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2005-04-09 17:12:36 +00:00
parent 16a3144b00
commit a0d5ea6ba2
5 changed files with 36 additions and 36 deletions

View File

@@ -856,24 +856,11 @@ function start_wp() {
// Setup global post data.
function setup_postdata($post) {
global $id, $postdata, $authordata, $day, $preview, $page, $pages, $multipage, $more, $numpages, $wp_query;
global $id, $postdata, $authordata, $day, $page, $pages, $multipage, $more, $numpages, $wp_query;
global $pagenow;
if (!$preview) {
$id = $post->ID;
} else {
$id = 0;
$postdata = array (
'ID' => 0,
'Author_ID' => $_GET['preview_userid'],
'Date' => $_GET['preview_date'],
'Content' => $_GET['preview_content'],
'Excerpt' => $_GET['preview_excerpt'],
'Title' => $_GET['preview_title'],
'Category' => $_GET['preview_category'],
'Notify' => 1
);
}
$id = $post->ID;
$authordata = get_userdata($post->post_author);
$day = mysql2date('d.m.y', $post->post_date);
@@ -1158,7 +1145,7 @@ function update_post_caches(&$posts) {
$comment_counts = $wpdb->get_results("SELECT ID, COUNT( comment_ID ) AS ccount
FROM $wpdb->posts
LEFT JOIN $wpdb->comments ON ( comment_post_ID = ID AND comment_approved = '1')
WHERE post_status = 'publish' AND ID IN ($post_id_list)
WHERE ID IN ($post_id_list)
GROUP BY ID");
if ($comment_counts) {