how to show logged in users a box to enter a single info

hi. using wordpress. and buddypress.

first of all i have to say that i love this plugin so customizable. great work.

there is exist such an option, but it will be activated only if email is not verified!
so when a user log in from social button and plugin cannot detect a valid email, a pop up will be shown and ask user to enter an email.
image
-----
what i'm looking to do is:
i just want to show all the users (who is loggin in with social login buttons)(with verified email),
a box just like email verification box.
and for (non-verified-emails) another field below email field.
ask them for a single info (which they must enter)(not spaces, not dots, not commas- only text more than 4 char)
and store that info in custom user meta.

---------

Extra Information
i've created a custom user meta(person_relation) ( to store a single info from custom user filed)
and it's a simple question : Who Invited You to this website?
so if a user has been invited from a friend = writes h/her name (not linked to any profile)(just text)
and if user do not have any invitation = writes NoBody.
so store that data through POST method, and see it in users admin panel.

if it's possible then , how should i hack the core files?!?

tnx for any help.

Answers

  • this is the custom meta i've created:

    add_action( 'personal_options_update', 'my_save_extra_profile_fields' ); add_action( 'edit_user_profile_update', 'my_save_extra_profile_fields' ); function my_save_extra_profile_fields( $user_id ) { if ( !current_user_can( 'edit_user', $user_id ) ) return false; /* Copy and paste this line for additional fields. */ add_user_meta( $user_id, ‘person_relation’, 30318 ); update_user_meta( $user_id, 'person_relation', $_POST['person_relation'] ); }

    and i've created a field in "sign up form" and also a column in Users admin panel too see it for myself.

    and now i just want to show this field and save its info from all the users uses the social login (because they wont see the sign up form) and i really need this data.
  • I need the same functionality for different META data . it will be great if social login can provide it.
  • HI,
    Possible, but requires customization. More than can fit here. Have a look at the file wp-content/plugins/oa-social-login/includes/user_interface.php, the additional form relates to oa_social_login_request_email.

    Regards
  • @fred_pinel
    hi fred.
    you know? one thing that i actually love about this plugin is your great support.
    you are so patient with the users.
    you guys are greattt. thank you.
    -----------
    yes i know the code is big... i saw it.
    actually last night i've tried to modify the plugin codes(which i have no idea how) :D
    in the file user_interface.php
    so, where ever i saw the word "email" i copied that line, paste it below that code and changed "email" word to "custom_meta".
    like: function oa_social_login_request_custom_meta
    or: plugin_require_custom_meta
    and also done this copy/paste/change in admin.php and it made an extra setting menu in admin area!
    but there were some codes it seems almost impossible to understand for me, to copy/paste/change!

    can i ask some of them (not all) here? will you help me through this a little?
  • @mahmoud_el_gabry
    yes this feature would be great.
    so if @fred_pinel helps me more in this request, you can follow this topic to make your own changes too.
  • thanks Fred and Poofy for the help. I managed somehow to make the changes, however is there a clean way to do the same in functions.php under my child theme, or is the only way is to modify the plugin php file?
  • edited June 2016
    @mahmoud_el_gabry
    you're welcome. i had a rough time changing the codes. cause i have trouble understanding some of the actions and statement. unfortunately it seems that Fred will not help us any more than
    Have a look at the file wp-content/plugins/oa-social-login/includes/user_interface.php, the additional form relates to oa_social_login_request_email.
    this.
    can you tell me how did you managed and make it happen? maybe it helps me too.
    i would be greatful if you tell me how you did it. thanks.
    i will send you a message, check your inbox please.
  • Hi Poofy,
    All your work happens in the function that Fred highlighted 'oa_social_login_request_email'. It has two sections. The first section handles storing the data in the database. You need to put your code under wp_update_user.

    The second section draws the form itself, you need to add your fields there after the email entry.


    One last thing you need to handle is that this function works only if the email is missing, you can alter it a bit to work with your case also. It is not recommended to modify the plugin files itself, i figured out a way to do the same work without doing that. Hope this helps. Thanks again to Fred for the help.
  • @mahmoud_el_gabry
    many thanks to you for explanation.
    and yes, thanks to @fred_pinel. this plugin provides me everything i needed.
  • Hi All,
    Great to see you work together towards this.
    @mahmoud_el_gabry, if you managed not to modify the plugin files, could you post more information here (for others).
    One way is in the theme's functions.php file,:
    - add a hook function for wp_footer (add_action ('wp_footer', 'my_custom_form');)
    - add a function called my_function_form, based on the oa_social_login_request_email,
    - but with specific code for your use-case. This requires a little more work.

    Sorry not to provide more info, but this is fairly specific, and we need to attend to all the other questions as well.
    Regards.
  • @fred_pinel thanks for your notice.
    and thanks to @mahmoud_el_gaby
    yes, somehow it would be good help for other as well.

Welcome!

Please sign in to your OneAll account to ask a new question or to contribute to the discussions.

Please click on the link below to connect to the forum with your OneAll account.