Description
Register a field named $field_name of type $field_type with title $field_title and additional values $args| Arg 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
Called by
1 to 7 of 7
- bw_register_taxonomy() – Register a custom taxonomy
- Tests_bw_metadata::reset_global_bw_fields() –
- Tests_issue_2::test_bw_custom_column_admin_field_for_post_type() – Here we should produce some output – displaying the field value for "field" for the selected post ID
- Tests_issue_2::test_bw_custom_column_admin_field_not_for_post_type() – bw_custom_column_admin is an action hook which should be invoked by an action with generic name "manage_${post_type}_posts_custom_column"
- Tests_issue_2::test_bw_field_registered_for_object_type() –
- Tests_issue_2::test_bw_query_field_type() –
- Tests_issue_2::test_bw_register_field_for_object_type() –
