Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'wcfm_init', function() {
- $users = get_users( array(
- 'role' => 'wcfm_vendor',
- 'fields' => array( 'ID', 'user_nicename' )
- ) );
- foreach( $users as $user ) {
- if( substr($user->user_nicename, -1) == '%' ) {
- wp_update_user( array(
- 'ID' => $user->ID,
- 'user_nicename' => substr($user->user_nicename, 0, -1)
- ) );
- }
- }
- } );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement