Changeset 14561 for trunk/wp-includes/post.php
- Timestamp:
- 05/11/2010 04:28:00 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r14528 r14561 1993 1993 1994 1994 // Set categories and tags 1995 if($mode == OBJECT) { 1996 $post->post_category = wp_get_post_categories($postid); 1997 $post->tags_input = wp_get_post_tags($postid, array('fields' => 'names')); 1998 } 1999 else { 2000 $post['post_category'] = wp_get_post_categories($postid); 2001 $post['tags_input'] = wp_get_post_tags($postid, array('fields' => 'names')); 1995 if ( $mode == OBJECT ) { 1996 $post->post_category = array(); 1997 if ( is_object_in_taxonomy($post->post_type, 'category') ) 1998 $post->post_category = wp_get_post_categories($postid); 1999 $post->tags_input = array(); 2000 if ( is_object_in_taxonomy($post->post_type, 'post_tag') ) 2001 $post->tags_input = wp_get_post_tags($postid, array('fields' => 'names')); 2002 } else { 2003 $post['post_category'] = array(); 2004 if ( is_object_in_taxonomy($post['post_type'], 'category') ) 2005 $post['post_category'] = wp_get_post_categories($postid); 2006 $post['tags_input'] = array(); 2007 if ( is_object_in_taxonomy($post['post_type'], 'post_tag') ) 2008 $post['tags_input'] = wp_get_post_tags($postid, array('fields' => 'names')); 2002 2009 } 2003 2010 … … 2241 2248 } 2242 2249 2243 wp_set_post_categories( $post_ID, $post_category ); 2244 // old-style tags_input 2245 if ( isset( $tags_input ) ) 2250 if ( is_object_in_taxonomy($post_type, 'category') ) 2251 wp_set_post_categories( $post_ID, $post_category ); 2252 2253 if ( isset( $tags_input ) && is_object_in_taxonomy($post_type, 'post_tag') ) 2246 2254 wp_set_post_tags( $post_ID, $tags_input ); 2247 2255
Note: See TracChangeset
for help on using the changeset viewer.