Function Reference/set post type
Description
Updates the post type for the post ID.
The page or post cache will be cleaned for the post ID.
@uses $wpdb
name a few.
Usage
<?php set_post_type( $post_id, $post_type ); ?>
Parameters
- $post_id
- (integer) (required) Post ID to change post type. Not actually optional.
- Default: 0
- $post_type
- (string) (optional) Optional, default is post. Supported values are 'post' or 'page' to
- Default: post
Return Values
- (integer)
- Amount of rows changed. Should be 1 for success and 0 for failure.
Change Log
Since: 2.5
Source File
set_post_type() is located in wp-includes/post.php