Ticket #12267: wp-post-patch.diff
File wp-post-patch.diff, 2.6 KB (added by , 12 years ago) |
---|
-
wp-includes/class-wp-post.php
1 <?php 2 3 class WP_Post { 4 public $ID; 5 public $post_author; 6 public $post_date; 7 public $post_date_gmt; 8 public $post_content; 9 public $post_title; 10 public $post_excerpt; 11 public $post_status; 12 public $comment_status; 13 public $ping_status; 14 public $post_password; 15 public $post_name; 16 public $to_ping; 17 public $pinged; 18 public $post_modified; 19 public $post_modified_gmt; 20 public $post_content_filtered; 21 public $post_parent; 22 public $guid; 23 public $menu_order; 24 public $post_type; 25 public $post_mime_type; 26 public $comment_count; 27 public $filter; 28 29 public function __set( $name, $value ) { 30 if ( property_exists('WP_Post', $name) ) { 31 $this->$name = $value; 32 return $this->$name; 33 } 34 35 return false; 36 } 37 38 public static function get_instance( $post_data ) { 39 $post = new WP_Post(); 40 41 foreach ( $post_data as $k=>$v ) { 42 if ( property_exists('WP_Post', $k) ) { 43 $post->$k = $v; 44 } 45 } 46 47 return $post; 48 } 49 50 // wrapper for get_the_title() 51 // the idea is to add wrappers for the other functions related 52 // to displaying post info as well 53 public function get_the_title() { 54 return get_the_title($this); 55 } 56 } -
wp-includes/query.php
2660 2660 if ( !$q['suppress_filters'] ) 2661 2661 $this->posts = apply_filters_ref_array('posts_results', array( $this->posts, &$this ) ); 2662 2662 2663 // Convert posts to WP_Post objects 2664 if ( is_array($this->posts) ) { 2665 $this->posts = array_map(array( 'WP_Post', 'get_instance' ), $this->posts ); 2666 } 2667 2663 2668 if ( !empty($this->posts) && $this->is_comment_feed && $this->is_singular ) { 2664 2669 $cjoin = apply_filters_ref_array('comment_feed_join', array( '', &$this ) ); 2665 2670 $cwhere = apply_filters_ref_array('comment_feed_where', array( "WHERE comment_post_ID = '{$this->posts[0]->ID}' AND comment_approved = '1'", &$this ) ); -
wp-settings.php
142 142 require( ABSPATH . WPINC . '/nav-menu.php' ); 143 143 require( ABSPATH . WPINC . '/nav-menu-template.php' ); 144 144 require( ABSPATH . WPINC . '/admin-bar.php' ); 145 require( ABSPATH . WPINC . '/class-wp-post.php' ); 145 146 146 147 // Load multisite-specific files. 147 148 if ( is_multisite() ) {