Jump to content

Displaying Multiselect Field


Go to solution Solved by joycetan26,

Recommended Posts

Hi,

 

I created a custom field in Wordpress. I added a multi-selection field. It is working fine. This is the code:

add_filter( 'submit_resume_form_fields', 'wpjms_frontend_candidate_availability_fields' );
function wpjms_frontend_candidate_availability_fields( $fields ) {


$fields['resume_fields']['candidate_availability'] = array(
'label' => __( 'Availability', 'job_manager' ),
'type' => 'multiselect',
'options' => array(
'Early Morning (6am-9am)' => 'Early Morning (6am-9am)',
'Late Morning (9am-12pm)' => 'Late Morning (9am-12pm)',
'Early Afternoon (12-pm-3pm)' => 'Early Afternoon (12-pm-3pm)',
'Late Afternoon (3pm-6pm)' => 'Late Afternoon (3pm-6pm)',
'Early Evening (6pm-9pm)' => 'Early Evening (6pm-9pm)',
'Late Evening (9pm-12am)' => 'Late Evening (9pm-12am)',
'Overnight (12am-6am)' => 'Overnight (12am-6am)',
'Weekday' => 'Weekday',
'Weekend' => 'Weekend',
),
'priority' => 27
);
return $fields;    
}

However, I have a problem displaying it in the page. This is the code I thought would work but it didn't:

<div class="candidate_availability">
<h4><?php _e( 'Availability'); ?></h4>
<?php echo get_post_meta( $post->ID, '_candidate_availability', true ); ?>
</div>

Hope someone can help me out.

Thank you very much.

Link to comment
https://forums.phpfreaks.com/topic/296440-displaying-multiselect-field/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.