Image Select

Edit this page on Github


The image select field allows you to select a choice via images. It works similar to radio / checkbox field, but uses images for more user-friendly interface.


image select


Besides the common settings, this field has the following specific settings:

Name Description
options Array of 'value' => 'Image URL' pairs. value is stored in the custom field and image URL is used to display the image. Required.
multiple Whether enable multiple selection? true or false (default).

Sample code

    'id'       => 'image_select',
    'name'     => 'Layout',
    'type'     => 'image_select',

    // Array of 'value' => 'Image URL' pairs
    'options'  => array(
        'left'  => '',
        'right' => '',
        'none'  => '',

    // Allow to select multiple values? Default is false
    // 'multiple' => true,


If field has multiple value, each value is stored in a single row in the database with the same meta key (similar to what add_post_meta does with last parameter false). Otherwise, the field saves its single value in the post meta.

The value saved in the database is the value defined in the options table, not the image URL.

Template usage

To get the field value, use the following code:

$value = rwmb_meta( $field_id );
echo $value;

Read more about rwmb_meta().

Edit this page on Github