On this page
WP_Comment::__isset( string $name ): bool
Check whether a non-public property is set.
Description
If $name matches a post field, the comment post will be loaded and the post’s value checked.
Parameters
$namestring Required-
Property name.
Return
bool
Source
File: wp-includes/class-wp-comment.php. View all references
public function __isset( $name ) {
if ( in_array( $name, $this->post_fields, true ) && 0 !== (int) $this->comment_post_ID ) {
$post = get_post( $this->comment_post_ID );
return property_exists( $post, $name );
}
}
Related
Uses
| Uses | Description |
|---|---|
| get_post() wp-includes/post.php | Retrieves post data given a post ID or post object. |
Changelog
| Version | Description |
|---|---|
| 4.4.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_comment/__isset