Ticket #16608: 01-xmlrpc-add-wp.getCommentsStatusCount.patch
| File 01-xmlrpc-add-wp.getCommentsStatusCount.patch, 1.4 KB (added by , 15 years ago) |
|---|
-
xmlrpc.php
old new 154 154 'wp.editComment' => 'this:wp_editComment', 155 155 'wp.newComment' => 'this:wp_newComment', 156 156 'wp.getCommentStatusList' => 'this:wp_getCommentStatusList', 157 'wp.getCommentsStatusCount' => 'this:wp_getCommentsStatusCount', 157 158 158 159 // Blogger API 159 160 'blogger.getUsersBlogs' => 'this:blogger_getUsersBlogs', … … 1345 1346 1346 1347 return get_comment_statuses( ); 1347 1348 } 1349 /** 1350 * Retrieve number of comments in a given status. 1351 * 1352 * @since 2.7.0 1353 * 1354 * @param array $args Method parameters. 1355 * @return array 1356 */ 1357 function wp_getCommentsStatusCount($args) { 1358 $this->escape( $args ); 1359 1360 $blog_id = (int) $args[0]; 1361 $username = $args[1]; 1362 $password = $args[2]; 1363 $status = $args[3]; 1364 1365 if ( !$user = $this->login($username, $password) ) 1366 return $this->error; 1367 1368 if ( !current_user_can( 'moderate_comments' ) ) 1369 return new IXR_Error( 403, __( 'You are not allowed access to details about this site.' ) ); 1370 1371 do_action('xmlrpc_call', 'wp.getCommentsStatusCount'); 1372 $comments=get_comments( 'status=spam'); 1373 return count($comments); 1374 } 1348 1375 1349 1376 /** 1350 1377 * Retrieve comment count. … … 3372 3399 3373 3400 $wp_xmlrpc_server = new wp_xmlrpc_server(); 3374 3401 $wp_xmlrpc_server->serve_request(); 3375 ?> 3376 Pas de fin de ligne à la fin du fichier. 3402 ?>