Changes from branches/2.7/wp-includes/post.php at r10253 to trunk/wp-includes/post.php at r10150
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r10253 r10150 216 216 else 217 217 return $null; 218 } elseif ( is_object($post) && empty($post->filter)) {218 } elseif ( is_object($post) ) { 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;225 223 $post = (int) $post; 226 224 if ( ! $_post = wp_cache_get($post, 'posts') ) { … … 742 740 $custom = get_post_custom($post_id); 743 741 744 return isset($custom[$key]) ? $custom[$key] : null;742 return $custom[$key]; 745 743 } 746 744 … … 795 793 foreach ( array_keys(get_object_vars($post)) as $field ) 796 794 $post->$field = sanitize_post_field($field, $post->$field, $post->ID, $context); 797 $post->filter = $context;798 795 } else { 799 796 if ( !isset($post['ID']) ) … … 801 798 foreach ( array_keys($post) as $field ) 802 799 $post[$field] = sanitize_post_field($field, $post[$field], $post['ID'], $context); 803 $post['filter'] = $context; 804 } 805 800 } 806 801 return $post; 807 802 } … … 2541 2536 if ( 0 === strpos($file, $uploads['basedir']) ) //Check that the upload base exists in the file location 2542 2537 $url = str_replace($uploads['basedir'], $uploads['baseurl'], $file); //replace file location with url location 2543 elseif ( false !== strpos($file, 'wp-content/uploads') )2544 $url = $uploads['baseurl'] . substr( $file, strpos($file, 'wp-content/uploads') + 18 );2545 else2546 $url = $uploads['baseurl'] . "/$file"; //Its a newly uploaded file, therefor $file is relative to the basedir.2547 2538 } 2548 2539 }
Note: See TracChangeset
for help on using the changeset viewer.