Using WordPress login authentication in external PHP file
-
Hey Guys/Gals,
I am having issues using WordPress authentication in an external PHP file to validate that the user is in fact an admin rather than someone who isn’t meant to have access.
For some reason I can’t even get a basic “is_user_logged_in” check to return any value at all.
This is the code I using:
<?php
require('../wp-blog-header.php');if ( is_user_logged_in() )
{
echo "test";
}
else
{
echo "test2";
}
?>This is always displaying “test2” and if I echo “is_user_logged_in” it will return nothing at all, not even NULL.
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Using WordPress login authentication in external PHP file’ is closed to new replies.