- This topic has 6 replies, 2 voices, and was last updated 2 years, 7 months ago by .
-
Topic
-
Hello, I have a select advanced that gives as options several languages. I am using esc_html__ to translate the key and value. The translation is accesible on the .po file but I can't display it in the page, in page only shows English language.
The metabox:
array( 'id' => $prefix . 'languages', 'name' => esc_html__( 'Languages', 'yanse' ), 'type' => 'select_advanced', 'options' => array( esc_html__( 'English', 'yanse' ) => esc_html__( 'English', 'yanse' ), esc_html__( 'Spanish', 'yanse' ) => esc_html__( 'Spanish', 'yanse' ), esc_html__( 'Japanese', 'yanse' ) => esc_html__( 'Japanese', 'yanse' ), esc_html__( 'Korean', 'yanse' ) => esc_html__( 'Korean', 'yanse' ), ), 'multiple' => true, //'required' => true, 'std' => array( 'English', 'Chinese' ), ),
This is how I display the fields.
$valueArray = rwmb_meta( 'mb_languages', array( 'multiple' => true) ); $pieces = array(); foreach ($valueArray as $item) { $pieces [] = $item; } echo implode(', ', $pieces);
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- You must be logged in to reply to this topic.