wordpress / latest / classes / wp_post / __construct.html

WP_Post::__construct( WP_Post|object $post )

Constructor.

Parameters

$post WP_Post|object Required
Post object.

Source

File: wp-includes/class-wp-post.php. View all references

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

Used By

Used By Description

Changelog

Version Description
3.5.0 Introduced.

© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_post/__construct