Malin revidoval tento gist . Přejít na revizi
1 file changed, 12 insertions
user-email-in-header.php(vytvořil soubor)
@@ -0,0 +1,12 @@ | |||
1 | + | /* START Display user email in header */ | |
2 | + | function show_user_email_shortcode() { | |
3 | + | if ( is_user_logged_in() ) { | |
4 | + | $current_user = wp_get_current_user(); | |
5 | + | return $current_user->user_email; | |
6 | + | } else { | |
7 | + | return ''; // Return an empty string if the user is not logged in | |
8 | + | } | |
9 | + | } | |
10 | + | add_shortcode('show_user_email', 'show_user_email_shortcode'); | |
11 | + | ||
12 | + | /* END Display user email in header */ |
Novější
Starší