Ticket #4844: set_post_type.2.diff
File set_post_type.2.diff, 656 bytes (added by , 18 years ago) |
---|
-
wp-includes/post.php
190 190 return false; 191 191 } 192 192 193 function set_post_type( $post_id = 0, $post_type = 'post' ) { 194 global $wpdb; 195 $post_type = sanitize_post_field('post_type', $post_type, $post_id, 'db'); 196 $return = $wpdb->query( "UPDATE $wpdb->posts SET post_type = '$post_type' WHERE ID = '$post_id'" ); 197 if ( 'page' == $post_type ) { 198 clean_page_cache($post_id); 199 } else { 200 clean_post_cache($post_id); 201 } 202 return $return; 203 } 204 193 205 function get_posts($args) { 194 206 global $wpdb; 195 207