Radio / Checkbox control with image, this component is a part of the Olympus Zeus Core framework.

v0.0.2 2019-08-19 19:40 UTC



Image Select Control

This component is a part of the Olympus Zeus Core WordPress framework.

Olympus Component CodeFactor Grade Packagist Version


Using composer in your PHP project:

composer require getolympus/olympus-imageselect-control

Control initialization

Use the following lines to add a image select control in your WordPress customizer:

    'default'           => 'dave',
    'transport'         => 'refresh',
    'sanitize_callback' => 'custom_text_sanitization'

$wp_customize->add_control(new ImageSelect($wp_customize, 'my_imageselect_control_id', [
    'label'       => 'Select a Minion that you may know',
    'description' => 'A very important question! Pay attention to it ;)',
    'column'      => 2,
    'multiple'    => false,
    'section'     => 'my_custom_controls_section',
    'choices'     => [
        'kevin' => [
            'label' => 'Kevin',
            'image' => '',
        'mel'   => [
            'label' => 'Mel',
            'image' => '',
        'dave'  => [
            'label' => 'Dave',
            'image' => '',
        'bob'   => [
            'label' => 'Bob',
            'image' => '',


Variables definition

The variables definition depends on multiple value:

  • set to false, a uniq string value is stored in Database
  • set to true, an array of key values is stored in Database


add_control($id, $args);


Variable Type Default value if not set Description
$id String empty (required) The id of the Setting associated with this Control.
$args Array empty (required) An associative array containing arguments for the setting.

$args arguments

Variable Type Default value if not set Description
label String empty (optional) The label that will be displayed.
description String empty (optional) The description to display under the label.
column Integer 1 (optional) The number of columns to display on each line (can be 1 or 2)
multiple Boolean false (optional) The setting to let user select one or multiple choices.
section String empty (required) The Section where there control should appear.
choices Array empty (required) The list of choices with uniq keys.

The choices argument is an associative array containing a list of keys.
Each key is associated to an array, composed by:

  • label (required). Name of the choice
  • image (required). URL of the image

Release History

  • 0.0.2
  • ADD: new column and multiple attributes
  • 0.0.1

Authors and Copyright

Achraf Chouk

Please, read LICENSE for more information.


  1. Fork it (
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

Built with ♥ by Achraf Chouk ~ (c) since a long time.