Skip to content
This repository has been archived by the owner on May 31, 2021. It is now read-only.

Field helper: Multiselect

sy4mil edited this page Jan 28, 2013 · 1 revision

Description

Returns multiselect HTML string with appropriate class, values, id and name

Usage

aq_field_multiselect($field_id, $block_id, $options, $selected_keys);

Parameters

$field_id
(string)(required) The field id e.g. 'title'

$block_id
(string)(required) The id of the block. You usually get this from the $instance variable of the block.

$input
(mixed)(required) This is the value that is saved by the block using the given $field_id you've provided, e.g. $title (extracted from $instance)

$options
(array)(required) The size of the input. Accepted parameters - min, small or full
Default: 'full'

$type
(string)(optional) HTML input type. Accepted parameters - text, number
Default: 'text'

Return

Return HTML input string

Example

<?php echo aq_field_input('title', $block_id, $title, $size = 'full', $type='text') ?>

This will display a text input

Notes

Do not use this function to display a checkbox, use aq_field_checkbox() field helper instead.

Changelog

Since 1.0

Clone this wiki locally