Create admin users for support that expire.
Create a temporary WordPress admin user to provide access on support issues, etc. Allows for extending, restricting, and deleting users created by the plugin.
- Dedicated table for users created with the plugin
- Built-in processes to manage existing users
- Available actions and filters for modifying default values
- A suite of CLI commands
Yes. There is a built in WP-Cron job that will check the user accounts created by the plugin and compare the stored expiration date. Users that have expired will be automatically set to "Subscriber".
Absolutely! There's a filter.
/**
* Don't send the new user email when creating a new user.
*
* @return boolean
*/
add_filter( 'temporary_admin_user_disable_new_user_email', '__return_true' );
Sure can. There is a filter that impacts both promoting and extending a user, and then a more specific one for each action.
/**
* Change the default times for extending and promoting user actions.
*
* @param string $duration The current duration range. Default is 'day'.
* @param integer $user_id The individual user ID being updated.
*
* @return string One of the ranges to get a timestamp from.
*/
function prefix_set_default_action_range( $duration, $user_id ) {
return 'week';
}
add_filter( 'temporary_admin_user_default_user_action_range', 'prefix_set_default_action_range', 10, 2 );
/**
* Change the default times for extending, but not promoting users.
*
* @param string $duration The current duration range. Default is 'day'.
* @param integer $user_id The individual user ID being updated.
*
* @return string One of the ranges to get a timestamp from.
*/
function prefix_set_default_extend_range( $duration, $user_id ) {
return 'week';
}
add_filter( 'temporary_admin_user_default_user_extend_range', 'prefix_set_default_extend_range', 10, 2 );
/**
* Change the default times for promoting, but not extending users.
*
* @param string $duration The current duration range. Default is 'day'.
* @param integer $user_id The individual user ID being updated.
*
* @return string One of the ranges to get a timestamp from.
*/
function prefix_set_default_promote_range( $duration, $user_id ) {
return 'week';
}
add_filter( 'temporary_admin_user_default_user_promote_range', 'prefix_set_default_promote_range', 10, 2 );
You betcha. I would suggest reading the source code to get a better idea of what else can be done until I'm able to find time to document them all.
Check in the Help Tab above the admin table, and all the commands and their options are explained. You can also type wp tmp-admin-user
in the connected terminal and all the commands are shown.
Open a new issue in this repository and I'll see what I can do.