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

Field helper: Input

sy4mil edited this page Jan 28, 2013 · 11 revisions

Description

Return HTML text input, with appropriate class, type, name, id and values.

Usage

aq_field_input($field_id, $block_id, $input, $size, $type);

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)

$size
(string)(optional) 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