WP_Post_Type::__construct()
Constructor.
See the register_post_type() function for accepted arguments for $args.
Will populate object properties from the provided arguments and assign other default properties based on that information.
Method of the class: WP_Post_Type{}
No Hooks.
Return
null
. Nothing (null).
Usage
$WP_Post_Type = new WP_Post_Type(); $WP_Post_Type->__construct( $post_type, $args );
- $post_type(string) (required)
- Post type key.
- $args(array|string)
- Array or string of arguments for registering a post type. See register_post_type() for information on accepted arguments.
Default: empty array
Notes
- See: register_post_type()
Changelog
Since 4.6.0 | Introduced. |
WP_Post_Type::__construct() WP Post Type:: construct code WP 6.6.2
public function __construct( $post_type, $args = array() ) { $this->name = $post_type; $this->set_props( $args ); }