您可以创建一个新角色,并将“管理帖子”设置为该角色,以便他可以批准/拒绝帖子,然后您可以使用此功能根据需要删除菜单功能:
function remove_menus () {
global $menu;
$user = wp_get_current_user();
if ($user->ID == 2) { // change user ID,
$restricted = array(__(\'Dashboard\'), __(\'Posts\'), __(\'Media\'), __(\'Links\'), __(\'Pages\'), __(\'Appearance\'), __(\'Tools\'), __(\'Users\'), __(\'Settings\'), __(\'Comments\'), __(\'Plugins\'));
end ($menu);
while (prev($menu)){
$value = explode(\' \',$menu[key($menu)][0]);
if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){unset($menu[key($menu)]);}
}
}
}
add_action(\'admin_menu\', \'remove_menus\');
要让他收到关于新注册用户的电子邮件通知,您可以覆盖
wp_new_user_notification()
功能:
if ( !function_exists(\'wp_new_user_notification\') ) {
function wp_new_user_notification($user_id, $plaintext_pass = \'\') {
$user = new WP_User($user_id);
$user_login = stripslashes($user->user_login);
$user_email = stripslashes($user->user_email);
// The blogname option is escaped with esc_html on the way into the database in sanitize_option
// we want to reverse this for the plain text arena of emails.
$blogname = wp_specialchars_decode(get_option(\'blogname\'), ENT_QUOTES);
$message = sprintf(__(\'New user registration on your blog %s:\'), $blogname) . "\\r\\n\\r\\n";
$message .= sprintf(__(\'Username: %s\'), $user_login) . "\\r\\n\\r\\n";
$message .= sprintf(__(\'E-mail: %s\'), $user_email) . "\\r\\n";
//email admin
@wp_mail(get_option(\'admin_email\'), sprintf(__(\'[%s] New User Registration\'), $blogname), $message);
//email new editor
@wp_mail(\'USER_EMAIL_HERE\', sprintf(__(\'[%s] New User Registration\'), $blogname), $message);
if ( empty($plaintext_pass) )
return;
$message = sprintf(__(\'Username: %s\'), $user_login) . "\\r\\n";
$message .= sprintf(__(\'Password: %s\'), $plaintext_pass) . "\\r\\n";
$message .= wp_login_url() . "\\r\\n";
wp_mail($user_email, sprintf(__(\'[%s] Your username and password\'), $blogname), $message);
}
}
将此处的USER\\u EMAIL\\u更改为他的电子邮件