How to customize container fields
Available hooks in every section
- Container Information – wpc_container_info_fields
- Trip Information – wpc_trip_info_fields
- Time Information – wpc_time_info_fields
- History Information – wpc_container_history_fields
Following are list of default field keys of Container Information:
- container_no
- container_agent
- container_tel
- passport
Following are list of default field keys of Trip Information:
- origin
- destination
- delivery_agent
- delivery_tel
Following are list of default field keys of Time Information:
- date
- time
- expected_date
- travel_mode
Following are list of default field keys of History Information:
- status_location
- update_status
- status_remarks
- status_date
Following are the list subkeys
Note:this is applicable to all field keys
- id – field Id
- label – field label
- field – types of field
- field_type – types of field
- required – if field is required to fill in or not
- options – list of options for dropdown
- field_data – default data when form is load
- field_key – field key/name
Adding new fields
Note: Paste this code in functions.php of your current theme.
/* * Add new fields */ add_filter('wpc_container_info_fields', 'wpc_container_info_fields_callback', 10, 1); function wpc_container_info_fields_callback( $fields){ $fields['container_add_field'] = array( 'id' => 'container_add_field', 'label' => 'Container Additional Field', 'field' => 'text', 'field_type' => 'text', 'required' => false, 'options' => array(), 'field_data' => array(), 'field_key' => 'container_add_field' ); return $fields; }
Rename fields
/* * Renaming of fields */ add_filter('wpc_container_info_fields', 'wpc_container_info_fields_callback', 10, 1); function wpc_container_info_fields_callback( $fields ){ $fields['container_tel']['label'] = "Mobile Number"; return $fields; }
Removing fields
/* * Removing of fields */ add_filter('wpc_container_info_fields', 'wpc_container_info_fields_callback', 10, 1); function wpc_container_info_fields_callback( $fields ){ unset($fields['container_tel']); return $fields; }