On this page
wp_xmlrpc_server::_multisite_getUsersBlogs( array $args ): array|IXR_Error
Private function for retrieving a users blogs for multisite setups
Parameters
$argsarray Required-
Method arguments. Note: arguments must be ordered as documented.
- int
Blog ID (unused).
1stringUsername.2stringPassword.
- int
Return
array|IXR_Error
Source
File: wp-includes/class-wp-xmlrpc-server.php. View all references
protected function _multisite_getUsersBlogs( $args ) {
$current_blog = get_site();
$domain = $current_blog->domain;
$path = $current_blog->path . 'xmlrpc.php';
$blogs = $this->wp_getUsersBlogs( $args );
if ( $blogs instanceof IXR_Error ) {
return $blogs;
}
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();
}
}
Related
Uses
| Uses | Description |
|---|---|
| get_site() wp-includes/ms-site.php | Retrieves site data given a site ID or site object. |
| wp_xmlrpc_server::wp_getUsersBlogs() wp-includes/class-wp-xmlrpc-server.php | Retrieve the blogs of the user. |
Used By
| Used By | Description |
|---|---|
| wp_xmlrpc_server::__call() wp-includes/class-wp-xmlrpc-server.php | Make private/protected methods readable for backward compatibility. |
| wp_xmlrpc_server::blogger_getUsersBlogs() wp-includes/class-wp-xmlrpc-server.php | Retrieve blogs that user owns. |
Changelog
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_xmlrpc_server/_multisite_getusersblogs