Uses
Uses | Description |
---|---|
wp-includes/ms-site.php: get_site() | Retrieves site data given a site ID or site object. |
wp-includes/link-template.php: set_url_scheme() | Sets the scheme for a URL. |
Private function for retrieving a users blogs for multisite setups
(array) (Required) Method arguments. Note: arguments must be ordered as documented.
(string) Username.
(string) Password.
(array|IXR_Error)
File: wp-includes/class-wp-xmlrpc-server.php
protected function _multisite_getUsersBlogs( $args ) { $current_blog = get_site(); $domain = $current_blog->domain; $path = $current_blog->path . 'xmlrpc.php'; $rpc = new IXR_Client( set_url_scheme( "http://{$domain}{$path}" ) ); $rpc->query( 'wp.getUsersBlogs', $args[1], $args[2] ); $blogs = $rpc->getResponse(); if ( isset( $blogs['faultCode'] ) ) { return new IXR_Error( $blogs['faultCode'], $blogs['faultString'] ); } if ( $_SERVER['HTTP_HOST'] == $domain && $_SERVER['REQUEST_URI'] == $path ) { return $blogs; } else { foreach ( (array) $blogs as $blog ) { if ( strpos( $blog['url'], $_SERVER['HTTP_HOST'] ) ) { return array( $blog ); } } return array(); } }
Version | Description |
---|---|
3.0.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_xmlrpc_server/_multisite_getusersblogs