How to pickup the Option
-
$cmb->add_field( array( 'name' => 'Select Video or Image', 'desc' => 'Select an option', 'id' => $prefix . 'image_or_video', 'type' => 'select', 'show_option_none' => true, 'default' => 'custom', 'options' => array( 'standard' => __( 'Option One', 'cmb2' ), 'custom' => __( 'Option Two', 'cmb2' ), 'none' => __( 'Option Three', 'cmb2' ), ), ) );
I have written the above meta in my functions.php file.
My requirement →
when option two is chosen then I should execute some code.
Like This this →
If (Option 2 True) { <?php //some Php code ?> } else { <?php //some other Php code ?> }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘How to pickup the Option’ is closed to new replies.