init.php
public function display_render( $pre_output, $field, $display ) {
		if ( ! empty( $pre_output ) ) {
			return $pre_output;
		}

		$return = '';

		// If repeatable
		if ( $display->field->args( 'repeatable' ) ) {
			$rows = array();

			// And has a repeatable value
			if ( is_array( $display->field->value ) ) {

				// Then loop and output.
				foreach ( $display->field->value as $val ) {
					$rows[] = $this->_display_render( $display->field, $val );
				}
			}

			if ( ! empty( $rows ) ) {

				$return .= '<ul class="cmb2-' . str_replace( '_', '-', $display->field->type() ) . '"><li>';
				foreach ( (array) $rows as $row ) {
					$return .= sprintf( '<li>%s</a>', $row );
				}
				$return .= '</ul>';

			} else {
				$return .= '&mdash;';
			}

		} else {
			$return .= $this->_display_render( $display->field, $display->field->value );
		}

		return $return ? $return : $pre_output;
	}
public function display_render( $pre_output, $field, $display ) {
		if ( ! empty( $pre_output ) ) {
			return $pre_output;
		}

		$return = '';

		// If repeatable
		if ( $display->field->args( 'repeatable' ) ) {
			$rows = array();

			// And has a repeatable value
			if ( is_array( $display->field->value ) ) {

				// Then loop and output.
				foreach ( $display->field->value as $val ) {
					$rows[] = $this->_display_render( $display->field, $val );
				}
			}

			if ( ! empty( $rows ) ) {

				$return .= '<ul class="cmb2-' . str_replace( '_', '-', $display->field->type() ) . '"><li>';
				foreach ( (array) $rows as $row ) {
					$return .= sprintf( '<li>%s</a>', $row );
				}
				$return .= '</ul>';

			} else {
				$return .= '&mdash;';
			}

		} else {
			$return .= $this->_display_render( $display->field, $display->field->value );
		}

		return $return ? $return : $pre_output;
	}
public function display_render ( $ pre_output , $ field , $ display ) { if ( ! empty ( $ pre_output ) ) { return $ pre_output ; } $ return = '' ; // If repeatable if ( $ display -> field -> args ( 'repeatable' ) ) { $ rows = array ( ) ; // And has a repeatable value if ( is_array ( $ display -> field -> value ) ) { // Then loop and output. foreach ( $ display -> field -> value as $ val ) { $ rows [ ] = $ this -> _display_render ( $ display -> field , $ val ) ; } } if ( ! empty ( $ rows ) ) { $ return .= '<ul class="cmb2-' . str_replace ( '_' , '-' , $ display -> field -> type ( ) ) . '"><li>' ; foreach ( ( array ) $ rows as $ row ) { $ return .= sprintf ( '<li>%s</a>' , $ row ) ; } $ return .= '</ul>' ; } else { $ return .= '&mdash;' ; } } else { $ return .= $ this -> _display_render ( $ display -> field , $ display -> field -> value ) ; } return $ return ? $ return : $ pre_output ; }
Outputs the display of our custom field.

@since 1.2.7

@param bool|mixed         $pre_output Default null value.
@param CMB2_Field         $field      This field object.
@param CMB2_Field_Display $display    The `CMB2_Field_Display` object.
Outputs the display of our custom field .