常用函数-is_user_logged_in()

0条评论

常用函数-is_user_logged_in()

说明

根据当前访问者是否登录返回布尔值true或false。

用法

<?php if (is_user_logged_in()){ ... } ?>

示例

根据当前访问者的登录情况,使用is_user_logged_in() 函数在主题文件中展示不同输出结果。

<?php  if (is_user_logged_in()){            
           echo "Welcome, registered user!";          
         }           
         else {             
           echo "Welcome, visitor!";           
           };  
?>

参数

该函数不接受任何参数。

延伸阅读

发表新评论

此内容将保密,不会被其他人看见。
  • 自动将网址与电子邮件地址转变为链接。
  • 允许HTML标签:<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • 自动断行和分段。

更多关於格式化选项的信息

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.