classes/fields/pick.php
public function value_to_label( $name, $value = null, $options = null, $pod = null, $id = null ) {

		if ( isset( $options['options'] ) ) {
			$options = array_merge( $options, $options['options'] );

			unset( $options['options'] );
		}

		$data = pods_v( 'data', $options, null, true );

		$object_params = array(
			// The name of the field.
			'name'    => $name,
			// The value of the field.
			'value'   => $value,
			// Field options.
			'options' => $options,
			// Pod data.
			'pod'     => $pod,
			// Item ID.
			'id'      => $id,
			// Data context.
			'context' => 'value_to_label',
		);

		if ( null !== $data ) {
			$data = (array) $data;
		} else {
			$data = $this->get_object_data( $object_params );
		}

		$labels = array();

		$check_value = $value;

		foreach ( $check_value as $check_k => $check_v ) {
			$check_value[ $check_k ] = (string) $check_v;
		}

		foreach ( $data as $v => $l ) {
			if ( ! in_array( (string) $l, $labels, true ) && ( (string) $value === (string) $v || ( is_array( $value ) && in_array( (string) $v, $value, true ) ) ) ) {
				$labels[] = (string) $l;
			}
		}

		$labels = apply_filters( 'pods_field_pick_value_to_label', $labels, $name, $value, $options, $pod, $id );

		$labels = pods_serial_comma( $labels );

		return $labels;

	}
public function value_to_label( $name, $value = null, $options = null, $pod = null, $id = null ) {

		if ( isset( $options['options'] ) ) {
			$options = array_merge( $options, $options['options'] );

			unset( $options['options'] );
		}

		$data = pods_v( 'data', $options, null, true );

		$object_params = array(
			// The name of the field.
			'name'    => $name,
			// The value of the field.
			'value'   => $value,
			// Field options.
			'options' => $options,
			// Pod data.
			'pod'     => $pod,
			// Item ID.
			'id'      => $id,
			// Data context.
			'context' => 'value_to_label',
		);

		if ( null !== $data ) {
			$data = (array) $data;
		} else {
			$data = $this->get_object_data( $object_params );
		}

		$labels = array();

		$check_value = $value;

		foreach ( $check_value as $check_k => $check_v ) {
			$check_value[ $check_k ] = (string) $check_v;
		}

		foreach ( $data as $v => $l ) {
			if ( ! in_array( (string) $l, $labels, true ) && ( (string) $value === (string) $v || ( is_array( $value ) && in_array( (string) $v, $value, true ) ) ) ) {
				$labels[] = (string) $l;
			}
		}

		$labels = apply_filters( 'pods_field_pick_value_to_label', $labels, $name, $value, $options, $pod, $id );

		$labels = pods_serial_comma( $labels );

		return $labels;

	}
public function value_to_label ( $ name , $ value = null , $ options = null , $ pod = null , $ id = null ) { if ( isset ( $ options [ 'options' ] ) ) { $ options = array_merge ( $ options , $ options [ 'options' ] ) ; unset ( $ options [ 'options' ] ) ; } $ data = pods_v ( 'data' , $ options , null , true ) ; $ object_params = array ( // The name of the field. 'name' => $ name , // The value of the field. 'value' => $ value , // Field options. 'options' => $ options , // Pod data. 'pod' => $ pod , // Item ID. 'id' => $ id , // Data context. 'context' => 'value_to_label' , ) ; if ( null !== $ data ) { $ data = ( array ) $ data ; } else { $ data = $ this -> get_object_data ( $ object_params ) ; } $ labels = array ( ) ; $ check_value = $ value ; foreach ( $ check_value as $ check_k => $ check_v ) { $ check_value [ $ check_k ] = ( string ) $ check_v ; } foreach ( $ data as $ v => $ l ) { if ( ! in_array ( ( string ) $ l , $ labels , true ) && ( ( string ) $ value === ( string ) $ v || ( is_array ( $ value ) && in_array ( ( string ) $ v , $ value , true ) ) ) ) { $ labels [ ] = ( string ) $ l ; } } $ labels = apply_filters ( 'pods_field_pick_value_to_label' , $ labels , $ name , $ value , $ options , $ pod , $ id ) ; $ labels = pods_serial_comma ( $ labels ) ; return $ labels ; }
Get the label from a pick value.

@param string            $name    The name of the field.
@param string|array|null $value   The value of the field.
@param array|null        $options Field options.
@param array|null        $pod     Pod data.
@param int|null          $id      Item ID.

@return string

@since 2.2.0
Get the label from a pick value .