On this page
WP_Comment::__construct( WP_Comment $comment )
Constructor.
Description
Populates properties with object vars.
Parameters
$commentWP_Comment Required-
Comment object.
Source
File: wp-includes/class-wp-comment.php. View all references
public function __construct( $comment ) {
foreach ( get_object_vars( $comment ) as $key => $value ) {
$this->$key = $value;
}
}
Related
Used By
| Used By | Description |
|---|---|
| WP_Comment::get_instance() wp-includes/class-wp-comment.php | Retrieves a WP_Comment instance. |
| get_comment() wp-includes/comment.php | Retrieves comment data given a comment ID or comment 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/__construct