Description
Theme a custom field
Usage
bw_theme_field( $key, $value, $field );
Parameters
- $key
- ( string ) required – field name e.g. _txn_amount
- $value
- ( mixed ) required – post metadata value
- $field
- ( array ) optional – the field structure if defined using
bw_register_field()
Returns
void
Source
File name: oik/libs/bw_fields.php
Lines: 1 to 26 of 26
function bw_theme_field( $key, $value, $field=null ) { //bw_trace2(); $type = bw_array_get( $field, "#field_type", null ); // //if ( function_exists( "bw_pre_theme_field" ) ) { bw_pre_theme_field(); //} // Try for a theming function named "bw_theme_field_$type_$key $funcname = bw_funcname( "bw_theme_field_${type}", $key ); // If there isn't a generic one for the type // nor a specific one just try for the field if ( $funcname == "bw_theme_field_" && $type ) { $funcname = bw_funcname( "bw_theme_field_", $key ); } if ( is_callable( $funcname ) ) { //bw_trace2( $funcname, "funcname chosen", false ); call_user_func( $funcname, $key, $value, $field ); } else { bw_trace2( $funcname, "funcname chosen not callable, using default _bw_theme_field_default", false ); _bw_theme_field_default( $key, $value, $field ); } }
Called by
1 to 4 of 4
- bw_format_custom_column() – format a custom column on the admin page IF the column is defined in bw_fields
- bw_format_field() – Theme an array of custom fields
- bw_format_table_row() – Format a table row
- bw_theme_object_property() – If the field type is not defined then it’s probably a post object’s property
Invoked by
Calls
1 to 5 of 5
- bw_array_get() – Return the array[index] or array->index (for an object) or a default value if not set
- bw_funcname() – Return the function name of the function to invoke built from parms
- bw_pre_theme_field() – Request plugins to load their field theming functions
- bw_trace2() – Trace $value to the trace log file if tracing is active
- _bw_theme_field_default() – Default theming of metadata based on field name ( $key ) or content? ( $value )