Additional fields not showing in registration
-
Hi
I’m using Theme my Login 7.1.1 and using this documentation;
I’ve added the following code to a newly added theme-my-login-custom.php file I’ve created in /wp-content/plugins and added the <?php at the top;
function add_tml_registration_form_fields() { tml_add_form_field( 'register', 'pharmacy_name', array( 'type' => 'text', 'label' => 'Pharmacy Name', 'value' => tml_get_request_value( 'pharmacy_name', 'post' ), 'id' => 'pharmacy_name', 'priority' => 5, ) ); tml_add_form_field( 'register', 'pharmacy_banner_group', array( 'type' => 'text', 'label' => 'Pharmacy Banner/Group', 'value' => tml_get_request_value( 'pharmacy_banner_group', 'post' ), 'id' => 'pharmacy_banner_group', 'priority' => 5, ) ); } add_action( 'init', 'add_tml_registration_form_fields' ); function save_tml_registration_form_fields( $user_id ) { if ( isset( $_POST['pharmacy_name'] ) ) { update_user_meta( $user_id, 'pharmacy_name', sanitize_text_field( $_POST['pharmacy_name'] ) ); } if ( isset( $_POST['pharmacy_banner_group'] ) ) { update_user_meta( $user_id, 'pharmacy_banner_group', sanitize_text_field( $_POST['pharmacy_banner_group'] ) ); } } add_action( 'user_register', 'save_tml_registration_form_fields' );
But the additional fields are not showing in the register page. Its a site I’ve inherited, so I’m not 100% sure how the login was setup, but I can’t figure out why they aren’t showing.
The site is currently on a local build, so I’ve not been able to share the url, but I can put it on our development server if that helps.
Kind Regards
Wayne
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Additional fields not showing in registration’ is closed to new replies.