1. Docs
  2. Developer Guide
  3. REST API
  4. 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? Yes No