Skip to content

Type – Image Picker

Henner R Setyono edited this page Mar 5, 2020 · 3 revisions

'header_button_type' => [
  'label' => false,
  'type' => 'ct-image-picker',
  'attr' => [
    'data-type' => 'background',
    'data-columns' => 2,
  ],
  'choices' => [
    'type-1' => [
      'src'   => '<svg viewBox="0 0 100 70">...</svg>',
      'title' => __( 'Default' ),
    ],
    'type-2' => [
      'src'   => '<svg viewBox="0 0 100 70">...</svg>',
      'title' => __( 'Outline' ),
    ],
  ],
],

src

  • Accepts raw SVG code or a JPG/PNG Image URL.

'data-type' => 'background'

  • Make the active selection has blue background. Any SVG inside will become white.
  • Without this param, the active selection only has black border.

'data-columns' => '2'

  • Make the picker 2 items per row

Value Format

'header_button_type' => 'type-1'

Clone this wiki locally