0

I want to display user's locations which they travelled on author box so how can I add this kind of input area to users profile? To more explain, If a user add "Londra,Paris" to own profile, these cities will seem author box as a tag.Londra and Paris must be entered to different areas so users can add extra fields. If it is impossible, how can I divide cities which form of "Paris,Londra" to use in city tags. I talk about divide all words by ,. I hope I could explain me.

Or explode lines like Hello Kity, and the function counts how many is there location

0

You should look at the add_user_meta function to capture the info from the user. Then you can lookup the value using get_user_meta.

Use this link for more info: https://developer.wordpress.org/reference/functions/add_user_meta/

0

You can divide the cities using explode function of php. It convert the strings to array on base of character added in the parameter. You can split the string on base of comma and print the location separately. Please use explode(",",$locations);

However, you can also use repeater field of acf. In this way users can add as many field as they wants. Please see the link here acf repeater field

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.