Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Notifications
Clear all

Custom field data in Members list table

4 Posts
2 Users
0 Reactions
2,843 Views
Posts: 2
Customer
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@ambarish-chatterjee)
Member
Joined: 5 years ago
[#8568]

I have wpForo user custom field plugin. I want to fetch the custom field data in the member's list. But it returns a string of all the data. But I want to retrieve only one field. Please check the screenshot below. I only want the city data

image

3 Replies
Posts: 4245
 Tom
Admin
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@tomson)
Famed Member
Joined: 11 years ago

Hi @ambarish-chatterjee,

It's a JSON data, you can decode it using json_decode() PHP function: https://www.php.net/manual/en/function.json-decode.php#example-3446

 

Also, as a quick solution, you can use the wpForo function which returns user field by user id:

<?php wpforo_user_field( 'city', $member['ID']); ?>

 

sdsdsd


Reply
2 Replies
Customer
(@ambarish-chatterjee)
Joined: 5 years ago

Member
Posts: 2
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

Hey @tomson,

 

Thank you so much. This worked perfectly. I have another query, where I am struggling. How we can use the custom field data in our template?

image

Here I want to use custom field data.


Reply
 Tom
Admin
(@tomson)
Joined: 11 years ago

Famed Member
Posts: 4245
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

Hi @ambarish-chatterjee,

I'm sorry, but we don't provide template customization support. This is all on you. If you're PHP developer, you can ask for files or functions. And you should read this documentation to see who it could be customized in update safe way:


Reply
Share:
Scroll to top