php - wordpress logged in user in storyboard -


trying logged in user in wordpress within lightbox plugin:

[iframe_loader type='lightbox' href='https://www.website.org/wp-content/uploads/articulate_uploads/testcert/' size_opt='lightebox_default']

this storyboard test send results php page - code in php page is:

<?php $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 />'; ?>  

the php needed include_once point wp-blog-header.php within wordpress function run.

include_once ( "../public_html/wp-blog-header.php" );  global $current_user;  echo 'username: ' . $current_user->user_login . "\n"; echo 'user email: ' . $current_user->user_email . "\n"; echo 'user level: ' . $current_user->user_level . "\n"; echo 'user first name: ' . $current_user->user_firstname . "\n"; echo 'user last name: ' . $current_user->user_lastname . "\n"; echo 'user display name: ' . $current_user->display_name . "\n"; echo 'user id: ' . $current_user->id . "\n"; 

Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -