Checking user login from outside wordpress
-
If I log in to Word press I am able to check my login status with a script like this.
However, if I login through Private Content then this will not work.
How can I check login from outside WordPress if the user only logs in to Private Content?
require_once('../wp-config.php'); require_once('../wp-includes/wp-db.php'); require_once('../wp-includes/pluggable.php'); //echo wp_get_current_user()->ID; $current_user = wp_get_current_user(); /** * @example Safe usage: $current_user = wp_get_current_user(); * if ( !($current_user instanceof WP_User) ) * return; */ echo 'Username: ' . $current_user->user_login . '<br />'; echo 'User email: ' . $current_user->user_email . '<br />'; echo 'User first name: ' . $current_user->user_firstname . '<br />'; echo 'User last name: ' . $current_user->user_lastname . '<br />'; echo 'User display name: ' . $current_user->display_name . '<br />'; echo 'User ID: ' . $current_user->ID . '<br />';
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Checking user login from outside wordpress’ is closed to new replies.