CMB2_Display_Multicheck

The Maps Builder CMB2 Display Multicheck class.

Defined (1)

The class is defined in the following location(s).

/vendor/wordimpress/maps-builder-core/includes/libraries/metabox/includes/CMB2_Field_Display.php  
  1. class CMB2_Display_Multicheck extends CMB2_Field_Display { 
  2. /** 
  3. * Display multicheck value. 
  4. * @since 2.2.2 
  5. */ 
  6. protected function _display() { 
  7. if ( empty( $this->value ) || ! is_array( $this->value ) ) { 
  8. return; 
  9.  
  10. $options = $this->field->options(); 
  11.  
  12. $output = array(); 
  13. foreach ( $this->value as $val ) { 
  14. if ( isset( $options[ $val ] ) ) { 
  15. $output[] = $options[ $val ]; 
  16. } else { 
  17. $output[] = esc_attr( $val ); 
  18.  
  19. echo implode( ', ', $output );