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.
$post_typestringrequired
$argsarray|stringoptional
Default:array()
public function __construct( $post_type, $args = array() ) {
$this->name = $post_type;
$this->set_props( $args );
}
| Version | Description |
|---|---|
| 4.6.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_post_type/__construct