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  
    535535          $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status'); 
    536536 
    537537          $post_ID = wp_insert_post($postdata); 
    538  
     538         
    539539          if (!$post_ID) { 
    540540            return new IXR_Error(500, 'Sorry, your entry could not be posted. Something wrong happened.'); 
    541541          } 
     
    543543          logIO('O', "Posted ! ID: $post_ID"); 
    544544 
    545545          // 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); 
    547547 
     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           
    548555          return strval($post_ID); 
    549556        } 
    550557 
     
    620627          logIO('O',"(MW) Edited ! ID: $post_ID"); 
    621628 
    622629          // 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                 
    625639          return true; 
    626640        } 
    627641