• Resolved judyoos

    (@judyoos)


    Thank you for creating your awesome Theme-My-Login plugin. For some reason, I’m can’t get it to work right, and I would really appreciate if you can help me with it.

    I’m using WordPress version: Latest
    Plugin Name version: Version 7.0.15

    I did this:

    function add_tml_registration_form_fields() {
    tml_add_form_field( ‘register’, ‘Cost_model_user_chose’, array(
    ‘type’ => ‘dropdown’,
    ‘label’ => ‘Select your correct option for billing ‘,
    ‘value’ => tml_get_request_value( ‘Cost_model_user_chose’, ‘post’ ),
    ‘options’ => array(
    ‘1’ => ‘Limited Option’,
    ‘2’ => ‘Unlimited Option’,
    ),
    ‘value’ => tml_get_request_value( ‘Cost_model_user_chose’, ‘post’ ),
    ‘priority’ => 15,

    ) );
    }
    add_action( ‘init’, ‘add_tml_registration_form_fields’ );

    function tml_user_register( $user_id ) {

    update_user_meta($user_id, ‘Count_reg_schoolhopper’, 0);
    update_user_meta($user_id, ‘Count_hist_per_schoolhopper’, 0);
    update_user_meta($user_id, ‘Count_view_per_area’, 0);
    update_user_meta( $user_id, ‘Cost_model_user_chose’, sanitize_text_field(
    $_POST[‘Cost_model_user_chose’]));
    }
    add_action( ‘user_register’, ‘tml_user_register’ );

    I expected the plugin to do this:

    Update the new field with Limited Option or Unlimited Option but its spaces at the moment even though I chose Limited.

    Instead it did this: (Include any error messages here)

    My site is hosted with:
    Hostking in SA

    Thank you for taking your time out to help. I really appreciate it ??

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter judyoos

    (@judyoos)

    I picked up it gives me the following error – PHP Warning: Use of undefined constant Cost_model_user_chose

    I have all this code in One Snippet in Code Snippets plugin, so it doesnt recognize Cost_model_user_chose as a constant…….

    Do I have to have seperate snippets as the 2 are not talking to each other it seems

    Thread Starter judyoos

    (@judyoos)

    That error is sorted now but the new field is empty……am I adding the new field wrongly?

    Plugin Author Jeff Farthing

    (@jfarthing84)

    Please keep support requests to one channel. As a paying customer, I am already assisting you via our commercial channel.

    For reference, the issue here is that uppercase letters are being used for the field names. Please use lowercase letters.

    Thread Starter judyoos

    (@judyoos)

    Sorry, Thanks a lot but why isn’t it clear in the documentation?

    Took me 3 days to resolve and its such a small thing.

    Maybe I am not reading the documentation properly but there is not much examples all examples are on the easy stuff

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘new Dropdown Field not updating’ is closed to new replies.