Search Knowledge Base by Keyword
RentPress Data Layer and Data Structure
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.
- City: The city of the floorplans you want. (string)
- Limit: The maximum number of nearby properties that should be returned. (integer)
- 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)
- Floorplan: the floor plan code or post id that we want similar floor plans for (string)
- 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)
- Number_of_floorplans: maximum number of floor plans that can be returned. (int)
- 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
- property_code: a unique identifier for property.
- property_post_id: the post id of this property.
- property_post_link: the permalink for this property
- property_source: the feed this property came from
- property_name: Marketing name used for the post title.
- property_description: Marketing description used for the post content.
- property_email: contact email for this property.
- property_phone_number: contact phone number for this property.
- property_website: link to a single property website
- property_availability_url: link to your feeds application page for this properties.
- property_fax: contact fax number for this property.
- property_office_hours: json object of times and days for this property
- property_timezone: timezone this property is in
- property_tour_url: url for virtual tour
- property_specials_message: message for any properties level special, deal, discount, etc.
- property_specials_link: link for any properties level special, deal, discount, etc
- property_facebook_link: social media link for this property.
- property_twitter_link: social media link for this property.
- property_instagram_link: social media link for this property.
- property_residents_link: social media link for this property.
- property_address: social media link for this property.
- property_city: city this property is a part of.
- property_state: state this property is a part of.
- property_zip: zip this property is a part of.
- property_latitude: latitude this property is a part of
- property_longitude: longitude this property is a part of
- property_primary_neighborhood_post_id: post id for the neighborhood that’s manually associated with this property.
- property_neighborhood_post_ids: a list of all post ids associated with this property
- property_neighborhood_post_name: post name for the neighborhood that’s manually associated with this property
- property_neighborhood_post_names: post name for all of the neighborhoods associated with this property
- property_gallery_shortcode: shortcode added using the RentPress gallery uploader in the admin
- property_gallery_images: images added using the RentPress gallery uploader in the admin
- property_featured_image_src: url of this properties featured image
- property_fees: text used to explain any fees like application fees.
- property_matterport_url: url for this properties virtual tour
Floorplans
- floorplan_code: a unique identifier for floorplans.
- floorplan_post_id: the post id of this floorplan.
- floorplan_parent_property_code: the code for the property this floorplan is a part of.
- floorplan_parent_property_post_id: the post ID for the property this floorplan is a part of.
- floorplan_post_link: the permalink for this floorplan
- floorplan_parent_property_post_link: the posts permalink for the property this floorplan is a part of.
- floorplan_name: Marketing name used for the post title.
- floorplan_parent_property_name: the post title for the property this floorplan is a part of.
- floorplan_description: Marketing description used for the post content.
- floorplan_availability_url: link to your feeds application page for this floorplan.
- floorplan_pdf: PDF uploaded in the wordpress admin for this post.
- floorplan_available: a boolean that represents if this floorplan has any available units.
- floorplan_units_total: total number units in this floorplan.
- floorplan_units_available: total number of available units in this floorplan.
- floorplan_units_available_30: total number of available units in this floorplan within 30 days
- floorplan_units_available_60: total number of available units in this floorplan within 60 days
- floorplan_units_unavailable: total number of unavailable units in this floorplan.
- floorplan_max_roomates: maximum number of roomates.
- floorplan_matterport_url: url for virtual tours
- floorplan_specials_message: message for any floorplan level special, deal, discount, ect
- floorplan_specials_link: link for any floorplan level special, deal, discount, ect
- floorplan_images: gallery images set in the wordpress admin
- floorplan_featured_image: the featured image set in the wordpress admin for this post.
- floorplan_featured_image_thumbnail: the featured images thumbnail
- floorplan_bedrooms: number of bedrooms for this floorplan
- floorplan_bathrooms: number of bedrooms for this floorplan
- floorplan_rent_min: the lowest rent of any units in this floorplan
- floorplan_rent_max: the highest rent of any units in this floorplan
- floorplan_sqft_min: the least sqft of any units in this floorplan
- floorplan_sqft_max: the most sqft of any units in this floorplan
- floorplan_deposit_min: minimum deposit value
- floorplan_deposit_max: maximum deposit value
- floorplan_rent_base: base rent value in the feed
- floorplan_rent_market: market rent value in the feed
- floorplan_rent_term: term rent value in the feed
- floorplan_rent_effective: effective rent value in the feed
- floorplan_rent_best: lowest rent value
- floorplan_rent_type_selection_cost: the rent to use based on the selected rent type in the admin
- floorplan_rent_type_selection: selected rent type in the admin that used to make the “Floorplan_rent_type_selection_cost” value.
Units
- unit_code: a unique identifier for this unit.
- unit_parent_property_code: the code for the property this unit is a part of.
- unit_parent_floorplan_code: the code for the floorplan this unit is a part of.
- unit_building_number: the building number this unit is located in.
- unit_space_id: a unique identifier for this unit.
- unit_name: marketing name used for this unit.
- unit_available_on: the date this unit will be available.
- unit_ready_date: the date this unit will be ready.
- unit_availability_url: link to your feed’s application page for this unit.
- unit_type: alternate association to floor plan.
- unit_available: whether or not this unit is available for rent.
- unit_specials_message: message for any unit level special, deal, discount, ect.
- unit_floorplan_image: Parent floor plans featured image
- unit_schedule_tour_url: link to your feed’s tour page for this unit.
- unit_quote_url: link to your feed’s quote page for this unit.
- unit_matterport_url: url for virtual tours for this unit.
- unit_application_url: ink to your feed’s application page for this unit.
- unit_rent_base: base rent value for this unit.
- unit_rent_effective: effective rent value for this unit.
- unit_rent_market: market rent value for this unit.
- unit_rent_min: minimum rent value for this unit.
- unit_rent_max: maximum rent value for this unit.
- unit_rent_terms: term rent values for this unit.
- unit_rent_term_best: best price of the rent terms for this unit.
- unit_rent_best: best price for this unit.
- unit_bedrooms: number of bedrooms for this unit.
- unit_bathrooms: number of bathrooms for this unit.
- unit_floor_level: what floor this unit is on.
- unit_sqft: the square footage for this unit.
- unit_features: a list of features specific to this unit.
- unit_images: images associated with this unit.
- unit_image_urls: images associated with this unit.
- unit_images_raw: Unit images as they come from the feed source
- unit_videos: urls to videos associated with this unit.
- unit_rent_type_selection_cost: the price of the unit that will display, based on the unit_rent_type_selection.
- unit_rent_type_selection: the value of the setting in the RentPress options which determines which price shows.
- unit_is_feed: if the unit comes from a feed, or has been manually created.
See Also
WordPress Codex: Theme Development
WordPress Developer Theme Handbook