Changeset 2524
- Timestamp:
- 04/09/2005 05:25:47 PM (20 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/post.php
r2496 r2524 208 208 die ( __('You are not allowed to edit this post.') ); 209 209 210 $postdata = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID = '$post_ID'");210 $postdata = &get_post($post_ID); 211 211 $content = $postdata->post_content; 212 212 $content = format_to_edit($content); … … 238 238 } 239 239 240 $post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID = '$post_ID'");240 $post = &$postdata; 241 241 ?> 242 242 <div id='preview' class='wrap'> … … 528 528 } 529 529 530 $postdata = get_post data($p) or die(sprintf(__('Oops, no post with this ID. <a href="%s">Go back</a>!'), 'edit.php'));530 $postdata = get_post($p) or die(sprintf(__('Oops, no post with this ID. <a href="%s">Go back</a>!'), 'edit.php')); 531 531 $commentdata = get_commentdata($comment, 1, true) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'post.php')); 532 532 -
trunk/wp-includes/functions.php
r2523 r2524 462 462 } 463 463 464 // Deprecated. Use get_post(). 464 465 function get_postdata($postid) { 465 global $post, $wpdb; 466 467 if ( $postid == $post->ID ) 468 $a_post = $post; 469 else 470 $a_post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID = '$postid'"); 466 $post = &get_post($postid); 471 467 472 468 $postdata = array ( 473 'ID' => $ a_post->ID,474 'Author_ID' => $ a_post->post_author,475 'Date' => $ a_post->post_date,476 'Content' => $ a_post->post_content,477 'Excerpt' => $ a_post->post_excerpt,478 'Title' => $ a_post->post_title,479 'Category' => $ a_post->post_category,480 'post_status' => $ a_post->post_status,481 'comment_status' => $ a_post->comment_status,482 'ping_status' => $ a_post->ping_status,483 'post_password' => $ a_post->post_password,484 'to_ping' => $ a_post->to_ping,485 'pinged' => $ a_post->pinged,486 'post_name' => $ a_post->post_name469 'ID' => $post->ID, 470 'Author_ID' => $post->post_author, 471 'Date' => $post->post_date, 472 'Content' => $post->post_content, 473 'Excerpt' => $post->post_excerpt, 474 'Title' => $post->post_title, 475 'Category' => $post->post_category, 476 'post_status' => $post->post_status, 477 'comment_status' => $post->comment_status, 478 'ping_status' => $post->ping_status, 479 'post_password' => $post->post_password, 480 'to_ping' => $post->to_ping, 481 'pinged' => $post->pinged, 482 'post_name' => $post->post_name 487 483 ); 484 488 485 return $postdata; 489 486 }
Note: See TracChangeset
for help on using the changeset viewer.