equal
deleted
inserted
replaced
31 * A numeric string, for compatibility reasons. |
31 * A numeric string, for compatibility reasons. |
32 * |
32 * |
33 * @since 4.4.0 |
33 * @since 4.4.0 |
34 * @var string |
34 * @var string |
35 */ |
35 */ |
36 public $comment_post_ID = 0; |
36 public $comment_post_ID = '0'; |
37 |
37 |
38 /** |
38 /** |
39 * Comment author name. |
39 * Comment author name. |
40 * |
40 * |
41 * @since 4.4.0 |
41 * @since 4.4.0 |
97 * A numeric string, for compatibility reasons. |
97 * A numeric string, for compatibility reasons. |
98 * |
98 * |
99 * @since 4.4.0 |
99 * @since 4.4.0 |
100 * @var string |
100 * @var string |
101 */ |
101 */ |
102 public $comment_karma = 0; |
102 public $comment_karma = '0'; |
103 |
103 |
104 /** |
104 /** |
105 * Comment approval status. |
105 * Comment approval status. |
106 * |
106 * |
107 * @since 4.4.0 |
107 * @since 4.4.0 |
132 * A numeric string, for compatibility reasons. |
132 * A numeric string, for compatibility reasons. |
133 * |
133 * |
134 * @since 4.4.0 |
134 * @since 4.4.0 |
135 * @var string |
135 * @var string |
136 */ |
136 */ |
137 public $comment_parent = 0; |
137 public $comment_parent = '0'; |
138 |
138 |
139 /** |
139 /** |
140 * Comment author ID. |
140 * Comment author ID. |
141 * |
141 * |
142 * A numeric string, for compatibility reasons. |
142 * A numeric string, for compatibility reasons. |
143 * |
143 * |
144 * @since 4.4.0 |
144 * @since 4.4.0 |
145 * @var string |
145 * @var string |
146 */ |
146 */ |
147 public $user_id = 0; |
147 public $user_id = '0'; |
148 |
148 |
149 /** |
149 /** |
150 * Comment children. |
150 * Comment children. |
151 * |
151 * |
152 * @since 4.4.0 |
152 * @since 4.4.0 |
349 * |
349 * |
350 * If `$name` matches a post field, the comment post will be loaded and the post's value checked. |
350 * If `$name` matches a post field, the comment post will be loaded and the post's value checked. |
351 * |
351 * |
352 * @since 4.4.0 |
352 * @since 4.4.0 |
353 * |
353 * |
354 * @param string $name Property name. |
354 * @param string $name Property to check if set. |
355 * @return bool |
355 * @return bool Whether the property is set. |
356 */ |
356 */ |
357 public function __isset( $name ) { |
357 public function __isset( $name ) { |
358 if ( in_array( $name, $this->post_fields, true ) && 0 !== (int) $this->comment_post_ID ) { |
358 if ( in_array( $name, $this->post_fields, true ) && 0 !== (int) $this->comment_post_ID ) { |
359 $post = get_post( $this->comment_post_ID ); |
359 $post = get_post( $this->comment_post_ID ); |
360 return property_exists( $post, $name ); |
360 return property_exists( $post, $name ); |
361 } |
361 } |
|
362 |
|
363 return false; |
362 } |
364 } |
363 |
365 |
364 /** |
366 /** |
365 * Magic getter. |
367 * Magic getter. |
366 * |
368 * |