Search Knowledge Base by Keyword

You are here:
Print

RentPress Data Layer and Data Structure

Table of Contents

Please note:

This document is for RentPress version 7 and up. If you are running version 6 or earlier, please reference Build Custom Templates with RentPress Data.

This document represents data available as of RentPress version 7.3

 

Data Layer

The data layer is the preferred way to access RentPress data for use in templating. To use the functions outlined here you must first include the data-layer.php file. This can be done by using

require_once RENTPRESS_PLUGIN_DATA_ACCESS . 'data_layer.php';


Properties

rentpress_getAllProperties()

This Function Returns: All published properties on the site or null if you don’t have properties.

Arguments: none

rentpress_getNearbyProperties($city, $limit, $excluded_property_code)

This Function Returns: All properties in the same city or null if you don’t have any properties in the provided city.

Arguments: 3 possible arguments with only the city being required.

  1. City: The city of the floorplans you want. (string)
  2. Limit: The maximum number of nearby properties that should be returned. (integer)
  3. Excluded_property_code: The property code of a property you don’t want to be in the returned property list. (string)

rentpress_getAllPropertiesForTaxonomies($terms)

This Function Returns: All properties in the specified terms or null if you don’t have any properties with the provided terms.

Arguments: 1 possible argument with only the term being required. (array of strings)

rentpress_getAllPropertiesWithCodesOrIDs($properties_info)

This Function Returns: All properties who have the provided property codes or post ID’s

Arguments: 1 possible argument with only the property codes or ID’s being required. (array of strings)

rentpress_getAllPropertyWithCodeOrID($property_info)

This Function Returns: one property whose property code or post ID matches the one provided.

Arguments: 1 possible argument with only the property codes or ID’s being required. (array of strings)

rentpress_getAllPropertyDataWithCodeOrPostID($property_info)

This Function Returns: one property whose property code or post ID matches the one provided along with all of that properties floorplans and all of the units for those floorplans.

Arguments: 1 possible argument with only the property codes or ID’s being required. (array of strings)


Floor Plans

rentpress_getAllFloorplansAndUnits()

This Function Returns: All floor plans on the site or null if you don’t have properties.

Arguments: none

rentpress_getAllFloorplansByParentPropertyCode($property_code)

This function gets properties by parent property ids or codes. This function accepts one argument for the parent property codes or the parent property post id. The codes or ids should be given as an array

This Function Returns: All floorplans whose parent property code matches the code passed into the function.

Arguments: 1 possible argument with only the property code being required. (string)

rentpress_getFloorplanDataWithCodeOrPostID($floorplan_info)

This Function Returns: one floorplan who has the provided floorplan code or post ID

Arguments: 1 possible argument with only the floorplans code or ID being required. (strings)

rentpress_getFloorplansAndUnitsWithCodesOrPostIDs($floorplans_info)

This Function Returns: all floor plans and their units whose floor plan codes or post ID’s match the provided code or id.

Arguments: 1 possible argument with only the floor plans code or ID being required. (array of strings)

rentpress_getFloorplansAndUnitsWithParentPropertyCodesOrPostIDs($floorplans_info)

This Function Returns: all floor plans and their units whose parent property codes or parent property post ID’s match the provided code or id.

Arguments: 1 possible argument with only the floor plans parent property code or ID being required. (array of strings)

rentpress_getAllFloorplanDataWithCodeOrPostID($floorplan_info)

This Function Returns: one floor plan, all units belonging to that floor plan and its parent property along with all its units whose floor plan/parent floor plan code or floor plan/parent floor plan post ID match the provided code or id.

Arguments: 1 possible argument with only the floor plans code or ID being required. (strings)

rentpress_getSimilarFloorplans($floorplan, $comparing, $number_of_floorplans, $same_property)

This Function Returns: get specified number of floor plans that are similar to the floor plan passed in.

Arguments: 4 possible arguments with only the floor plans code or ID being required. (strings)

  1. Floorplan: the floor plan code or post id that we want similar floor plans for (string)
  2. Comparing: this is used to choose the most important factor in fetching similar floor plans. defaults to relevance and can accept “price”, “relevance”,”special” and “bedrooms” as values. (string)
  3. Number_of_floorplans: maximum number of floor plans that can be returned. (int)
  4. Same_property: choose if floor plans in the same property as the provided floor plan should be returned. Defaults to allow floor plans from the same property (bool)

Units

rentpress_getAllUnits()

This Function Returns: All units on the site or null if you don’t have any units.

Arguments: none

rentpress_getAllManualUnits()

This Function Returns: All units manually created on the site or null if you don’t have any manually created units.

Arguments: none

rentpress_getAllUnitCodes()

This Function Returns: All unit codes on the site or null if you don’t have any units.

Arguments: none

rentpress_getAllUnitsByParentPropertyCode($property_code)

This Function Returns: All units on the site whose parent property code matches the code provided or null if you don’t have any units with that code.

Arguments: 1 possible argument with only the parent property code or ID being required. (string)

rentpress_getAllUnitsForFloorplan($floorplan_code)

This Function Returns: all units whose parent floor plan code matches the provided floor plan code

Arguments: 1 possible argument with only the floor plans code being required. (string)

rentpress_getAllAvailableUnits()

This Function Returns: All units on the site whose available now date is today or earlier. Will return null if you don’t have any units available.

Arguments: none

rentpress_getAllAvailableUnitsByParentPropertyCode($property_code)

This Function Returns: All units on the site whose available now date is today or earlier and its parent property code matches the provided code. Will return null if you don’t have any units available.

