• Resolved jensno

    (@jensno)


    I want to give the user the choice of whether his profile is public or not. How can I include this in the registration? via the functions.php?

    This is for the username

    
    function wooc_extra_register_fields() {?>
           <p class="form-row form-row-wide">
           <label for="reg_username"><?php _e( 'Username', 'woocommerce' ); ?>/Team-Store Name<span class="required">*</span></label>
           <input type="text" class="woocommerce-Input woocommerce-Input--text input-text" name="username" id="reg_username" value="<?php echo ( ! empty( $_POST['username'] ) ) ? esc_attr( $_POST['username'] ) : ''; ?>" />
           </p>
           <div class="clear"></div>
           <?php
     }
     add_action( 'woocommerce_register_form_start', 'wooc_extra_register_fields' );
    

    what are the field names for public / private?

Viewing 1 replies (of 1 total)
  • Hi,

    This is not easily possible right now. You can add a new field from the registration form builder and when user is registered it will be saved in our custom user meta table. You can use a function uwp_get_usermeta( $user_id, $key, $default ) to get the value and based on that you can redirect the user to home page or 404 page on ‘template_redirect’ action.

    Regards,
    Patrik

Viewing 1 replies (of 1 total)
  • The topic ‘Public or Private’ is closed to new replies.