You appear to be a bot. Output may be restricted
Description
Register a field named $field_name of type $field_type with title $field_title and additional values $argsArg name | Purpose |
---|---|
#length | for text fields |
#validate | for any field |
#type | for noderef type fields |
#options | for select type fields |
#multiple | for multiple select fields |
#form | bool – whether or not to display the field on an “Add New” form – defaults to true |
#theme | bool – whether or not to display the field during “theming” – defaults to true |
#theme_null | bool – whether or not to display the field when null – defaults to true |
#hint | Field hint |
Arg name | Purpose |
---|---|
#callback | callback function for virtual fields |
#parms | metadata field to pass to callback function |
#plugin | implementing plugin for #callback |
#file | file in implementing plugin for #callback |
Usage
bw_register_field( $field_name, $field_type, $field_title, $args );
Parameters
- $field_name
- ( string ) required – meta_key of the field – precede with an underscore so it's not in custom fields
- $field_type
- ( string ) required – type of field e.g. text, textarea, radio button
- $field_title
- ( string ) required – title of the field
- $args
- ( string ) optional – $field_type specific values
Returns
voidSource
File name: oik/includes/bw_register.phpLines:
1 to 8 of 8
function bw_register_field( $field_name, $field_type, $field_title, $args=NULL ) { global $bw_fields; $data = array( '#field_type' => $field_type, '#title' => $field_title, '#args' => $args, ); $bw_fields[$field_name] = $data; }View on GitHub View on Trac