WP_Error could not be converted to string

Question

I try to add an existing user to a blog with the function add_user_to_blog($blog_id, $user_id, $role). The code I use gives me:

Catchable fatal error: Object of class WP_Error could not be converted
to string in C:wamp64wwwwordpresswp-includesms-functions.php on
line 206.

What do I need to do to make this work?

This is my code:

$domain = "";
$path = "localhost/wordpress/wp_4";
$title = "WP_4";
$user_id = 1;
$network_id = get_main_network_id();
$role = 'editor';
$new_blog_id = wpmu_create_blog($domain, $path, $title, $user_id, $network_id);
add_user_to_blog($new_blog_id, $network_id, $role);
0
GamerBanaan 3 years 2018-04-03T03:23:53-05:00 0 Answers 73 views 0

Leave an answer

Browse
Browse