Ticket #10801: 10801.2.diff
| File 10801.2.diff, 1.8 KB (added by , 16 years ago) |
|---|
-
wp-includes/post.php
211 211 $null = null; 212 212 213 213 if ( empty($post) ) { 214 if ( isset($GLOBALS['post']) ) 215 $_post = & $GLOBALS['post']; 216 else 214 if ( isset($GLOBALS['post']) ) { 215 if ( !isset($GLOBALS['post']->filter) || ($filter == $GLOBALS['post']->filter) ) 216 $_post = & $GLOBALS['post']; 217 elseif ( isset($GLOBALS['post']->ID) ) 218 return get_post($post, $output, $filter); 219 else 220 return $null; 221 } else { 217 222 return $null; 223 } 218 224 } elseif ( is_object($post) && empty($post->filter) ) { 219 225 _get_post_ancestors($post); 220 226 wp_cache_add($post->ID, $post, 'posts'); … … 725 731 */ 726 732 function sanitize_post($post, $context = 'display') { 727 733 if ( is_object($post) ) { 734 // Is post already filtered for this context. 735 if ( isset($post->filter) && $context == $post->filter ) 736 return $post; 737 728 738 if ( !isset($post->ID) ) 729 739 $post->ID = 0; 730 740 foreach ( array_keys(get_object_vars($post)) as $field ) 731 741 $post->$field = sanitize_post_field($field, $post->$field, $post->ID, $context); 732 742 $post->filter = $context; 733 743 } else { 744 // Is post already filtered for this context. 745 if ( isset($post['filter']) && $context == $post['filter'] ) 746 return $post; 747 734 748 if ( !isset($post['ID']) ) 735 749 $post['ID'] = 0; 736 750 foreach ( array_keys($post) as $field ) -
wp-admin/includes/meta-boxes.php
452 452 * @param object $post 453 453 */ 454 454 function post_revisions_meta_box($post) { 455 wp_list_post_revisions( );455 wp_list_post_revisions($post->ID); 456 456 } 457 457 458 458