Ticket #900: tags-xmlrpc.php.diff
| File tags-xmlrpc.php.diff, 3.6 kB (added by josephscott, 1 year ago) |
|---|
-
xmlrpc.php
old new 989 989 $post_excerpt = $content_struct['mt_excerpt']; 990 990 $post_more = $content_struct['mt_text_more']; 991 991 992 $tags_input = $content_struct['mt_keywords']; 993 992 994 if(isset($content_struct["mt_allow_comments"])) { 993 995 if(!is_numeric($content_struct["mt_allow_comments"])) { 994 996 switch($content_struct["mt_allow_comments"]) { … … 1083 1085 } 1084 1086 1085 1087 // We've got all the data -- post it: 1086 $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' );1088 $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'); 1087 1089 1088 1090 $post_ID = wp_insert_post($postdata); 1089 1091 … … 1276 1278 $post_more = $content_struct['mt_text_more']; 1277 1279 $post_status = $publish ? 'publish' : 'draft'; 1278 1280 1281 $tags_input = $content_struct['mt_keywords']; 1282 1279 1283 if ( ('publish' == $post_status) ) { 1280 1284 if ( ( 'page' == $post_type ) && !current_user_can('publish_pages') ) 1281 1285 return new IXR_Error(401, __('Sorry, you do not have the right to publish this page.')); … … 1303 1307 } 1304 1308 1305 1309 // We've got all the data -- post it: 1306 $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' );1310 $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'); 1307 1311 1308 1312 $result = wp_update_post($newpost); 1309 1313 if (!$result) { … … 1345 1349 $categories[] = get_cat_name($catid); 1346 1350 } 1347 1351 1352 $tagnames = array(); 1353 $tags = wp_get_post_tags( $post_ID ); 1354 if ( !empty( $tags ) ) { 1355 foreach ( $tags as $tag ) { 1356 $tagnames[] = $tag->name; 1357 } 1358 $tagnames = implode( ', ', $tagnames ); 1359 } else { 1360 $tagnames = ''; 1361 } 1362 1348 1363 $post = get_extended($postdata['post_content']); 1349 1364 $link = post_permalink($postdata['ID']); 1350 1365 … … 1369 1384 'mt_text_more' => $post['extended'], 1370 1385 'mt_allow_comments' => $allow_comments, 1371 1386 'mt_allow_pings' => $allow_pings, 1387 'mt_keywords' => $tagnames, 1372 1388 'wp_slug' => $postdata['post_name'], 1373 1389 'wp_password' => $postdata['post_password'], 1374 1390 'wp_author_id' => $author->ID, … … 1415 1431 $categories[] = get_cat_name($catid); 1416 1432 } 1417 1433 1434 $tagnames = array(); 1435 $tags = wp_get_post_tags( $entry['ID'] ); 1436 if ( !empty( $tags ) ) { 1437 foreach ( $tags as $tag ) { 1438 $tagnames[] = $tag->cat_name; 1439 } 1440 $tagnames = implode( ', ', $tagnames ); 1441 } else { 1442 $tagnames = ''; 1443 } 1444 1418 1445 $post = get_extended($entry['post_content']); 1419 1446 $link = post_permalink($entry['ID']); 1420 1447 … … 1439 1466 'mt_text_more' => $post['extended'], 1440 1467 'mt_allow_comments' => $allow_comments, 1441 1468 'mt_allow_pings' => $allow_pings, 1469 'mt_keywords' => $tagnames, 1442 1470 'wp_slug' => $entry['post_name'], 1443 1471 'wp_password' => $entry['post_password'], 1444 1472 'wp_author_id' => $author->ID,
