Find the right hook
-
I am close to executing what i need, but I think I am using the wrong hook and cannot locate the proper one.
My goal it relatively simple to change the output of a custom meta field from simple text to an unordered list. Right now, the text field is displaying it’s content as a group of words separated by commas. I’ve been able to write the code to convert each item to a bulleted list. But, when it shows up on the profile page it is not in the correct location.
Here are two images. The first shows the current state, where Areas of Expertise has a list of items separated by commas and is positioned in the second column after Member Type. The second image shows the same page with a code snippet applied. The Areas of Expertise now are bulleted, but come above all the other data.
Here is the code I’m using:
add_filter(‘um_profile_field_filter_hook__DIR_AREAS_OF_EXPERTISE’, ‘um_profile_field_filter_hook__DIR_AREAS_OF_EXPERTISE’);
function um_profile_field_filter_hook__DIR_AREAS_OF_EXPERTISE() {
if (um_user(‘DIR_AREAS_OF_EXPERTISE’) != ”) {echo ‘<div class=”um-field um-field-DIR_AREAS_OF_EXPERTISE um-field-multiselect” data-key=”DIR_AREAS_OF_EXPERTISE”><div class=”um-field-label”><label for=”DIR_AREAS_OF_EXPERTISE-637″>Areas of Expertise</label><div class=”um-clear”></div></div><div class=”um-field-area”><div class=”um-field-value”>- ‘ . str_replace(“,”,”
- “,um_user(‘DIR_AREAS_OF_EXPERTISE’)) . ‘
</div></div></div>’;}
}Here is link to the profile page:
https://nschbc.uycc.com/user/thomas-ackerson/
Also, the Areas of Expertise show on the profile cards. Here’s a link to a sample search result.
https://nschbc.uycc.com/find-a-consultant/?DIR_AREAS_OF_EXPERTISE=Accounting&um_search=1Should I be using a different hook, other than um_profile_field_filter_hook__DIR_AREAS_OF_EXPERTISE, so that it displays after Member Type? Or should I be going at this in a different way?
Thanks, in advance, for any help you can offer.
- The topic ‘Find the right hook’ is closed to new replies.