WordPress code to determine whether the user is logged in_PHP tutorial

WBOY
Release: 2016-07-21 15:31:15
Original
990 people have browsed it

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

www.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...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!