The What
Description
This construct (function) updates the post type for the specific post ID. It uses $wpdb
to update post type column for the given post ID. In other words, it sets the new post type name into the post_type column in the
wp_posts
database table. Then it clears the post cache for the post ID, as the information is new and needs to refreshed.
Parameters
post_id
post_type_key
- The key or slug for the new post type name. The default value is
post
.
Return Values
Returns the number of rows affected, which should be a value of 1, if the update was successful. Else false
is returned.
You get WET when you swim. Stay DRY when you code.
More coming soon...keep checking back.