Arguments: 1 possible argument with only the parent property code being required. (string)

rentpress_getAllAvailableUnitsByFloorplanByCode($floorplan_code)

This Function Returns: All units on the site whose available now date is today or earlier and its parent floor plan code matches the provided code. Will return null if you don’t have any units available.

Arguments: 1 possible argument with only the parent floor plan code being required. (string)

rentpress_getUnitAndFloorplanDataByUnitCode($unit_code)

This Function Returns: one unit and its parent floor plan or null if you don’t have any units with the provided unit code.

Arguments: 1 possible argument with only the unit code being required. (string)

rentpress_getRefreshData()

This Function Returns: all stored data about the RentPress sync jobs.

Arguments: none

rentpress_getRefreshRow($property_code)

This Function Returns: get all refresh data for specific property

Arguments: 1 possible argument with only the property code being required. (string)


Data Structure

Properties

  1. property_code: a unique identifier for property.
  2. property_post_id: the post id of this property.
  3. property_post_link: the permalink for this property
  4. property_source: the feed this property came from
  5. property_name: Marketing name used for the post title.
  6. property_description: Marketing description used for the post content.
  7. property_email: contact email for this property.
  8. property_phone_number: contact phone number for this property.
  9. property_website: link to a single property website
  10. property_availability_url: link to your feeds application page for this properties.
  11. property_fax: contact fax number for this property.
  12. property_office_hours: json object of times and days for this property
  13. property_timezone: timezone this property is in
  14. property_tour_url: url for virtual tour
  15. property_specials_message: message for any properties level special, deal, discount, etc.
  16. property_specials_link: link for any properties level special, deal, discount, etc
  17. property_facebook_link: social media link for this property.
  18. property_twitter_link: social media link for this property.
  19. property_instagram_link: social media link for this property.
  20. property_residents_link: social media link for this property.
  21. property_address: social media link for this property.
  22. property_city: city this property is a part of.
  23. property_state: state this property is a part of.
  24. property_zip: zip this property is a part of.
  25. property_latitude: latitude this property is a part of
  26. property_longitude: longitude this property is a part of
  27. property_primary_neighborhood_post_id: post id for the neighborhood that’s manually associated with this property.
  28. property_neighborhood_post_id: a list of all post ids associated with this property
  29. property_neighborhood_post_name: post name for the neighborhood that’s manually associated with this property
  30. property_gallery_shortcode: shortcode added using the RentPress gallery uploader in the admin
  31. property_gallery_images: images added using the RentPress gallery uploader in the admin
  32. property_featured_image_src: url of this properties featured image
  33. property_fees: text used to explain any fees like application fees.
  34. property_matterport_url: url for this properties virtual tour

Floorplans

  1. floorplan_code: a unique identifier for floorplans.
  2. floorplan_post_id: the post id of this floorplan.
  3. floorplan_parent_property_code: the code for the property this floorplan is a part of.
  4. floorplan_parent_property_post_id: the post ID for the property this floorplan is a part of.
  5. floorplan_post_link: the permalink for this floorplan
  6. floorplan_parent_property_post_link: the posts permalink for the property this floorplan is a part of.
  7. floorplan_name: Marketing name used for the post title.
  8. floorplan_parent_property_name: the post title for the property this floorplan is a part of.
  9. floorplan_description: Marketing description used for the post content.
  10. floorplan_availability_url: link to your feeds application page for this floorplan.
  11. floorplan_pdf: PDF uploaded in the wordpress admin for this post.
  12. floorplan_available: a boolean that represents if this floorplan has any available units.
  13. floorplan_units_total: total number units in this floorplan.
  14. floorplan_units_available: total number of available units in this floorplan.
  15. floorplan_units_available_30: total number of available units in this floorplan within 30 days
  16. floorplan_units_available_60: total number of available units in this floorplan within 60 days
  17. floorplan_units_unavailable: total number of unavailable units in this floorplan.
  18. floorplan_max_roomates: maximum number of roomates.
  19. floorplan_matterport_url: url for virtual tours
  20. floorplan_specials_message: message for any floorplan level special, deal, discount, ect
  21. floorplan_specials_link: link for any floorplan level special, deal, discount, ect
  22. floorplan_images: gallery images set in the wordpress admin
  23. floorplan_featured_image: the featured image set in the wordpress admin for this post.
  24. floorplan_featured_image_thumbnail: the featured images thumbnail
  25. floorplan_bedrooms: number of bedrooms for this floorplan
  26. floorplan_bathrooms: number of bedrooms for this floorplan
  27. floorplan_rent_min: the lowest rent of any units in this floorplan
  28. floorplan_rent_max: the highest rent of any units in this floorplan
  29. floorplan_sqft_min: the least sqft of any units in this floorplan
  30. floorplan_sqft_max: the most sqft of any units in this floorplan
  31. floorplan_deposit_min: minimum deposit value
  32. floorplan_deposit_max: maximum deposit value
  33. floorplan_rent_base: base rent value in the feed
  34. floorplan_rent_market: market rent value in the feed
  35. floorplan_rent_term: term rent value in the feed
  36. floorplan_rent_effective: effective rent value in the feed
  37. floorplan_rent_best: lowest rent value
  38. floorplan_rent_type_selection_cost: the rent to use based on the selected rent type in the admin
  39. floorplan_rent_type_selection: selected rent type in the admin that used to make the “Floorplan_rent_type_selection_cost” value.

See Also

WordPress Codex: Theme Development
WordPress Developer Theme Handbook