In a my current project, I want to integrate a module done in Yii with a wordpress site.
The user will login through the wordpress site and moved to the Yii section. I want to check from Yii, whether the user is logged in. Yii will be installed with in the root directory of wordpress and both the sites will hosted under same domain. like
http:://www.main-wp-site.com
http:://yiimodule.main-wp-site.com
Got the solution!!
All I have to do is include the
wp-load.php
file in theindex.php
of Yii and after that, I will be able to use all the wordpress functions, includingis_user_logged_in()
You can checkout the WordPress Function reference here . The function you’re looking for is
is_user_logged_in()
which returns true or false if the current user has a valid WordPress login.