init.php
public function _display_render( $field, $val ) {
		$return = '';
		$posts = array();

		if ( ! empty( $val ) ) {
			foreach ( (array) $val as $id ) {
				$title = get_the_title( $id );
				if ( $title ) {
					$edit_link = get_edit_post_link( $id );
					$posts[ $id ] = compact( 'title', 'edit_link' );
				}
			}
		}

		if ( ! empty( $posts ) ) {

			$return .= '<ol>';
			foreach ( (array) $posts as $id => $post ) {
				$return .= sprintf(
					'<li id="attached-%d"><a href="%s">%s</a></li>',
					$id,
					$post['edit_link'],
					$post['title']
				);
			}
			$return .= '</ol>';

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

		return $return;
	}
public function _display_render( $field, $val ) {
		$return = '';
		$posts = array();

		if ( ! empty( $val ) ) {
			foreach ( (array) $val as $id ) {
				$title = get_the_title( $id );
				if ( $title ) {
					$edit_link = get_edit_post_link( $id );
					$posts[ $id ] = compact( 'title', 'edit_link' );
				}
			}
		}

		if ( ! empty( $posts ) ) {

			$return .= '<ol>';
			foreach ( (array) $posts as $id => $post ) {
				$return .= sprintf(
					'<li id="attached-%d"><a href="%s">%s</a></li>',
					$id,
					$post['edit_link'],
					$post['title']
				);
			}
			$return .= '</ol>';

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

		return $return;
	}
public function _display_render ( $ field , $ val ) { $ return = '' ; $ posts = array ( ) ; if ( ! empty ( $ val ) ) { foreach ( ( array ) $ val as $ id ) { $ title = get_the_title ( $ id ) ; if ( $ title ) { $ edit_link = get_edit_post_link ( $ id ) ; $ posts [ $ id ] = compact ( 'title' , 'edit_link' ) ; } } } if ( ! empty ( $ posts ) ) { $ return .= '<ol>' ; foreach ( ( array ) $ posts as $ id => $ post ) { $ return .= sprintf ( '<li id="attached-%d"><a href="%s">%s</a></li>' , $ id , $ post [ 'edit_link' ] , $ post [ 'title' ] ) ; } $ return .= '</ol>' ; } else { $ return .= '&mdash;' ; } return $ return ; }
Outputs the display of our custom field per repeatable value, if applicable.

@since 1.2.7

@param CMB2_Field $field This field object.
@param mixed      $val   The field value.
Outputs the display of our custom field per repeatable value if applicable .