Make WordPress Core


Ignore:
Timestamp:
01/26/2010 08:15:43 PM (15 years ago)
Author:
ryan
Message:

Integrate wpmu_blogger_getUsersBlogs() directly into xmlrpc.php. see #11644

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/ms-functions.php

    r12851 r12852  
    17901790}
    17911791
    1792 /*
    1793 XMLRPC getUsersBlogs() for a multiblog environment
    1794 http://trac.mu.wordpress.org/attachment/ticket/551/xmlrpc-mu.php
    1795 */
    1796 function wpmu_blogger_getUsersBlogs( $args ) {
    1797     global $current_blog;
    1798     $domain = $current_blog->domain;
    1799     $path = $current_blog->path . 'xmlrpc.php';
    1800 
    1801     $rpc = new IXR_Client("http://{$domain}{$path}");
    1802     $rpc->query('wp.getUsersBlogs', $args[1], $args[2]);
    1803     $blogs = $rpc->getResponse();
    1804 
    1805     if ( isset($blogs['faultCode']) )
    1806         return new IXR_Error($blogs['faultCode'], $blogs['faultString']);
    1807 
    1808     if ( $_SERVER['HTTP_HOST'] == $domain && $_SERVER['REQUEST_URI'] == $path ) {
    1809         return $blogs;
    1810     } else {
    1811         foreach ( (array) $blogs as $blog ) {
    1812             if ( strpos($blog['url'], $_SERVER['HTTP_HOST']) )
    1813                 return array($blog);
    1814         }
    1815         return array();
    1816     }
    1817 }
    1818 
    1819 function attach_wpmu_xmlrpc( $methods ) {
    1820     $methods['blogger.getUsersBlogs'] = 'wpmu_blogger_getUsersBlogs';
    1821     return $methods;
    1822 }
    1823 
    18241792function mu_locale( $locale ) {
    18251793    if ( defined('WP_INSTALLING') == false ) {
Note: See TracChangeset for help on using the changeset viewer.