Field Labels from Post Meta or Property Object
-
Hi everyone,
I’m working on a project where I want to retrieve both the value and label of Property Hive additional fields stored in post meta or within
$property
the object. I understand post meta fields are prefixed with an underscore in the database.For example, I know how to retrieve the field value using
$property->bedrooms;
orget_post_meta($post_id, '_bedroom', true)
, but I’m unsure how to retrieve the corresponding field label that’s set in settings.I realise $property->_bedrooms[‘label’] and ($property->bedrooms[‘label’] and not access as expected because bedrooms represents the value and not the metadata directly.
So, given that metadata fields like ‘_bedrooms’ are stored prefixed with an underscore in the database, how do I correctly retrieve the label associated with ‘_bedrooms’ from the ‘$property’ object in PHP?Thanks
- You must be logged in to reply to this topic.