uycc
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
Thanks for the quick reply.
I’ll keep an eye out for the new plugin.I couldn’t find the right hook for placement of the previous code. So, I went into um-fields.php and added an if/else. This way everytime the key was set to DIR_AREAS_OF_EXPERTISE the output was made to use a bulleted list
switch( $type ) { /* Default */ default: $output .= '<div class="um-field' . $classes . '"' . $conditional . ' data-key="'.$key.'">'; if ( isset( $data['label'] ) ) { $output .= $this->field_label($label, $key, $data); } $res = $this->field_value( $key, $default, $data ); $expertisekey = $key; if( ! empty( $res ) ){ $res = stripslashes( $res ); } if ($expertisekey == 'DIR_AREAS_OF_EXPERTISE') { $data['is_view_field'] = true; $res = apply_filters("um_view_field", $res, $data, $type ); $res = apply_filters("um_view_field_value_{$type}", $res, $data ); $res = '<ul><li>' . str_replace(",","</li><li>",$res) . '</li></ul>'; $output .= '<div class="um-field-area">'; $output .= '<div class="um-field-value">' . $res . '</div>'; $output .= '</div>'; $output .= '</div>'; } else { $data['is_view_field'] = true; $res = apply_filters("um_view_field", $res, $data, $type ); $res = apply_filters("um_view_field_value_{$type}", $res, $data ); $output .= '<div class="um-field-area">'; $output .= '<div class="um-field-value">' . $res . '</div>'; $output .= '</div>'; $output .= '</div>'; } break;
Not as elegant a solution as I would have liked. And, whenever there’s an upadate to the Ultimate Member plugin, I have to check to make sure it’s still working properly. But, it gets the job done.
I would appreciate the help if anyone has a better/cleaner solution
It looks like my code is not displaying right in the previous message.
Here is is again: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"><ul><li>' . str_replace(",","</li><li>",um_user('DIR_AREAS_OF_EXPERTISE')) . '</li></ul></div></div></div>';} }
Viewing 3 replies - 1 through 3 (of 3 total)