WP_Comment::__construct( WP_Comment $comment )

Constructor.

Description

Populates properties with object vars.

Parameters

$commentWP_Commentrequired
Comment object.

Source

public function __construct( $comment ) {
	foreach ( get_object_vars( $comment ) as $key => $value ) {
		$this->$key = $value;
	}
}

Changelog

VersionDescription
4.4.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.