本文整理汇总了PHP中setup_userdata函数的典型用法代码示例。如果您正苦于以下问题:PHP setup_userdata函数的具体用法?PHP setup_userdata怎么用?PHP setup_userdata使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setup_userdata函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cm_set_current_user
function cm_set_current_user($id)
{
global $current_user;
if ($current_user != null && $id == $current_user->ID) {
return $current_user;
}
$current_user = get_userdata($id);
setup_userdata($current_user);
return $current_user;
}
示例2: wp_set_current_user
function wp_set_current_user($id, $name = '')
{
global $current_user;
if (isset($current_user) && $id == $current_user->ID) {
return $current_user;
}
$current_user = new WP_User($id, $name);
setup_userdata($current_user->ID);
do_action('set_current_user');
return $current_user;
}
示例3: wp_set_current_user
function wp_set_current_user($id, $name = '')
{
global $current_user;
// If `$id` matches the user who's already current, there's nothing to do.
if (isset($current_user) && $current_user instanceof WP_User && $id == $current_user->ID && null !== $id) {
return $current_user;
}
$current_user = new WP_User($id, $name);
setup_userdata($current_user->ID);
do_action('set_current_user');
return $current_user;
}
示例4: wp_set_current_user
/**
* Changes the current user by ID or name.
*
* Set $id to null and specify a name if you do not know a user's ID.
*
* Some WordPress functionality is based on the current user and not based on
* the signed in user. Therefore, it opens the ability to edit and perform
* actions on users who aren't signed in.
*
* @since 2.0.3
* @global object $current_user The current user object which holds the user data.
*
* @param int $id User ID
* @param string $name User's username
* @return WP_User Current user User object
*/
function wp_set_current_user($id, $name = '')
{
global $current_user;
if (isset($current_user) && $current_user instanceof WP_User && $id == $current_user->ID) {
return $current_user;
}
$current_user = new WP_User($id, $name);
setup_userdata($current_user->ID);
/**
* Fires after the current user is set.
*
* @since 2.0.1
*/
do_action('set_current_user');
return $current_user;
}
示例5: handle_profile_modifications
/**
* Handles Profile modifications.
*
* @package s2Member\Profiles
* @since 3.5
*
* @attaches-to ``add_action('init');``
*/
public static function handle_profile_modifications()
{
global $current_user;
// We'll need to update this global object.
$user =& $current_user;
// Shorter reference to the $current_user object.
do_action('ws_plugin__s2member_before_handle_profile_modifications', get_defined_vars());
if (!empty($_POST['ws_plugin__s2member_profile_save']) && is_user_logged_in() && is_object($user) && !empty($user->ID) && ($user_id = $user->ID)) {
if (($nonce = $_POST['ws_plugin__s2member_profile_save']) && wp_verify_nonce($nonce, 'ws-plugin--s2member-profile-save')) {
$GLOBALS['ws_plugin__s2member_profile_saved'] = TRUE;
// Global flag as having been saved/updated successfully.
$_p = c_ws_plugin__s2member_utils_strings::trim_deep(stripslashes_deep($_POST));
// Clean ``$_POST`` vars.
$userdata['ID'] = $user_id;
// Needed for database update.
if (!empty($_p['ws_plugin__s2member_profile_email'])) {
if (is_email($_p['ws_plugin__s2member_profile_email']) && !email_exists($_p['ws_plugin__s2member_profile_email'])) {
$userdata['user_email'] = $_p['ws_plugin__s2member_profile_email'];
if (strcasecmp($userdata['user_email'], $user->user_email) !== 0) {
$email_change = TRUE;
}
}
}
if (!empty($_p['ws_plugin__s2member_profile_password1'])) {
if ($user->user_login !== 'demo') {
// No pass change on demo!
$userdata['user_pass'] = $_p['ws_plugin__s2member_profile_password1'];
}
}
if (!empty($_p['ws_plugin__s2member_profile_first_name'])) {
$userdata['first_name'] = $_p['ws_plugin__s2member_profile_first_name'];
}
if (!empty($_p['ws_plugin__s2member_profile_display_name'])) {
$userdata['display_name'] = $_p['ws_plugin__s2member_profile_display_name'];
}
if (!empty($_p['ws_plugin__s2member_profile_last_name'])) {
$userdata['last_name'] = $_p['ws_plugin__s2member_profile_last_name'];
}
wp_update_user(wp_slash($userdata));
// OK. Now send this array for an update.
if ($GLOBALS['WS_PLUGIN__']['s2member']['o']['custom_reg_fields']) {
if ($fields_applicable = c_ws_plugin__s2member_custom_reg_fields::custom_fields_configured_at_level('auto-detection', 'profile')) {
$fields = array();
// Initialize the array of fields.
$_existing_fields = get_user_option('s2member_custom_fields', $user_id);
foreach (json_decode($GLOBALS['WS_PLUGIN__']['s2member']['o']['custom_reg_fields'], TRUE) as $field) {
$field_var = preg_replace('/[^a-z0-9]/i', '_', strtolower($field['id']));
$field_id_class = preg_replace('/_/', '-', $field_var);
if (!in_array($field['id'], $fields_applicable) || strpos($field['editable'], 'no') === 0) {
if (isset($_existing_fields[$field_var]) && (is_array($_existing_fields[$field_var]) && !empty($_existing_fields[$field_var]) || is_string($_existing_fields[$field_var]) && strlen($_existing_fields[$field_var]))) {
$fields[$field_var] = $_existing_fields[$field_var];
} else {
unset($fields[$field_var]);
}
} else {
if ($field['required'] === 'yes' && (!isset($_p['ws_plugin__s2member_profile_' . $field_var]) || !is_array($_p['ws_plugin__s2member_profile_' . $field_var]) && !is_string($_p['ws_plugin__s2member_profile_' . $field_var]) || is_array($_p['ws_plugin__s2member_profile_' . $field_var]) && empty($_p['ws_plugin__s2member_profile_' . $field_var]) || is_string($_p['ws_plugin__s2member_profile_' . $field_var]) && !strlen($_p['ws_plugin__s2member_profile_' . $field_var])) || isset($_p['ws_plugin__s2member_profile_' . $field_var]) && c_ws_plugin__s2member_custom_reg_fields::validation_errors(array($field_var => $_p['ws_plugin__s2member_profile_' . $field_var]), array($field))) {
if (isset($_existing_fields[$field_var]) && (is_array($_existing_fields[$field_var]) && !empty($_existing_fields[$field_var]) || is_string($_existing_fields[$field_var]) && strlen($_existing_fields[$field_var]))) {
$fields[$field_var] = $_existing_fields[$field_var];
} else {
unset($fields[$field_var]);
}
} else {
if (isset($_p['ws_plugin__s2member_profile_' . $field_var])) {
if ((is_array($_p['ws_plugin__s2member_profile_' . $field_var]) && !empty($_p['ws_plugin__s2member_profile_' . $field_var]) || is_string($_p['ws_plugin__s2member_profile_' . $field_var]) && strlen($_p['ws_plugin__s2member_profile_' . $field_var])) && !c_ws_plugin__s2member_custom_reg_fields::validation_errors(array($field_var => $_p['ws_plugin__s2member_profile_' . $field_var]), array($field))) {
$fields[$field_var] = $_p['ws_plugin__s2member_profile_' . $field_var];
} else {
unset($fields[$field_var]);
}
} else {
unset($fields[$field_var]);
}
}
}
}
if (!empty($fields)) {
update_user_option($user_id, 's2member_custom_fields', $fields);
} else {
// Else delete their Custom Fields?
delete_user_option($user_id, 's2member_custom_fields');
}
}
}
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action('ws_plugin__s2member_during_handle_profile_modifications', get_defined_vars());
unset($__refs, $__v);
clean_user_cache($user_id);
wp_cache_delete($user_id, 'user_meta');
$user = new WP_User($user_id);
// Fresh object.
if (function_exists('setup_userdata')) {
//.........这里部分代码省略.........
示例6: handle_profile_modifications
//.........这里部分代码省略.........
if ($user->user_login !== "demo") {
/* No pass change on demo! */
$userdata["user_pass"] = $_p["ws_plugin__optimizemember_profile_password1"];
}
}
/**/
if (!empty($_p["ws_plugin__optimizemember_profile_first_name"])) {
$userdata["first_name"] = $_p["ws_plugin__optimizemember_profile_first_name"];
}
/**/
if (!empty($_p["ws_plugin__optimizemember_profile_display_name"])) {
$userdata["display_name"] = $_p["ws_plugin__optimizemember_profile_display_name"];
}
/**/
if (!empty($_p["ws_plugin__optimizemember_profile_last_name"])) {
$userdata["last_name"] = $_p["ws_plugin__optimizemember_profile_last_name"];
}
/**/
wp_update_user($userdata);
/* OK. Now send this array for an update. */
/**/
if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_fields"]) {
if ($fields_applicable = c_ws_plugin__optimizemember_custom_reg_fields::custom_fields_configured_at_level("auto-detection", "profile")) {
$_existing_fields = get_user_option("optimizemember_custom_fields", $user_id);
/**/
foreach (json_decode($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["custom_reg_fields"], true) as $field) {
$field_var = preg_replace("/[^a-z0-9]/i", "_", strtolower($field["id"]));
$field_id_class = preg_replace("/_/", "-", $field_var);
/**/
if (!in_array($field["id"], $fields_applicable) || strpos($field["editable"], "no") === 0) {
if (isset($_existing_fields[$field_var]) && (is_array($_existing_fields[$field_var]) && !empty($_existing_fields[$field_var]) || is_string($_existing_fields[$field_var]) && strlen($_existing_fields[$field_var]))) {
$fields[$field_var] = $_existing_fields[$field_var];
} else {
/* Else ``unset()``. */
unset($fields[$field_var]);
}
} else {
if ($field["required"] === "yes" && (!isset($_p["ws_plugin__optimizemember_profile_" . $field_var]) || !is_array($_p["ws_plugin__optimizemember_profile_" . $field_var]) && !is_string($_p["ws_plugin__optimizemember_profile_" . $field_var]) || is_array($_p["ws_plugin__optimizemember_profile_" . $field_var]) && empty($_p["ws_plugin__optimizemember_profile_" . $field_var]) || is_string($_p["ws_plugin__optimizemember_profile_" . $field_var]) && !strlen($_p["ws_plugin__optimizemember_profile_" . $field_var]))) {
if (isset($_existing_fields[$field_var]) && (is_array($_existing_fields[$field_var]) && !empty($_existing_fields[$field_var]) || is_string($_existing_fields[$field_var]) && strlen($_existing_fields[$field_var]))) {
$fields[$field_var] = $_existing_fields[$field_var];
} else {
/* Else ``unset()``. */
unset($fields[$field_var]);
}
} else {
if (isset($_p["ws_plugin__optimizemember_profile_" . $field_var])) {
if (is_array($_p["ws_plugin__optimizemember_profile_" . $field_var]) && !empty($_p["ws_plugin__optimizemember_profile_" . $field_var]) || is_string($_p["ws_plugin__optimizemember_profile_" . $field_var]) && strlen($_p["ws_plugin__optimizemember_profile_" . $field_var])) {
$fields[$field_var] = $_p["ws_plugin__optimizemember_profile_" . $field_var];
} else {
/* Else ``unset()``. */
unset($fields[$field_var]);
}
} else {
/* Else ``unset()``. */
unset($fields[$field_var]);
}
}
}
}
/**/
if (!empty($fields)) {
update_user_option($user_id, "optimizemember_custom_fields", $fields);
} else {
/* Else delete their Custom Fields? */
delete_user_option($user_id, "optimizemember_custom_fields");
}
}
}
/**/
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
do_action("ws_plugin__optimizemember_during_handle_profile_modifications", get_defined_vars());
unset($__refs, $__v);
/* Unset defined __refs, __v. */
/**/
$user = new WP_User($user_id);
/* Update the ``WP_User`` object for the current User/Member. */
function_exists("setup_userdata") ? setup_userdata() : null;
/* Update global vars. */
/**/
$lwp = c_ws_plugin__optimizemember_login_redirects::login_redirection_url($user);
$lwp = !$lwp ? get_page_link($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["login_welcome_page"]) : $lwp;
/**/
if (empty($_p["ws_plugin__optimizemember_sc_profile_save"])) {
echo '<script type="text/javascript">' . "\n";
echo "if(window.parent && window.parent != window) { window.parent.alert('" . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(_x("Profile updated successfully.", "s2member-front", "s2member")) . "'); window.parent.location = '" . c_ws_plugin__optimizemember_utils_strings::esc_js_sq($lwp) . "'; }";
echo "else if(window.opener) { window.alert('" . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(_x("Profile updated successfully.", "s2member-front", "s2member")) . "'); window.opener.location = '" . c_ws_plugin__optimizemember_utils_strings::esc_js_sq($lwp) . "'; window.close(); }";
echo "else { alert('" . c_ws_plugin__optimizemember_utils_strings::esc_js_sq(_x("Profile updated successfully.", "s2member-front", "s2member")) . "'); window.location = '" . c_ws_plugin__optimizemember_utils_strings::esc_js_sq($lwp) . "'; }";
echo '</script>' . "\n";
/**/
exit;
/* Clean exit. */
}
}
}
/**/
do_action("ws_plugin__optimizemember_after_handle_profile_modifications", get_defined_vars());
/**/
return;
/* Return for uniformity. */
}
示例7: array
<?php
require_once 'admin.php';
$title = "CCM Bảng điều khiển - Thêm sinh viên mới";
$usertype = 'student';
$new_student = array();
setup_userdata($new_student);
set_admin_content('user-edit');
require_once 'template-loader.php';
示例8: comments
function comments()
{
if (defined('OP_LIVEEDITOR')) {
self::$check_id['#wp_comments'] = __('You can only have Wordpress comments on the page once.', OP_SN);
return '<div class="comments-placeholder" id="wp_comments">' . __('Wordpress Comments', OP_SN) . '</div>';
}
setup_userdata(0);
if (file_exists(OP_PAGE_DIR . 'comments.php')) {
$tmp = OP_PAGE_DIR_REL . 'comments.php';
} else {
$tmp = '/pages/global/templates/comments.php';
}
ob_start();
comments_template($tmp, true);
$output = ob_get_contents();
ob_end_clean();
return $output;
}
示例9: teacher_list_select
function teacher_list_select($current, $input_name = 'teacher', $input_id = 'teacher')
{
echo "<select name=\"{$input_name}\" id=\"{$input_id}\">";
$all_teachers = _get_teachers();
foreach ($all_teachers as $teacher) {
setup_userdata($teacher);
echo '<option ' . is_selected(get_user_id() == $current) . ' value="' . get_user_id() . '">' . get_user_fullname() . '</option>';
}
echo "</select>";
}
示例10: foreach
foreach ($result as $user) {
array_push($users, $user['ID']);
}
} else {
$inc = 30;
if (!$_GET['pag']) {
$i = 0;
} else {
$i = $inc * (int) $_GET['pag'];
}
$users = $wpdb->get_col("SELECT ID FROM {$wpdb->users} ORDER BY user_login ASC LIMIT {$i},{$inc}");
}
$alt = "";
//$extra_data = new User_Extra_Data;
foreach ($users as $user_id) {
setup_userdata($user_id);
?>
<?php
if ($alt == "") {
$alt = " alt";
} else {
$alt = "";
}
?>
<div class="contact<?php
echo $alt;
?>
">
<span class="m-name"><a href="<?php
echo $url . '/?id=' . $user_id;
?>
示例11: foreach
</thead>
<tfoot>
<tr>
<th scope="col" class="column-stt">STT</th>
<th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input type="checkbox" /></th>
<th scope="col" id="student-code" class="manage-column column-code" style="">Mã Sv</th>
<th scope="col" id="fullname" class="manage-column column-fullname" style="">Họ tên</th>
<th scope="col" id="birthday" class="manage-column column-birthday" style="">Ngày sinh</th>
<th scope="col" id="faculty" class="manage-column column-faculty" style="">Khoa</th>
<th scope="col" id="address" class="manage-column column-address" style="">Địa chỉ</th>
</tr>
</tfoot>
<tbody id="the-student-list" class="list:student">
<?php
foreach ((array) $all_students as $student) {
setup_userdata($student);
?>
<tr id="student-<?php
user_id();
?>
" valign="top"<?php
class_alternate();
?>
>
<td class="column-stt"><?php
echo ++$offset;
?>
</td>
<th scope="row" class="check-column"><input type="checkbox" name="delete_students[]" value="<?php
user_id();
?>
示例12: handle_profile_modifications_4bp
/**
* Handles Profile modifications for Custom Fields *(created with s2Member)*; integrated with BuddyPress.
*
* @package s2Member\Profiles
* @since 3.5
*
* @attaches-to ``add_action('xprofile_updated_profile');``
*/
public static function handle_profile_modifications_4bp()
{
global $current_user;
// We'll need to update this global object.
$user =& $current_user;
// Shorter reference to the ``$current_user`` object.
do_action('ws_plugin__s2member_before_handle_profile_modifications_4bp', get_defined_vars());
if (!empty($_POST['ws_plugin__s2member_profile_4bp_save']) && is_user_logged_in() && is_object($user) && !empty($user->ID) && ($user_id = $user->ID)) {
if (($nonce = $_POST['ws_plugin__s2member_profile_4bp_save']) && wp_verify_nonce($nonce, 'ws-plugin--s2member-profile-4bp-save')) {
$GLOBALS['ws_plugin__s2member_profile_4bp_saved'] = TRUE;
// Global flag as having been saved/updated successfully.
$_p = c_ws_plugin__s2member_utils_strings::trim_deep(stripslashes_deep($_POST));
// Clean ``$_POST`` vars.
if ($GLOBALS['WS_PLUGIN__']['s2member']['o']['custom_reg_fields']) {
if ($fields_applicable = c_ws_plugin__s2member_custom_reg_fields::custom_fields_configured_at_level('auto-detection', 'profile')) {
$fields = array();
// Initialize the array of fields.
$_existing_fields = get_user_option('s2member_custom_fields', $user_id);
foreach (json_decode($GLOBALS['WS_PLUGIN__']['s2member']['o']['custom_reg_fields'], TRUE) as $field) {
$field_var = preg_replace('/[^a-z0-9]/i', '_', strtolower($field['id']));
$field_id_class = preg_replace('/_/', '-', $field_var);
if (!in_array($field['id'], $fields_applicable) || strpos($field['editable'], 'no') === 0) {
if (isset($_existing_fields[$field_var]) && (is_array($_existing_fields[$field_var]) && !empty($_existing_fields[$field_var]) || is_string($_existing_fields[$field_var]) && strlen($_existing_fields[$field_var]))) {
$fields[$field_var] = $_existing_fields[$field_var];
} else {
unset($fields[$field_var]);
}
} else {
if ($field['required'] === 'yes' && (!isset($_p['ws_plugin__s2member_profile_4bp_' . $field_var]) || !is_array($_p['ws_plugin__s2member_profile_4bp_' . $field_var]) && !is_string($_p['ws_plugin__s2member_profile_4bp_' . $field_var]) || is_array($_p['ws_plugin__s2member_profile_4bp_' . $field_var]) && empty($_p['ws_plugin__s2member_profile_4bp_' . $field_var]) || is_string($_p['ws_plugin__s2member_profile_4bp_' . $field_var]) && !strlen($_p['ws_plugin__s2member_profile_4bp_' . $field_var])) || isset($_p['ws_plugin__s2member_profile_4bp_' . $field_var]) && c_ws_plugin__s2member_custom_reg_fields::validation_errors(array($field_var => $_p['ws_plugin__s2member_profile_4bp_' . $field_var]), array($field))) {
if (isset($_existing_fields[$field_var]) && (is_array($_existing_fields[$field_var]) && !empty($_existing_fields[$field_var]) || is_string($_existing_fields[$field_var]) && strlen($_existing_fields[$field_var]))) {
$fields[$field_var] = $_existing_fields[$field_var];
} else {
unset($fields[$field_var]);
}
} else {
if (isset($_p['ws_plugin__s2member_profile_4bp_' . $field_var])) {
if ((is_array($_p['ws_plugin__s2member_profile_4bp_' . $field_var]) && !empty($_p['ws_plugin__s2member_profile_4bp_' . $field_var]) || is_string($_p['ws_plugin__s2member_profile_4bp_' . $field_var]) && strlen($_p['ws_plugin__s2member_profile_4bp_' . $field_var])) && !c_ws_plugin__s2member_custom_reg_fields::validation_errors(array($field_var => $_p['ws_plugin__s2member_profile_4bp_' . $field_var]), array($field))) {
$fields[$field_var] = $_p['ws_plugin__s2member_profile_4bp_' . $field_var];
} else {
unset($fields[$field_var]);
}
} else {
unset($fields[$field_var]);
}
}
}
}
if (!empty($fields)) {
update_user_option($user_id, 's2member_custom_fields', $fields);
} else {
// Else delete their Custom Fields?
delete_user_option($user_id, 's2member_custom_fields');
}
}
}
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action('ws_plugin__s2member_during_handle_profile_modifications_4bp', get_defined_vars());
unset($__refs, $__v);
clean_user_cache($user_id);
wp_cache_delete($user_id, 'user_meta');
$user = new WP_User($user_id);
// Fresh object.
if (function_exists('setup_userdata')) {
setup_userdata();
}
$role = c_ws_plugin__s2member_user_access::user_access_role($user);
$level = c_ws_plugin__s2member_user_access::user_access_role_to_level($role);
if (!empty($_p['ws_plugin__s2member_profile_4bp_opt_in']) && $role && $level >= 0) {
c_ws_plugin__s2member_list_servers::process_list_servers($role, $level, $user->user_login, '', $user->user_email, $user->first_name, $user->last_name, $_SERVER['REMOTE_ADDR'], TRUE, TRUE, $user_id);
} else {
if ($role && $level >= 0 && $GLOBALS['WS_PLUGIN__']['s2member']['o']['custom_reg_opt_in']) {
c_ws_plugin__s2member_list_servers::process_list_server_removals($role, $level, $user->user_login, '', $user->user_email, $user->first_name, $user->last_name, $_SERVER['REMOTE_ADDR'], TRUE, $user_id);
}
}
}
}
do_action('ws_plugin__s2member_after_handle_profile_modifications_4bp', get_defined_vars());
}
示例13: array
<?php
require_once 'admin.php';
$title = "CCM Bảng điều khiển - Thêm giảng viên mới";
$usertype = 'teacher';
$new_teacher = array();
setup_userdata($new_teacher);
set_admin_content('user-edit');
require_once 'template-loader.php';
示例14: foreach
</thead>
<tfoot>
<tr>
<th scope="col" class="column-stt">STT</th>
<th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input type="checkbox" /></th>
<th scope="col" id="teacher-code" class="manage-column column-code" style="">Mã Gv</th>
<th scope="col" id="fullname" class="manage-column column-fullname" style="">Họ tên</th>
<th scope="col" id="birthday" class="manage-column column-birthday" style="">Ngày sinh</th>
<th scope="col" id="faculty" class="manage-column column-faculty" style="">Khoa</th>
<th scope="col" id="address" class="manage-column column-address" style="">Địa chỉ</th>
</tr>
</tfoot>
<tbody id="the-teacher-list" class="list:teacher">
<?php
foreach ((array) $all_teachers as $teacher) {
setup_userdata($teacher);
?>
<tr id="teacher-<?php
user_id();
?>
" valign="top"<?php
class_alternate();
?>
>
<td class="column-stt"><?php
echo ++$offset;
?>
</td>
<th scope="row" class="check-column"><input type="checkbox" name="delete_teachers[]" value="<?php
user_id();
?>
示例15: add_friends_to_blog
function add_friends_to_blog($blog_id)
{
if (isset($_POST['count_friends'])) {
for ($i = 1; $i <= (int) $_POST['count_friends']; $i++) {
if (isset($_POST[$i])) {
add_user_to_blog($blog_id, $_POST[$i], 'editor');
setup_userdata($_POST[$i]);
$content_mail = 'Has sido invitado a participar en un nuevo blog por un amigo. Puedes acceder a el desde el siguiente enlace: ' . get_blog_option($blog_id, "siteurl");
wp_mail($user_email, sprintf(__('%s - Nuevo blog'), get_blog_option($blog_id, "blogname")), $content_mail, 'From: "Site Admin" <' . get_site_option('admin_email') . '>');
}
}
}
}