Changeset 21655
- Timestamp:
- 08/29/2012 01:42:11 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r21654 r21655 490 490 public function __get( $key ) { 491 491 if ( 'page_template' == $key && $this->__isset( $key ) ) { 492 $_ref =get_post_meta( $this->ID, '_wp_page_template', true );492 return get_post_meta( $this->ID, '_wp_page_template', true ); 493 493 } 494 494 495 495 if ( 'post_category' == $key ) { 496 if ( is_object_in_taxonomy( $this->post_type, 'category' ) ) { 497 $_ref = wp_get_post_categories( $this->ID ); 498 } else { 499 $_ref = array(); 500 } 496 if ( is_object_in_taxonomy( $this->post_type, 'category' ) ) 497 return wp_get_post_categories( $this->ID ); 498 else 499 return array(); 501 500 } 502 501 503 502 if ( 'tags_input' == $key ) { 504 if ( is_object_in_taxonomy( $this->post_type, 'post_tag' ) ) { 505 $_ref = wp_get_post_tags( $this->ID, array( 'fields' => 'names' ) ); 506 } else { 507 $_ref = array(); 508 } 509 } 510 511 if ( isset( $_ref ) ) 512 return $_ref; 503 if ( is_object_in_taxonomy( $this->post_type, 'post_tag' ) ) 504 return wp_get_post_tags( $this->ID, array( 'fields' => 'names' ) ); 505 else 506 return array(); 507 } 513 508 514 509 // Rest of the values need filtering 515 510 516 if ( 'ancestors' == $key ) {511 if ( 'ancestors' == $key ) 517 512 $value = get_post_ancestors( $this ); 518 } else {513 else 519 514 $value = get_post_meta( $this->ID, $key, true ); 520 } 521 522 if ( $this->filter ) { 515 516 if ( $this->filter ) 523 517 $value = sanitize_post_field( $key, $value, $this->ID, $this->filter ); 524 }525 518 526 519 return $value;
Note: See TracChangeset
for help on using the changeset viewer.