Support » Plugin: Sliced Invoices & Contact Form 7 » Changing Username to Lowercase & No Spaces

  • symbi0tic

    (@symbi0tic)


    I don’t know if this is best practices but it worked for me and I’m trying it out. I saw that the usernames created in the WP Users were the full name with capitalization and spaces so I changed it to lowercase and no spaces by changing a line of code in:

    wp-content\plugins\sliced-invoices-contact-form-7\sliced-invoices-contact-form-7.php

    from

    // create the user
     $userdata = array(
         'user_login'  =>  $name,

    to

    // create the user
     $userdata = array(
        'user_login'  =>  strtolower(preg_replace( '/\s+/', '', $name )), // was: $name,
  • The topic ‘Changing Username to Lowercase & No Spaces’ is closed to new replies.