Display Multiselect field values
-
Hi there,
I`m using your plugin and I added a multiselect field. It works nice on front end and admin submission, but I am having trouble displaying it on frontend.
Here is my code:
$payments = get_post_meta( get_the_ID(), '_job_payment', true); if ( ! empty( $payments ) ) { echo '<div>' . __( 'Available types of payment:' ); echo $payments; echo '</div>';When I do this, echo gives me ARRAY where payments should go. When I do replace
echo $payments
with this code
foreach ( $payments as $item) : echo "$item, "; endforeach;
then the result is 3, 10,When I add var_dump($payments); result is
array(2) { [0]=> string(1) “3” [1]=> string(2) “10” }
So basically I need a way to display option values instead of IDs.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Display Multiselect field values’ is closed to new replies.