How can we add the postmeta data using listing model

Hi all,
I want to save data the in wp_postmeta table using the listing model of hivepress. But i didn’t get any docs or code about it. Please give me a full code to save the post meta table data of any list. So that i can use it properly.

I am sending the data using fill method of the model and also send the fields attribute in the model but still no data filling in the postmeta table.

I’m sorry for the delay. If the attribute is registered for the listing model, you don’t have to worry about its implementation. For example, if you added an attribute in Listings/Attributes using the WordPress backend UI, or added it via the hivepress/v1/models/listing/attributes hook, you can simply save its value this way:

$listing->set_attribute_name_here(123)->save_attribute_name_here();

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.