Using the Pods Framework, I am trying to get the underlying type of field for a custom pod. I need to determine:
- if it is a relationship field
- if it is a single or multiple relationship field
I have tried ['type']
using $type = $field['type'];
but don’t get any results
function get_relationship( $atts ) {
global $post;
$defaults = array(
'post_id' => $post->ID, // default to the current Post ID.
'pod' => '',
'field' => '',
'classes' => ''
);
$args = wp_parse_args( $atts, $defaults );
// get the pod
$pod = pods( $args['pod'], $args['post_id'] );
// get the relevant field
$related = $pod->field( $args['field'] );
$type = $related.type; //['type']; // ?