WP_Post::__construct
Constructor.
Method of the class: WP_Post{}
No Hooks.
Returns
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() WP Post:: construct code WP 6.9.1
public function __construct( $post ) {
foreach ( get_object_vars( $post ) as $key => $value ) {
$this->$key = $value;
}
}