Description
Obtain the parm values for the callback functionThe parameters we pass to the callback function must be obtained from post_meta for the current post. For example for the callback function used to display the value of the virtual field _oik_sc_the_title_cb we need to obtain the value of the _oik_sc_code field to pass as the first parameter.
Usage
$array = bw_virtual_field_parm_values( $field );Parameters
- $field
- ( string ) required – the virtual field being displayed
Returns
array parm valuesTO DO
Extend to support 'fieldref' fields as well, by using bw_query_fieldref_value() Note: The parms must be unique values… not multipleSource
File name: oik-fields/includes/oik-fields.incLines:
1 to 15 of 15
function bw_virtual_field_parm_values( $field ) { $args = $field['#args']; $parms = bw_assoc( bw_as_array( bw_array_get( $args, "#parms", null ) ) ); $post_id = bw_current_post_id(); $parm_values = array(); if ( count( $parms ) ) { foreach ( $parms as $parm ) { $parm_values[] = get_post_meta( $post_id, $parm, true ); } } $parm_values[] = $post_id; //bw_trace2( $post_id, "post id" ); //bw_trace2( $parm_values, "parm_values" ); return( $parm_values ); }View on GitHub
Invoked by
Calls
1 to 3 of 3
