• Resolved bkas24

    (@bkas24)


    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;or get_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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Property Hive

    (@propertyhive)

    Good morning,

    The label isn’t stored in the database. It’s just hardcoded. We know the meta field is storing bedrooms, so everywhere inside the application we’ll just hardcode the label ‘Bedrooms’. It’s not stored in the database.

    Do you have more info as to your use case and I’ll see if I can assist further.

    Thanks,

    Steve

    Thread Starter bkas24

    (@bkas24)

    Ok, that’s fine. Thanks Steve

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.