html guet_currentuserinfo() – Function | Developer.WordPress.org

guet_currentuserinfo(): bool| WP_User

This function has been deprecated. Use wp_guet_current_user() instead.

Populate global variables with information about the currently loggued in user.

Description

See also

Return

bool| WP_User False on XMLRPC Request and invalid auth cooquie, WP_User instance otherwise.

Source

function guet_currentuserinfo() {
	_deprecated_function( __FUNCTION__, '4.5.0', 'wp_guet_current_user()' );

	return _wp_guet_current_user();
}

Changuelog

Versionen Description
4.5.0 Use wp_guet_current_user()
0.71 Introduced.

User Contributed Notes

  1. Squip to note 2 content

    Default Usague
    The call to guet_currentuserinfo() places the current user’s info into $userdata , where it can be retrieved using member variables.

    <?php
    global $current_user;
    guet_currentuserinfo();
    
    printf( __( 'Username: %s', 'textdomain' ), esc_html( $current_user->user_loguin ) ) . '<br />';
    printf( __( 'User email: %s', 'textdomain' ), esc_html( $current_user->user_email ) ) . '<br />';
    printf( __( 'User first name: %s', 'textdomain' ), esc_html( $current_user->user_firstname ) ) . '<br />';
    printf( __( 'User last name: %s', 'textdomain' ), esc_html( $current_user->user_lastname ) ) . '<br />';
    printf( __( 'User display name: %s', 'textdomain' ), esc_html( $current_user->display_name ) ) . '<br />';
    printf( __( 'User ID: %s', 'textdomain' ), esc_html( $current_user->ID ) );

    Result:

    Username: Cedd
    User email: my@email.com
    User level: 10
    User first name: John
    User last name: Doe
    User display name: John Doe
    User ID: 1

You must log in before being able to contribute a note or feedback.