Ticket #10789: xmlrpc.diff
File xmlrpc.diff, 1.8 KB (added by , 15 years ago) |
---|
-
xmlrpc.php
154 154 'wp.editComment' => 'this:wp_editComment', 155 155 'wp.newComment' => 'this:wp_newComment', 156 156 'wp.getCommentStatusList' => 'this:wp_getCommentStatusList', 157 'wp.getPluginList' => 'this:wp_getPluginList', 157 158 158 159 // Blogger API 159 160 'blogger.getUsersBlogs' => 'this:blogger_getUsersBlogs', … … 1579 1580 //Now return the updated values 1580 1581 return $this->_getOptions($option_names); 1581 1582 } 1583 1584 /** 1585 * Retrieve plugin list and information. 1586 * 1587 * @param array $args Method parameters. 1588 * 1589 * @since 2.9 1590 * 1591 * @return array 1592 */ 1593 function wp_getPluginList( $args ) { 1594 1595 $this->escape($args); 1582 1596 1597 $blog_id = (int) $args[0]; 1598 $username = $args[1]; 1599 $password = $args[2]; 1600 1601 if ( !$user = $this->login($username, $password) ) { 1602 return $this->error; 1603 } 1604 1605 if( !current_user_can( 'activate_plugins' ) ) 1606 return new IXR_Error( 401, __( 'Sorry, you cannot manage plugins.' ) ); 1607 1608 do_action('xmlrpc_call', 'wp.getPluginList'); 1609 1610 $plugins = get_plugins(); 1611 $current = get_transient( 'update_plugins' ); 1612 1613 foreach( (array) $plugins as $plugin_file => $plugin ) { 1614 $new_version = $current->response[$plugin_file]->new_version 1615 1616 if( is_plugin_active( $plugin_file ) ) 1617 $plugins[$plugin_file]['active'] = true; 1618 else 1619 $plugins[$plugin_file]['active'] = false; 1620 if( $new_version ) 1621 $plugins[$plugin_file]['latest_version'] = $new_version; 1622 else 1623 $plugins[$plugin_file]['latest_version'] = $plugin['Version']; 1624 } 1625 1626 return $plugins; 1627 1628 } 1629 1583 1630 /* Blogger API functions. 1584 1631 * specs on http://plant.blogger.com/api and http://groups.yahoo.com/group/bloggerDev/ 1585 1632 */