is_user_logged_in()
Description
Returns a Boolean value of true or false depending on whether the current visitor is logged in.
Parameters
This function does not accept any parameters.
Usage
Copy code The code is as follows:
Example
Use the is_user_logged_in() function to display different output results in the theme file according to the login status of the current visitor.
Copy code The code is as follows:
if ( is_user_logged_in() ) {
echo 'Welcome, registered user!';
} else {
echo 'Welcome, visitor!';
}
?>
Reference link: Function Reference/is user logged in
http://www.bkjia.com/PHPjc/323065.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/323065.htmlTechArticleis_user_logged_in() Description Returns a Boolean value of true or false depending on whether the current visitor is logged in. Parameters This function does not accept any parameters. Usage Copy the code The code is as follows: ?php if ( is_us...
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn