Since: 2.0
fields
Return field array from a Pod, a field’s data, or a field option
Function Definition
Parameters
Parameter | Type | Details |
---|---|---|
$field | (null) | |
$option | (null) |
Returns
(bool|mixed)
Examples
Correct Usage
// 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' );
// Grab Default Value of a Pod
$default = $pod->fields( 'field_name' )['options']['default_value'];
// Get a list of data that you can select from a Relationship field
$related_data = $pod->fields( 'related_field_name', 'data' );