I mean insert one snippet code in backend for attribute when vendor filling listing form. Forexample attribute “A” is not editable in frontend but I want add snippet code by default to this attribute and shown in listing page as value.
Sorry for the delayed answer. Please try this PHP snippet. Please change hp_your_attribute_slug
on hp_ + your attribute slug
and value
on the attribute value which you want to set
add_action('hivepress/v1/models/listing/create', function($listing_id) {
update_post_meta($listing_id, 'hp_your_attribute_slug', value);
});
1 Like