Answer the question
In order to leave comments, you need to log in
How to display specific text for the user?
Let's say there is a user Alexander, you need to display one hint for him on the site.
How to do this in PHP in Wordpress?
Answer the question
In order to leave comments, you need to log in
$current_user = wp_get_current_user();
echo 'Username: ' . $current_user->user_login . '<br />';
echo 'email: ' . $current_user->user_email . '<br />';
echo 'first name: ' . $current_user->user_firstname . '<br />';
echo 'last name: ' . $current_user->user_lastname . '<br />';
echo 'Отображаемое имя: ' . $current_user->display_name . '<br />';
echo 'ID: ' . $current_user->ID . '<br />';
$current_user = wp_get_current_user();
if($current_user->user_login == "Alexander") {
echo "подсказка для александра";
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question