joycetan26 Posted May 22, 2015 Share Posted May 22, 2015 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 More sharing options...
joycetan26 Posted May 22, 2015 Author Share Posted May 22, 2015 Hi guys, I got this sorted out! Link to comment https://forums.phpfreaks.com/topic/296440-displaying-multiselect-field/#findComment-1512422 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.