Home › Forums › Front-end Issues › Output Value from selected field
Hi! I need some guidance on how to output the selected values from a select on front.
I used this for renter and owner wonder(user_id==1) or renter(user_ID==0)
This is how its setup in ACF:
http://prnt.sc/v2thpx
http://prnt.sc/v2tinw
This is how I setup ACF
if( function_exists(‘acf_add_local_field_group’) ):
acf_add_local_field_group(array(
‘key’ => ‘group_5f8501f69e017’,
‘title’ => ‘Bizniness Rewards Programme’,
‘fields’ => array(
array(
‘key’ => ‘field_5f85021b748a4’,
‘label’ => ‘Owner Level (Booking & Service Fee)’,
‘name’ => ‘BZ-Owner-Level-Booking’,
‘type’ => ‘select’,
‘instructions’ => ‘Update Membership Package’,
‘required’ => 0,
‘conditional_logic’ => 0,
‘wrapper’ => array(
‘width’ => ”,
‘class’ => ”,
‘id’ => ”,
),
‘formula’ => ”,
‘readonly’ => 0,
‘choices’ => array(
10 => ‘Standard (10%)’,
‘9.5’ => ‘Bronze (9.5%)’,
9 => ‘Silver (9%)’,
‘8.5’ => ‘Gold (8.5%)’,
8 => ‘Diamond (8%)’,
‘7.5’ => ‘Opal (7.5%)’,
7 => ‘Ruby (7%)’,
),
‘default_value’ => false,
‘allow_null’ => 0,
‘multiple’ => 0,
‘ui’ => 1,
‘ajax’ => 0,
‘return_format’ => ‘value’,
‘placeholder’ => ”,
),
array(
‘key’ => ‘field_5f865bca62817’,
‘label’ => ‘Renter Level (Booking & Service Fee)’,
‘name’ => ‘BZ-Renter-Level-Booking’,
‘type’ => ‘select’,
‘instructions’ => ‘Update Membership Package’,
‘required’ => 0,
‘conditional_logic’ => 0,
‘wrapper’ => array(
‘width’ => ”,
‘class’ => ”,
‘id’ => ”,
),
‘formula’ => ”,
‘readonly’ => 0,
‘choices’ => array(
15 => ‘Standard (15%)’,
14 => ‘Bronze (14%)’,
13 => ‘Silver (13%)’,
12 => ‘Gold (12%)’,
11 => ‘Diamond (11%)’,
10 => ‘Opal (10%)’,
9 => ‘Ruby (9%)’,
),
‘default_value’ => false,
‘allow_null’ => 0,
‘multiple’ => 0,
‘ui’ => 1,
‘ajax’ => 0,
‘return_format’ => ‘value’,
‘placeholder’ => ”,
),
array(
‘key’ => ‘field_5f890f5954ffa’,
‘label’ => ‘Earned Points’,
‘name’ => ‘earned_points’,
‘type’ => ‘number’,
‘instructions’ => ”,
‘required’ => 0,
‘conditional_logic’ => 0,
‘wrapper’ => array(
‘width’ => ”,
‘class’ => ”,
‘id’ => ”,
),
‘default_value’ => 0,
‘placeholder’ => ”,
‘prepend’ => ”,
‘append’ => ”,
‘min’ => ”,
‘max’ => ”,
‘step’ => ”,
),
),
‘location’ => array(
array(
array(
‘param’ => ‘user_form’,
‘operator’ => ‘==’,
‘value’ => ‘edit’,
),
),
),
‘menu_order’ => 0,
‘position’ => ‘acf_after_title’,
‘style’ => ‘default’,
‘label_placement’ => ‘top’,
‘instruction_placement’ => ‘label’,
‘hide_on_screen’ => ”,
‘active’ => true,
‘description’ => ”,
));
endif;
I want to display the selected value something like this
https://prnt.sc/v2tjth
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
🚨 The 2023 ACF Annual Survey closes tomorrow! This is your last chance to complete the survey and help guide the evolution of ACF. https://t.co/0cgr9ZFOJ5
— Advanced Custom Fields (@wp_acf) May 18, 2023
© 2023 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.