Support » Plugin: Ultimate Member – User Profile, User Registration, Login & Membership Plugin » Output image instead of text for the checkbox option Profile Form

  • Resolved shimu666

    (@shimu666)


    Hello,

    I would like to know if it’s possible to output an image in the profile view form instead of text for a checkbox option.

    I succed added this option in the edit mode (added classes to each option to output image instead of checkbox icon)
    Image edit mode

    But The output is a text. I would like to output the checkbox classes image
    Output image
    Do you think it’s possible ?
    because i saw the output code

    default:
    
    				$output .= '<div class="um-field' . $classes . '"' . $conditional . ' data-key="'.$key.'">';
    
    						if ( isset( $data['label'] ) ) {
    							$output .= $this->field_label($label, $key, $data);
    						}
    
    						$res = stripslashes( $this->field_value( $key, $default, $data ) );
    
    						$output .= '<div class="um-field-area">';
    						$output .= '<div class="um-field-value">' . $res . '</div>';
    						$output .= '</div>';
    
    						$output .= '</div>';
    
    				break;

    and i can’t seem to find a solution to output only this checkbox colum without interfering with the other output box.

    Thanks in advance for your help πŸ™‚
    https://wordpress.org/plugins/ultimate-member/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Ultimate Member

    (@ultimatemember)

    Maybe check if $key == a specific key and output it the way you want?

    Thread Starter shimu666

    (@shimu666)

    Hello,

    thanks for your reply it’s works almost perfectly but just a little details.
    Here the code

    default:
    
    				$output .= '<div class="um-field' . $classes . '"' . $conditional . ' data-key="'.$key.'">';
    
    						if ( isset( $data['label'] ) ) {
    							$output .= $this->field_label($label, $key, $data);
    						}
    
    						$res = stripslashes( $this->field_value( $key, $default, $data ) );
    
    						$output .= '<div class="um-field-area">';
    						if ($key == 'transportation') {
    						$v = rtrim($v);
    						foreach($options as $k => $v) {
    
    						$output .= '<div class="um-field-area">';
    						$output .= '<span class="um-field-checkbox-state '.$v.'"></span>';
    						$output .= '</div>';
    						}
    						if ( $this->is_selected($key, $v, $data) ) {
    								$output.= 'checked';
    							}
    						}
    						else {
    						$output .= '<div class="um-field-value">' . $res . '</div>';
    						$output .= '</div>';
    
    						$output .= '</div>';
    						}
    				break;

    It output all the available option and not the only one checked by the user.

    Do you have an idea why?
    Thanks in advance it helped me a lot.
    πŸ˜€

    Thread Starter shimu666

    (@shimu666)

    Never mind i found the solution. It was my foreach that was false. πŸ˜€
    My bad.
    Thanks a Lot Super DEV. Awesome Team and Support.

    Plugin Author Ultimate Member

    (@ultimatemember)

    You are welcome

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Output image instead of text for the checkbox option Profile Form’ is closed to new replies.