set_post_type


set_post_type ( $post_id = 0, $post_type = 'post' )

Parameters:
  • (int) $post_id 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'.
Returns:
  • (int|false) Amount of rows changed. Should be 1 for success and 0 for failure.
Defined at:

Description

Update the post type for the post ID.

The page or post cache will be cleaned for the post ID.

Related Functions

get_post_type, get_post_types, register_post_type, get_post_time, get_post_mime_type

Top Google Results

User discussions

wpseek mobile