Changeset 34583
- Timestamp:
- 09/26/2015 06:40:39 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-comment.php
r34569 r34583 321 321 return false; 322 322 } 323 324 /** 325 * Whether a comment has post from which to retrieve magic properties 326 * 327 * @since 4.4.0 328 * @access public 329 * 330 * @param string $name 331 * @return bool 332 */ 333 public function __isset( $name ) { 334 if ( 335 0 === (int) $this->comment_post_ID 336 || property_exists( $this, $name ) 337 ) { 338 return; 339 } 340 341 $post = get_post( $this->comment_post_ID ); 342 if ( $post ) { 343 return property_exists( $post, $name ); 344 } 345 } 346 347 /** 348 * Magic getter for $post properties 349 * 350 * @since 4.4.0 351 * @access public 352 * 353 * @param string $name 354 * @return mixed 355 */ 356 public function __get( $name ) { 357 $post = get_post( $this->comment_post_ID ); 358 if ( $post ) { 359 return $post->$name; 360 } 361 } 323 362 }
Note: See TracChangeset
for help on using the changeset viewer.