WP_Post::__construct()publicWP 3.5.0

Constructor.

Method of the class: WP_Post{}

No Hooks.

Return

null. Nothing (null).

Usage

$WP_Post = new WP_Post();
$WP_Post->__construct( $post );
$post(WP_Post|object) (required)
Post object.

Changelog

Since 3.5.0 Introduced.

WP_Post::__construct() code WP 6.6

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