classes/PodsAPI.php
public function load_sister_fields( $params, $pod = null ) {

		$params = (object) pods_sanitize( $params );

		if ( empty( $pod ) ) {
			$pod = $this->load_pod( array( 'name' => $params->pod, 'table_info' => false ), false );

			if ( false === $pod ) {
				return pods_error( __( 'Pod not found', 'pods' ), $this );
			}
		}

		$params->pod_id = $pod['id'];
		$params->pod    = $pod['name'];

		$type = false;

		if ( 0 === strpos( $params->related_pod, 'pod-' ) ) {
			$params->related_pod = pods_str_replace( 'pod-', '', $params->related_pod, 1 );
			$type                = 'pod';
		} elseif ( 0 === strpos( $params->related_pod, 'post_type-' ) ) {
			$params->related_pod = pods_str_replace( 'post_type-', '', $params->related_pod, 1 );
			$type                = 'post_type';
		} elseif ( 0 === strpos( $params->related_pod, 'taxonomy-' ) ) {
			$params->related_pod = pods_str_replace( 'taxonomy-', '', $params->related_pod, 1 );
			$type                = 'taxonomy';
		} elseif ( 'comment' === $params->related_pod ) {
			$type = $params->related_pod;
		}

		$related_pod = $this->load_pod( array( 'name' => $params->related_pod, 'table_info' => false ), false );

		if ( false === $related_pod || ( false !== $type && 'pod' !== $type && $type !== $related_pod['type'] ) ) {
			return pods_error( __( 'Related Pod not found', 'pods' ), $this );
		}

		$params->related_pod_id = $related_pod['id'];
		$params->related_pod    = $related_pod['name'];

		$sister_fields = array();

		foreach ( $related_pod['fields'] as $field ) {
			if ( 'pick' === $field['type'] && in_array( $field['pick_object'], array(
					$pod['type'],
					'pod'
				) ) && ( $params->pod == $field['pick_object'] || $params->pod == $field['pick_val'] ) ) {
				$sister_fields[ $field['id'] ] = esc_html( $field['label'] . ' (' . $field['name'] . ')' );
			}
		}

		return $sister_fields;
	}
public function load_sister_fields( $params, $pod = null ) {

		$params = (object) pods_sanitize( $params );

		if ( empty( $pod ) ) {
			$pod = $this->load_pod( array( 'name' => $params->pod, 'table_info' => false ), false );

			if ( false === $pod ) {
				return pods_error( __( 'Pod not found', 'pods' ), $this );
			}
		}

		$params->pod_id = $pod['id'];
		$params->pod    = $pod['name'];

		$type = false;

		if ( 0 === strpos( $params->related_pod, 'pod-' ) ) {
			$params->related_pod = pods_str_replace( 'pod-', '', $params->related_pod, 1 );
			$type                = 'pod';
		} elseif ( 0 === strpos( $params->related_pod, 'post_type-' ) ) {
			$params->related_pod = pods_str_replace( 'post_type-', '', $params->related_pod, 1 );
			$type                = 'post_type';
		} elseif ( 0 === strpos( $params->related_pod, 'taxonomy-' ) ) {
			$params->related_pod = pods_str_replace( 'taxonomy-', '', $params->related_pod, 1 );
			$type                = 'taxonomy';
		} elseif ( 'comment' === $params->related_pod ) {
			$type = $params->related_pod;
		}

		$related_pod = $this->load_pod( array( 'name' => $params->related_pod, 'table_info' => false ), false );

		if ( false === $related_pod || ( false !== $type && 'pod' !== $type && $type !== $related_pod['type'] ) ) {
			return pods_error( __( 'Related Pod not found', 'pods' ), $this );
		}

		$params->related_pod_id = $related_pod['id'];
		$params->related_pod    = $related_pod['name'];

		$sister_fields = array();

		foreach ( $related_pod['fields'] as $field ) {
			if ( 'pick' === $field['type'] && in_array( $field['pick_object'], array(
					$pod['type'],
					'pod'
				) ) && ( $params->pod == $field['pick_object'] || $params->pod == $field['pick_val'] ) ) {
				$sister_fields[ $field['id'] ] = esc_html( $field['label'] . ' (' . $field['name'] . ')' );
			}
		}

		return $sister_fields;
	}
public function load_sister_fields ( $ params , $ pod = null ) { $ params = ( object ) pods_sanitize ( $ params ) ; if ( empty ( $ pod ) ) { $ pod = $ this -> load_pod ( array ( 'name' => $ params -> pod , 'table_info' => false ) , false ) ; if ( false === $ pod ) { return pods_error ( __ ( 'Pod not found' , 'pods' ) , $ this ) ; } } $ params -> pod_id = $ pod [ 'id' ] ; $ params -> pod = $ pod [ 'name' ] ; $ type = false ; if ( 0 === strpos ( $ params -> related_pod , 'pod-' ) ) { $ params -> related_pod = pods_str_replace ( 'pod-' , '' , $ params -> related_pod , 1 ) ; $ type = 'pod' ; } elseif ( 0 === strpos ( $ params -> related_pod , 'post_type-' ) ) { $ params -> related_pod = pods_str_replace ( 'post_type-' , '' , $ params -> related_pod , 1 ) ; $ type = 'post_type' ; } elseif ( 0 === strpos ( $ params -> related_pod , 'taxonomy-' ) ) { $ params -> related_pod = pods_str_replace ( 'taxonomy-' , '' , $ params -> related_pod , 1 ) ; $ type = 'taxonomy' ; } elseif ( 'comment' === $ params -> related_pod ) { $ type = $ params -> related_pod ; } $ related_pod = $ this -> load_pod ( array ( 'name' => $ params -> related_pod , 'table_info' => false ) , false ) ; if ( false === $ related_pod || ( false !== $ type && 'pod' !== $ type && $ type !== $ related_pod [ 'type' ] ) ) { return pods_error ( __ ( 'Related Pod not found' , 'pods' ) , $ this ) ; } $ params -> related_pod_id = $ related_pod [ 'id' ] ; $ params -> related_pod = $ related_pod [ 'name' ] ; $ sister_fields = array ( ) ; foreach ( $ related_pod [ 'fields' ] as $ field ) { if ( 'pick' === $ field [ 'type' ] && in_array ( $ field [ 'pick_object' ] , array ( $ pod [ 'type' ] , 'pod' ) ) && ( $ params -> pod == $ field [ 'pick_object' ] || $ params -> pod == $ field [ 'pick_val' ] ) ) { $ sister_fields [ $ field [ 'id' ] ] = esc_html ( $ field [ 'label' ] . ' (' . $ field [ 'name' ] . ')' ) ; } } return $ sister_fields ; }
Load potential sister fields for a specific field

$params['pod'] int The Pod name
$params['related_pod'] string The related Pod name

@param array $params An associative array of parameters
@param array $pod    (optional) Array of Pod data to use (to avoid lookup)

@return array|bool

@since 1.7.9

@uses  PodsAPI::load_pod
Load potential sister fields for a specific field