• Resolved paulryu

    (@paulryu)


    Hi,

    I am trying to have the plugin populate the business form field in contact, just like how it pulls username and email values if the user is logged in.

    I’m guessing I should add: $business = <em>"target string value"</em> once I initialize $business
    to class-qsm-contact-manager.php

    if ( is_user_logged_in() ) {
    			$current_user = wp_get_current_user();
    			$name         = $current_user->display_name;
    			$email        = $current_user->user_email;
    }

    and then add <?php echo esc_attr( $business ); ?> to value=” of <input <?php if ( $contact_disable_autofill ) { echo "autocomplete='off'"; } ?> type='text' class='<?php echo esc_attr( $class ); ?>' name='mlwUserComp' placeholder="<?php echo esc_attr( $options->business_field_text ); ?>" value='' />

    Since it is not populating the quiz module’s business contact form field with anything, I must be doing something wrong or missed something. I would appreciate it if you could shine some light on this.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter paulryu

    (@paulryu)

    FYI, the value I’m using is $current_user->user_registration_business which I have verified it has no issue with retrieving by replacing $email = $current_user->user_email; with it.

    Thread Starter paulryu

    (@paulryu)

    Got it to work by adding if ( 'comp' === $fields[ $i ]['use'] ) { $value = $business; }

    • This reply was modified 4 years, 2 months ago by paulryu.
    • This reply was modified 4 years, 2 months ago by paulryu.
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Populating contact form fields’ is closed to new replies.