• Resolved waseemsoa

    (@waseemsoa)


    Hi,

    Is this possible to count form submission when a user click on submit button. Every form submission should get an id e.g. 1 after 2 afte 3 and so on. i want this Id on profile page as a user Id labelled “student id” apart from wp user id.

    Thank you for your plugin.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support Amrit Kumar Shrestha

    (@shresthauzwal)

    Hi @waseemsoa,

    With the current feature it is not possible to generate the id on submit button click. If a user register on your site then it will create the user id automatically.

    We respect our user’s needs so we have created a feature request page on our site. Here is the link https://wpeverest.com/wordpress-plugins/user-registration/feature-request.

    You can vote or create feature requests so we can build or modify the features according to our user’s needs.

    Regards!

    Thread Starter waseemsoa

    (@waseemsoa)

    ok

    can I get wp user id on profile page as a user Id labelled “student id”

    e.g.

    student Id = “sometext-1”

    Plugin Support Amrit Kumar Shrestha

    (@shresthauzwal)

    Hi @waseemsoa,

    Please try the following code snippet to display the user id on the profile page.

    add_action( "user_registration_edit_profile_form_start", 'ur_display_user_id_in_edit_profile'); function ur_display_user_id_in_edit_profile() { $user_id = get_current_user_id(); echo wp_kses_post( sprintf( __('<h5> Student ID: %s </h5>', 'user-registration' ), esc_html( $user_id ) ) ); }

    If you do not know how to add custom code snippets, please check this documentation https://docs.wpeverest.com/user-registration/docs/custom-code-snippet.

    Regards!

    Thread Starter waseemsoa

    (@waseemsoa)

    Hi @shresthauzwal

    above code shows current logged in user id but my requirement is not current logged in user id. I want to display user id of profile owner (newly registered) user id. for example if a user submit a form and registered with id number15 then student id should be “ID-15” on its own profile page along with all other details like first name, last name etc.

    • This reply was modified 2 years ago by waseemsoa.
    Plugin Support Amrit Kumar Shrestha

    (@shresthauzwal)

    Hi @waseemsoa,

    Since the form does not create any id as you mentioned so we would like to know how you implanted the ID on your form. If you provide us with the configuration screenshot and the registration form then maybe we can provide you suitable solution for you.

    Regards!

    Thread Starter waseemsoa

    (@waseemsoa)

    add_action( "user_registration_edit_profile_form_start", 'ur_display_user_id_in_edit_profile');
    function ur_display_user_id_in_edit_profile() { 
    $user_id = $_GET['user_id'];
     echo wp_kses_post( sprintf( __('<h5> Student ID: %s </h5>', 'user-registration' ), esc_html( $user_id ) )); }

    I hit the goal with the code snippet provided by you by replacing “$user_id = get_current_user_id();” with “$user_id = $_GET[‘user_id’];

    now can we get user role too with user id

    e.g. userrole+userid

    Thread Starter waseemsoa

    (@waseemsoa)

    @shresthauzwal

    any response please?

    Plugin Support Amrit Kumar Shrestha

    (@shresthauzwal)

    HI @waseemsoa,

    Please try the following code snippet

    add_action( "user_registration_edit_profile_form_start", 'ur_display_user_id_in_edit_profile');
    function ur_display_user_id_in_edit_profile() {
    $user_id = get_current_user_id();
    $user_data = get_userdata( $user_id );
    $role = $user_data->roles[0];
    echo wp_kses_post( sprintf( ('Student ID: %s', 'user-registration' ), esc_html( $user_id ) )); echo wp_kses_post( sprintf( ('Student Role: %s', 'user-registration' ), esc_html( $role ) ));
    }

    I hope this helps

    Regards!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Form submission count on every submission’ is closed to new replies.