马春杰杰 Exit Reader Mode

文章添加密码之后,如果是博主或指定用户,则不需要输入密码

文件位于:wp-include/post-template.php,找到get_the_content这个函数

增加:

$email = null;
    $user_ID = (int) wp_get_current_user()->ID;
    $admin_email = "a"; //博主Email
    $wife_email = "13"; //其他email
    if ($user_ID > 0) {
    $email = get_userdata($user_ID)->user_email;}
    
    
	// If post password required and it doesn't match the cookie.
	if ($email != $admin_email && $email != $wife_email &&  post_password_required( $_post ) ) {
		return get_the_password_form( $_post );
	}

 

本文最后更新于2022年3月1日,已超过 1 年没有更新,如果文章内容或图片资源失效,请留言反馈,我们会及时处理,谢谢!