title: How to add user roles dropdown in registration and login woocommerce wordpress
body: <p>I have a job site but i want to set drop down with roles i have 2 roles candidate and employer so i want to set a drop down select they roles i am using woocommerce registration and login i want to integrate dropdown with that roles for registration and login woocommerce.</p>
  
  <pre><code>function wp_dropdown_roles( $selected = '' ) {
      $p = '';
      $r = '';
  
      $editable_roles = array_reverse( get_editable_roles() );
  
      foreach ( $editable_roles as $role =&gt; $details ) {
          $name = translate_user_role($details['name'] );
          if ( $selected == $role ) // preselect specified role
              $p = "\n\t&lt;option selected='selected' value='" . esc_attr($role) . "'&gt;$name&lt;/option&gt;";
          else
              $r .= "\n\t&lt;option value='" . esc_attr($role) . "'&gt;$name&lt;/option&gt;";
      }
      echo $p . $r;
  }
  </code></pre>