WP_Comment::__construct( WP_Comment $comment )
Constructor.
Description
Populates properties with object vars.
Parameters
- $comment
-
(WP_Comment) (Required) Comment object.
Source
File: wp-includes/class-wp-comment.php
public function __construct( $comment ) {
foreach ( get_object_vars( $comment ) as $key => $value ) {
$this->$key = $value;
}
} Changelog
| Version | Description |
|---|---|
| 4.4.0 | Introduced. |
© 2003–2021 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_comment/__construct