Ticket #4599: xml-rpc.php.diff
| File xml-rpc.php.diff, 1.5 kB (added by josephscott, 10 months ago) |
|---|
-
xmlrpc.php
old new 85 85 'wp.getAuthors' => 'this:wp_getAuthors', 86 86 'wp.getCategories' => 'this:mw_getCategories', // Alias 87 87 'wp.newCategory' => 'this:wp_newCategory', 88 'wp.deleteCategory' => 'this:wp_deleteCategory', 88 89 'wp.suggestCategories' => 'this:wp_suggestCategories', 89 90 'wp.uploadFile' => 'this:mw_newMediaObject', // Alias 90 91 … … 494 495 // Set the user context and make sure they are 495 496 // allowed to add a category. 496 497 set_current_user(0, $username); 497 if(!current_user_can("manage_categories" , $page_id)) {498 if(!current_user_can("manage_categories")) { 498 499 return(new IXR_Error(401, __("Sorry, you do not have the right to add a category."))); 499 500 } 500 501 … … 531 532 532 533 /** 533 534 * WordPress XML-RPC API 535 * wp_deleteCategory 536 */ 537 function wp_deleteCategory($args) { 538 $this->escape($args); 539 540 $blog_id = (int) $args[0]; 541 $username = $args[1]; 542 $password = $args[2]; 543 $category_id = (int) $args[3]; 544 545 if( !$this->login_pass_ok( $username, $password ) ) { 546 return $this->error; 547 } 548 549 set_current_user(0, $username); 550 if( !current_user_can("manage_categories") ) { 551 return new IXR_Error( 401, __( "Sorry, you do not the right to delete a category." ) ); 552 } 553 554 return wp_delete_category( $category_id ); 555 } 556 557 558 /** 559 * WordPress XML-RPC API 534 560 * wp_suggestCategories 535 561 */ 536 562 function wp_suggestCategories($args) {
