1. Home
  2. Docs
  3. Developer Guide
  4. REST API
  5. Customising the data returned in REST API JSON

Customising the data returned in REST API JSON

Example demonstrating how to add all the individual address elements to the data returned.

add_filter( 'propertyhive_rest_api_property_fields', 'customise_rest_api_fields_returned' );
function customise_rest_api_fields_returned($field_array)
{
    $field_array[] = 'address_name_number';
    $field_array[] = 'address_street';
    $field_array[] = 'address_two';
    $field_array[] = 'address_three';
    $field_array[] = 'address_four';
    $field_array[] = 'address_postcode';
    return $field_array;
}
Was this article helpful to you? No Yes

How can we help?