admin管理员组文章数量:1122826
in wordpress multisite when we give to site admin the option to add new users, site admin dont have the "checkbox" to add the new user without sending the user email with link activation (see the screenshot)
how can we add this option to site admin?
in wordpress multisite when we give to site admin the option to add new users, site admin dont have the "checkbox" to add the new user without sending the user email with link activation (see the screenshot)
how can we add this option to site admin?
Share Improve this question edited Dec 10, 2014 at 8:56 need-help asked Dec 10, 2014 at 8:38 need-helpneed-help 4761 gold badge9 silver badges29 bronze badges 3- no one knows how to make this? – need-help Commented Dec 10, 2014 at 20:14
- 1 It's possible since 3.8. See my answer there : wordpress.stackexchange.com/questions/125488/… – Matthieu Commented Apr 4, 2016 at 16:15
- there is already a checkbox when an admin creates a new user that says "Send the new user an email about their account." which accomplishes the same thing. – brothman01 Commented Jan 17, 2022 at 18:25
2 Answers
Reset to default 0Paste this in your functions.php
file:
function my_skip_confirmation_email() {
if ( is_multisite() && current_user_can( 'create_users' ) ) { ?>
<table class="form-table">
<tr>
<th scope="row"><?php _e( 'Skip Confirmation Email' ); ?></th>
<td>
<input type="checkbox" name="noconfirmation" id="noconfirmation" value="1" />
<label for="noconfirmation"><?php _e( 'Add the user without sending an email that requires their confirmation.' ); ?></label>
</td>
</tr>
</table>
<?php }
}
add_action( 'user_new_form', 'my_skip_confirmation_email' );
Add the following to your funcitons.php file
function skp_custom_user_create_fields($user){
if (!is_super_admin( $user_id )) {
?>
<table class="form-table">
<tr>
<th scope="row"><?php _e('Skip Confirmation Email') ?></th>
<td><input type = "checkbox" name = "noconfirmation" value = "1" <?php checked( $_POST['noconfirmation'], 1 ); ?> /> Add the user without sending an email that requires their confirmation.</td>
</tr>
</table>
<?php
}
}
add_action("user_new_form", "skp_custom_user_create_fields");
function skp_auto_activate_users($user, $user_email, $key, $meta){
if(!current_user_can('manage_options'))
return false;
if (!empty($_POST['noconfirmation']) && $_POST['noconfirmation'] == 1) {
wpmu_activate_signup($key);
return false;
}
}
add_filter('wpmu_signup_user_notification', 'skp_auto_activate_users', 10, 4);
That would do the job.
本文标签: multisiteGive to site admin the option to quotskip confirmation emailquot when adding new user
版权声明:本文标题:multisite - Give to site admin the option to "skip confirmation email" when adding new user 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736283620a1927024.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论