WordPress: Function Reference/auth redirect:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
(新页面: __NOTOC__ ==Description== %%%auth_redirect()%%% is a simple function that requires that the user be logged in before they can access a page. ==Default Usage== <?php auth_redirect() ?> Wh...)
 
无编辑摘要
第1行: 第1行:
__NOTOC__
__NOTOC__
__NOTOC__
==Description==
==Description==
== 描述==
%%%auth_redirect()%%% is a simple function that requires that the user be logged in before they can access a page.
%%%auth_redirect()%%% is a simple function that requires that the user be logged in before they can access a page.
%%%auth_redirect()%%%是一个简单的函数,要求用户登录后,才能够访问网页。
==Default Usage==
==Default Usage==
==默认用法==
  <?php auth_redirect() ?>
  <?php auth_redirect() ?>
<?php auth_redirect() ?>
When this code is called from a page, it checks to see if the user viewing the page is logged in. If the user is not logged in, they are redirected to the login page. The user is redirected in such a way that, upon logging in, they will be sent directly to the page they were originally trying to access.
When this code is called from a page, it checks to see if the user viewing the page is logged in. If the user is not logged in, they are redirected to the login page. The user is redirected in such a way that, upon logging in, they will be sent directly to the page they were originally trying to access.


从网页上调用这个代码的时候,查看访问网页的用户是否已经登录。如果用户没有登录,用户会转到登录网页,只要用户一登录,用户又会重新地进入他们原先试图访问的网页。


==Parameters==
==Parameters==
== 参数 ==
This function accepts no parameters.
This function accepts no parameters.
 
这个函数不接受任何参数。
==Related==
==Related==
==相关的==
[[WordPress:Function Reference/is user logged in|is_user_logged_in()]], [[WordPress:Function Reference/wp redirect|wp_redirect()]]
[[WordPress:Function Reference/is user logged in|is_user_logged_in()]], [[WordPress:Function Reference/wp redirect|wp_redirect()]]
[[WordPress:Function Reference/is user logged in|is_user_logged_in()]], [[WordPress:Function Reference/wp redirect|wp_redirect()]]

2008年7月21日 (一) 10:20的版本


Description

描述

%%%auth_redirect()%%% is a simple function that requires that the user be logged in before they can access a page.

%%%auth_redirect()%%%是一个简单的函数,要求用户登录后,才能够访问网页。

Default Usage

默认用法

<?php auth_redirect() ?>

<?php auth_redirect() ?> When this code is called from a page, it checks to see if the user viewing the page is logged in. If the user is not logged in, they are redirected to the login page. The user is redirected in such a way that, upon logging in, they will be sent directly to the page they were originally trying to access.

从网页上调用这个代码的时候,查看访问网页的用户是否已经登录。如果用户没有登录,用户会转到登录网页,只要用户一登录,用户又会重新地进入他们原先试图访问的网页。

Parameters

参数

This function accepts no parameters. 这个函数不接受任何参数。

Related

相关的

is_user_logged_in(), wp_redirect() is_user_logged_in(), wp_redirect()