Changeset 5278 for trunk/xmlrpc.php
- Timestamp:
- 04/17/2007 01:30:12 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xmlrpc.php
r5215 r5278 990 990 $post_more = $content_struct['mt_text_more']; 991 991 992 $tags_input = $content_struct['mt_keywords']; 993 992 994 $comment_status = (!isset($content_struct['mt_allow_comments'])) ? 993 995 get_option('default_comment_status') … … 1028 1030 1029 1031 // We've got all the data -- post it: 1030 $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'to_ping', 'post_type', 'post_name', 'post_password', 'post_parent', 'menu_order' );1032 $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'to_ping', 'post_type', 'post_name', 'post_password', 'post_parent', 'menu_order', 'tags_input'); 1031 1033 1032 1034 $post_ID = wp_insert_post($postdata); … … 1172 1174 $post_status = $publish ? 'publish' : 'draft'; 1173 1175 1176 $tags_input = $content_struct['mt_keywords']; 1177 1174 1178 if ( ('publish' == $post_status) ) { 1175 1179 if ( ( 'page' == $post_type ) && !current_user_can('publish_pages') ) … … 1203 1207 1204 1208 // We've got all the data -- post it: 1205 $newpost = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'post_date', 'post_date_gmt', 'to_ping', 'post_name', 'post_password', 'post_parent', 'menu_order', 'post_author' );1209 $newpost = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'post_date', 'post_date_gmt', 'to_ping', 'post_name', 'post_password', 'post_parent', 'menu_order', 'post_author', 'tags_input'); 1206 1210 1207 1211 $result = wp_update_post($newpost); … … 1243 1247 $categories[] = get_cat_name($catid); 1244 1248 } 1249 1250 $tagnames = array(); 1251 $tags = get_post_tags( $post_ID ); 1252 if ( !empty( $tags ) ) { 1253 foreach ( $tags as $tag ) { 1254 $tagnames[] = $tag->cat_name; 1255 } 1256 $tagnames = implode( ', ', $tagnames ); 1257 } else { 1258 $tagnames = ''; 1259 } 1245 1260 1246 1261 $post = get_extended($postdata['post_content']); … … 1268 1283 'mt_allow_comments' => $allow_comments, 1269 1284 'mt_allow_pings' => $allow_pings, 1285 'mt_keywords' => $tagnames, 1270 1286 'wp_slug' => $postdata['post_name'], 1271 1287 'wp_password' => $postdata['post_password'], … … 1309 1325 foreach($catids as $catid) { 1310 1326 $categories[] = get_cat_name($catid); 1327 } 1328 1329 $tagnames = array(); 1330 $tags = get_post_tags( $entry['ID'] ); 1331 if ( !empty( $tags ) ) { 1332 foreach ( $tags as $tag ) { 1333 $tagnames[] = $tag->cat_name; 1334 } 1335 $tagnames = implode( ', ', $tagnames ); 1336 } else { 1337 $tagnames = ''; 1311 1338 } 1312 1339 … … 1335 1362 'mt_allow_comments' => $allow_comments, 1336 1363 'mt_allow_pings' => $allow_pings, 1364 'mt_keywords' => $tagnames, 1337 1365 'wp_slug' => $entry['post_name'], 1338 1366 'wp_password' => $entry['post_password'],
Note: See TracChangeset
for help on using the changeset viewer.