2017-25 © Pedro Peláez
 

library user

WordPress user.

image

wpsmith/user

WordPress user.

  • Wednesday, July 4, 2018
  • by wpsmith
  • Repository
  • 1 Watchers
  • 0 Stars
  • 15 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

User

This package contains two classes: 1. CurrentUser 1. HideUser, (*1)

Set Current User

WordPress does not set the current user until right before the init hook. This can be problematic sometimes. Sometimes, you may need to set the current user before WordPress is ready to set the current user (e.g., on after_setup_theme, muplugins_loaded, registered_taxonomy or registered_post_type hooks). So this class enables you to do that., (*2)

For the current user:, (*3)

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

Determining whether a user is the current user by User ID, email or username:, (*4)

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

// By Email.
\WPS\WP\User\CurrentUser::get_instance()->is_current_user( 'email@domain.com' )

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

You can also use this to set "super" users., (*5)

$super_users = array(
    'username1',
    'email@domain.com',
    3,
);
\WPS\WP\User\CurrentUser::get_instance()->is_current_a_super_user()

Hide User

Sometimes it is good to hide a user from other users so that user won't be deleted or modified accidentally by another administrator., (*6)

To hide a user or set of users:, (*7)

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

The Versions

04/07 2018

dev-master

9999999-dev https://github.com/wpsmith/User

WordPress user.

  Sources   Download

GPL-2.0+

The Requires

 

wordpress user

04/07 2018

0.0.4

0.0.4.0 https://github.com/wpsmith/User

WordPress user.

  Sources   Download

GPL-2.0+

The Requires

 

wordpress user

03/07 2018

0.0.3

0.0.3.0 https://github.com/wpsmith/User

WordPress user.

  Sources   Download

GPL-2.0+

The Requires

 

wordpress user

12/06 2018

0.0.2

0.0.2.0 https://github.com/wpsmith/User

WordPress user.

  Sources   Download

GPL-2.0+

The Requires

 

wordpress user

12/06 2018

0.0.1

0.0.1.0 https://github.com/wpsmith/User

WordPress user.

  Sources   Download

GPL-2.0+

The Requires

 

wordpress user