Core Function
View Source on Trac ↗ set_post_type()
set_post_type( mixed $post_id = 0, mixed $post_type = 'post' ) Updates the post type for the post ID.
Parameters 1 required
| Name / Type | Description |
|---|---|
| $post_id int | Optional. Post ID to change post type. Default 0. |
| string | $post_type Optional. Post type. Accepts 'post' or 'page' to name a few. Default 'post'. Required |
Return Value
((int)
| false) Amount of rows changed. Should be 1 for success and 0 for failure.
Function Information
Since Version
2.5.0
Source File
wp-includes/post.php
Advertisement