PHP code example of wpsmith / user

1. Go to this page and download the library: Download wpsmith/user library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wpsmith / user example snippets


$the_current_user = \WPS\WP\User\CurrentUser::get_instance()->get_current_user();

// By ID.
\WPS\WP\User\CurrentUser::get_instance()->is_current_user( 2 )

// By Email.
\WPS\WP\User\CurrentUser::get_instance()->is_current_user( '[email protected]' )

// By username/user login
\WPS\WP\User\CurrentUser::get_instance()->is_current_user( 'myusername' )

$super_users = array(
    'username1',
    '[email protected]',
    3,
);
\WPS\WP\User\CurrentUser::get_instance()->is_current_a_super_user()

\WPS\WP\User\HideUser::get_instance( array(
    'hidden_user1',
    'hidden_user2',
) );