I use Post Type Switcher to switch some of my blog post type.
From the source code, I can see that it eventually calls set_post_type to change the post type. The code:
`function set_post_type( $post_id = 0, $post_type = ‘post’ ) {
global $wpdb;
$post_type = sanitize_post_field( ‘post_type’, $post_type, $post_id, ‘db’ );
$return = $wpdb->update( $wpdb->posts, array( ‘post_type’ => $post_type ), array( ‘ID’ => $post_id ) );
clean_post_cache( $post_id );
return $return;
}
So it does call WordPress function in the end.
-
This reply was modified 2 years, 2 months ago by nsoonhui.