Ticket #967: add publish_post, edit_post hooks for xmlrpc posting.diff
| File add publish_post, edit_post hooks for xmlrpc posting.diff, 1.6 kB (added by anonymousbugger, 4 years ago) |
|---|
-
xmlrpc.php
old new 535 535 $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status'); 536 536 537 537 $post_ID = wp_insert_post($postdata); 538 538 539 539 if (!$post_ID) { 540 540 return new IXR_Error(500, 'Sorry, your entry could not be posted. Something wrong happened.'); 541 541 } … … 543 543 logIO('O', "Posted ! ID: $post_ID"); 544 544 545 545 // FIXME: do we pingback always? pingback($content, $post_ID); 546 trackback_url_list($content_struct['mt_tb_ping_urls'],$post_ID);546 //trackback_url_list($content_struct['mt_tb_ping_urls'],$post_ID); 547 547 548 if ('publish' == $post_status) { 549 if ($post_pingback) pingback($content, $post_ID); 550 do_enclose( $content, $post_ID ); 551 do_trackbacks($post_ID); 552 do_action('publish_post', $post_ID); 553 } 554 548 555 return strval($post_ID); 549 556 } 550 557 … … 620 627 logIO('O',"(MW) Edited ! ID: $post_ID"); 621 628 622 629 // FIXME: do we pingback always? pingback($content, $post_ID); 623 trackback_url_list($content_struct['mt_tb_ping_urls'], $post_ID); 624 630 //trackback_url_list($content_struct['mt_tb_ping_urls'], $post_ID); 631 if ('publish' == $post_status) { 632 if ($post_pingback) pingback($content, $post_ID); 633 do_enclose( $content, $post_ID ); 634 do_trackbacks($post_ID); 635 do_action('publish_post', $post_ID); 636 } 637 do_action('edit_post', $post_ID); 638 625 639 return true; 626 640 } 627 641
