Ticket #17109: 17109-2.diff
File 17109-2.diff, 2.0 KB (added by , 13 years ago) |
---|
-
wp-includes/class-wp-xmlrpc-server.php
903 903 return(new IXR_Error(500, __('Sorry, the new category failed.'))); 904 904 } 905 905 906 return ($cat_id);906 return apply_filters( 'xmlrpc_call_success_wp_newCategory' , $cat_id, $args ); 907 907 } 908 908 909 909 /** … … 930 930 if ( !current_user_can('manage_categories') ) 931 931 return new IXR_Error( 401, __( 'Sorry, you do not have the right to delete a category.' ) ); 932 932 933 return wp_delete_term( $category_id, 'category' ); 933 $status = wp_delete_term( $category_id, 'category' ); 934 935 if( true == $status ) 936 do_action( 'xmlrpc_call_success_wp_deleteCategory', $category_id, $args ); 937 938 return $status; 934 939 } 935 940 936 941 /** … … 1142 1147 1143 1148 do_action('xmlrpc_call', 'wp.deleteComment'); 1144 1149 1145 return wp_delete_comment($comment_ID); 1150 $status = wp_delete_comment( $comment_ID ); 1151 1152 if( true == $status ) 1153 do_action( 'xmlrpc_call_success_wp_deleteComment', $comment_ID, $args ); 1154 1155 return $status; 1146 1156 } 1147 1157 1148 1158 /** … … 1230 1240 if ( !$result ) 1231 1241 return new IXR_Error(500, __('Sorry, the comment could not be edited. Something wrong happened.')); 1232 1242 1243 do_action( 'xmlrpc_call_success_wp_editComment', $comment_ID, $args ); 1244 1233 1245 return true; 1234 1246 } 1235 1247 … … 1313 1325 1314 1326 do_action('xmlrpc_call', 'wp.newComment'); 1315 1327 1316 return wp_new_comment($comment); 1328 $comment_ID = wp_new_comment( $comment ); 1329 1330 return apply_filters( 'xmlrpc_call_success_wp_newComment', $comment_ID, $args ); 1317 1331 } 1318 1332 1319 1333 /** … … 3100 3114 $id = wp_insert_attachment( $attachment, $upload[ 'file' ], $post_id ); 3101 3115 wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $upload['file'] ) ); 3102 3116 3117 do_action( 'xmlrpc_call_success_mw_newMediaObject', $id, $args ); 3118 3103 3119 return apply_filters( 'wp_handle_upload', array( 'file' => $name, 'url' => $upload[ 'url' ], 'type' => $type ), 'upload' ); 3104 3120 } 3105 3121