title: How to modify default WordPress registration form?
body: <p>I am creating one feature for adding user roles in WordPress default registration, it's working but I want to beautify it by adding a blank in user role selector, if it's showing a dropdown icon that will be awesome. I tried from my end but it's not showing.</p>
  <p>My codes are: (enable 'anyone can register' here /wp-admin/options-general.php, to see the changes, now go to register /wp-login.php?action=register)</p>
  <pre><code>/*
  show user profile in registeration
  */
  
  //1. Add a new form element...
  add_action('register_form', 'myplugin_register_form');
  function myplugin_register_form()
  {
  
      global $wp_roles;
      pll_e('Select Role');
      echo '&lt;select name=&quot;role&quot; class=&quot;input&quot;&gt;';
      foreach ($wp_roles-&gt;roles as $key =&gt; $value) {
          // Exclude default roles such as administrator etc. Add your own
          if (!in_array($value['name'], ['Administrator', 'Editor'])) {
              echo '&lt;option value=&quot;' . $key . '&quot;&gt;' . $value['name'] . '&lt;/option&gt;';
          }
      }
      echo '&lt;/select&gt;';
  }
  
  //2. Add validation.
  add_filter('registration_errors', 'myplugin_registration_errors', 10, 3);
  function myplugin_registration_errors($errors, $sanitized_user_login, $user_email)
  {
  
      if (empty($_POST['role']) || !empty($_POST['role']) &amp;&amp; trim($_POST['role']) == '') {
          $errors-&gt;add('role_error', __('&lt;strong&gt;ERROR&lt;/strong&gt;: You must include a role.', 'mydomain'));
      }
  
      return $errors;
  }
  
  //3. Finally, save our extra registration user meta.
  add_action('user_register', 'myplugin_user_register');
  function myplugin_user_register($user_id)
  {
  
      $user_id = wp_update_user(array('ID' =&gt; $user_id, 'role' =&gt; $_POST['role']));
  }
  </code></pre>