How to get the metabox field value from frontend

I’m able to add a new field in the listing attributes metabox using this code :

add_filter( ‘hivepress/v1/meta_boxes/listing_attribute_display’, ‘alter_listing_attribute_metaboxes’, 200 );

function alter_listing_attribute_metaboxes( $meta_box ){
$meta_box[‘fields’][‘listing_submit_section’] = [
‘type’ => ‘select’,
‘label’ => ‘Submit listing section’,
‘description’ => ‘In which section to show it in the Submit listing page?’,
‘_order’ => 1,
‘options’ => [
‘section 1’ => ‘1st Section’,
‘section 2’ => ‘2nd Section’,
return $meta_box;

Now i’m trying to get the value of the ‘listing_submit_section’ field picked from the edit attribute page
I want to get its value from the $listing object in the custom template of the submit listing page
Or maybe you can suggest another idea to get it ?

If you already added this field as an attribute meta box field, it’ll be saved in the “hp_listing_submit_section” meta field for this attribute (attribute is a custom post type “hp_listing_attribute”). But getting its value from a listing is not so simple, because listing contains fields implemented by attributes, but not all the attribute data.

Please describe the purpose of these customizations, there may be an easier solution.

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