1. Home
  2. Docs
  3. Developer Guide
  4. The ‘$property’ object and its properties / methods

The ‘$property’ object and its properties / methods

The default templates output key information relating to a property record, however there may be scenarios where you want to access additional information about a property.

You should notice at the top of most templates we have the following:

global $property;

This gives us access to a property object which contains all of the properties, as well as number of helper methods. Below we’ve outlined all of these for use in your templates.

An example of using any of these would be:

echo $property->bedrooms;

Note that in the database we store meta fields as 'private' by prefixing them with an underscore (e.g. _bedrooms).

Properties

Core Information

id
department (will be either ‘residential-sales’, ‘residential-lettings’ or ‘commercial’)

Address

reference_number
address_name_number
address_street
address_two
address_three (labelled ‘Town/City’ in Property Hive)
address_four (labelled ‘County/State’ in Property Hive)
address_postcode
address_country (contains the ISO code for the country, e.g. GB, US, FR)
location (returns a comma delimited list of locations)
latitude
longitude

For the display address use:

the_title();

For the full address see the helper method get_formatted_full_address() below.

Record Details

negotiator_id
office_id

There are a range of helper methods available to get the office information.

Residential Details

bedrooms
bathrooms
reception_rooms
property_type

Residential Sales Details

currency (returns the ISO code for currency, e.g. GBP, USD, EUR)
price (returns the price entered by the user)
price_actual (returns the price converted to GBP)
poa (returns ‘yes’ if POA ticked)
price_qualifier
sale_by
tenure

Note: For outputting the price, we recommend you use the helper method get_formatted_price() as that handles currencies, rent frequencies and formatting

Residential Lettings Details

currency (returns the ISO code for currency, e.g. GBP, USD, EUR)
rent (returns the price entered by the user)
price_actual (returns the price converted to GBP and converted to PCM.)
rent_frequency (returns pppw, pw, pcm, pq or pa)
deposit
available_date
furnished

Note: For outputting the price, we recommend you use the helper method get_formatted_price() as that handles currencies, rent frequencies and formatting
Note: For outputting the deposit, we recommend you use the helper method get_formatted_deposit() as that handles currencies and formatting
Note: For outputting the date available, we recommend you use the helper method get_available_date() as that handles formatting

Marketing

on_market (returns ‘yes’ if ‘On Market’ ticked)
featured (returns ‘yes’ if featured ticked. Also see the is_featured() helper method)
availability
marketing_flag (returns a comma delimited list of marketing flags)

Descriptions

For the full description you should use the helper method get_formatted_description().

For the features you should use the helper method get_features().

For the summary description you can use the following:

echo get_the_excerpt();

Media

All photos, floorplans, brochures etc can be obtained using helper methods below.

Helper Methods

General

get_formatted_full_address( $separator = ‘, ‘ ) – Outputs the full address, delimited with $separator.

get_formatted_price() – Returns the price in the correct currency, with formatting, including currency symbol and rent frequency. Will also output POA when necessary

get_formatted_deposit() – Returns the deposit in the correct currency, with formatting, including currency symbol

get_available_date() – Returns the date available formatted correctly as per WordPress settings. If date has passed it will return ‘Now’.

get_formatted_description() – Returns the full description, concatenating all of the rooms into HTML ready to be output.

get_features() – Returns an array of the features entered.

Media

get_gallery_attachment_ids() – Returns an array of photo attachment IDs

get_main_photo_src( $size = ‘thumbnail’ ) – Returns the src of the main property photo.

get_floorplan_attachment_ids() – Returns an array of floorplan attachment IDs

get_brochure_attachment_ids() – Returns an array of brochure attachment IDs

get_epc_attachment_ids() – Returns an array of EPC attachment IDs

get_virtual_tour_urls() – Returns an array of virtual tour URLs

Office Details

office_name

get_office_address( $separator = ‘, ‘ )

office_telephone_number

office_email_address

Negotiator Details

negotiator_name

negotiator_telephone_number

negotiator_email_address

negotiator_photo

Miscellaneous

is_featured() – Returns true or false

Was this article helpful to you? No 1 Yes 2

How can we help?