Title: Force User Login
Author: smatric
Published: <strong>2011 年 11 月 9 日</strong>
Last modified: 2015 年 8 月 28 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://s.w.org/plugins/geopattern-icon/force-user-login-modified.svg)

# Force User Login

 作者：[smatric](https://profiles.wordpress.org/smatric/)

[下载](https://downloads.wordpress.org/plugin/force-user-login-modified.1.0.2.zip)

 * [详情](https://cn.wordpress.org/plugins/force-user-login-modified/#description)
 * [评价](https://cn.wordpress.org/plugins/force-user-login-modified/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/force-user-login-modified/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/force-user-login-modified/#developers)

 [支持](https://wordpress.org/support/plugin/force-user-login-modified/)

## 描述

This is a very small plugin that forces users to login before viewing any content.
This is done by checking if the user is logged in, and if not, redirecting them 
to the login page. Users attempting to view blog content via RSS are also authenticated
via HTTP Auth.

Modification: use get_site_url() to redirect to the login page properly when WordPress
is located in a subdirectory.

## 安装

 1. Upload `force-login.php` to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress

## 常见问题

  Can I change where the user is redirected after logging in?

Yes! A variable called $redirect_to (line 33) is currently set to redirect the user
to the page they were trying to access. If you changed that line from

    ```
    $redirect_to = $_SERVER['REQUEST_URI'];
    ```

to

    ```
    $redirect_to = '/';
    ```

it would redirect the user to the home page.

## 评价

此插件暂无评价。

## 贡献者及开发者

「Force User Login」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ smatric ](https://profiles.wordpress.org/smatric/)

[帮助将「Force User Login」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/force-user-login-modified)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/force-user-login-modified/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/force-user-login-modified/)，或通过
[RSS](https://plugins.trac.wordpress.org/log/force-user-login-modified/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/force-user-login-modified/)。

## 更新日志

#### 1.0.2

 * Tested with WordPress 4.3
 * Updated meta description
 * A screenshot added

## 额外信息

 *  版本 **1.0**
 *  最后更新：**11 年前**
 *  活跃安装数量 **40+**
 *  WordPress 版本 ** 2.0.2 或更高版本 **
 *  已测试的最高版本为 **4.3.34**
 *  语言
 * [English (US)](https://wordpress.org/plugins/force-user-login-modified/)
 * 标签
 * [force user login](https://cn.wordpress.org/plugins/tags/force-user-login/)[login](https://cn.wordpress.org/plugins/tags/login/)
   [password](https://cn.wordpress.org/plugins/tags/password/)[privacy](https://cn.wordpress.org/plugins/tags/privacy/)
 *  [高级视图](https://cn.wordpress.org/plugins/force-user-login-modified/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/force-user-login-modified/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/force-user-login-modified/reviews/)

## 贡献者

 *   [ smatric ](https://profiles.wordpress.org/smatric/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/force-user-login-modified/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](http://Don't%20worry%20about%20it)