Return field array from a Pod, a field’s data, or a field option
Function Definition
public function fields ( $field = null, $option = null )
Source File: /pods/classes/Pods.php
Parameters
PARAMETER | TYPE | DETAILS |
---|---|---|
$field | (null) | |
$option | (null) |
Returns
(bool|mixed)
Usage
1 2 3 4 5 6 7 8 9 10 |
// Get all fields (and their options) from a pod $fields = $pod->fields(); // Get a certain field (and it's options) from a pod $field = $pod->fields( 'field_name' ); // Get a certain field option from a pod $field_type = $pod->fields( 'field_name', 'type' ); // Get a list of data that you can select from a Relationship field $related_data = $pod->fields( 'related_field_name', 'data' ); |