Changeset 10213
- Timestamp:
- 12/16/2008 11:50:39 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/post.php
r10202 r10213 910 910 } 911 911 912 $post->filter = 'sample'; 913 912 914 $permalink = get_permalink($post, true); 913 915 … … 927 929 $post->post_date = $original_date; 928 930 $post->post_name = $original_name; 931 unset($post->filter); 932 929 933 return $permalink; 930 934 } -
trunk/wp-includes/link-template.php
r10150 r10213 93 93 ); 94 94 95 $post = &get_post($id); 95 if ( is_object($id) && isset($id->filter) && 'sample' == $id->filter ) 96 $post = $id; 97 else 98 $post = &get_post($id); 96 99 97 100 if ( empty($post->ID) ) return false; -
trunk/wp-includes/post.php
r10150 r10213 216 216 else 217 217 return $null; 218 } elseif ( is_object($post) ) {218 } elseif ( is_object($post) && empty($post->filter) ) { 219 219 _get_post_ancestors($post); 220 220 wp_cache_add($post->ID, $post, 'posts'); 221 221 $_post = &$post; 222 222 } else { 223 if ( is_object($post) ) 224 $post = $post->ID; 223 225 $post = (int) $post; 224 226 if ( ! $_post = wp_cache_get($post, 'posts') ) { … … 793 795 foreach ( array_keys(get_object_vars($post)) as $field ) 794 796 $post->$field = sanitize_post_field($field, $post->$field, $post->ID, $context); 797 $post->filter = $context; 795 798 } else { 796 799 if ( !isset($post['ID']) ) … … 798 801 foreach ( array_keys($post) as $field ) 799 802 $post[$field] = sanitize_post_field($field, $post[$field], $post['ID'], $context); 800 } 803 $post['filter'] = $context; 804 } 805 801 806 return $post; 802 807 }
Note: See TracChangeset
for help on using the changeset viewer.