Description
Validate the field to type relationship
Usage
_oik_f2t_f2t_validate( $add_f2t );Parameters
- $add_f2t
- ( mixed ) optional default: 1 –
Returns
voidSource
File name: oik-types/admin/oik-f2t.phpLines:
1 to 25 of 25
function _oik_f2t_f2t_validate( $add_f2t=true ) { global $bw_f2t; $bw_f2t['args']['type'] = bw_array_get( $_REQUEST, "type", null ); $bw_f2t['args']['field'] = bw_array_get( $_REQUEST, "field", null ); $bw_f2t['args']['f2t'] = $bw_f2t['args']['type'] . "." . $bw_f2t['args']['field']; // $bw_f2t['args']['hierarchical'] = bw_array_get( $_REQUEST, "hierarchical", null ); // $bw_f2t['args']['title'] = bw_array_get( $_REQUEST, "title", null ); bw_trace2( $bw_f2t, "bw_f2t" ); $ok = oik_diy_validate_f2t( $bw_f2t['args']['f2t'] ); // validate the fields and add the f2t IF it's OK to add // $add_f2t = bw_array_get( $_REQUEST, "_oik_f2t_add_oik_f2t", false ); if ( $ok ) { if ( $add_f2t ) { $ok = _oik_f2t_add_oik_f2t( $bw_f2t ); } else { $ok = _oik_f2t_update_f2t( $bw_f2t ); } } return( $ok ); }View on GitHub
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_trace2() – Trace $value to the trace log file if tracing is active
- oik_diy_validate_f2t() – f2t must not be blank
- _oik_f2t_add_oik_f2t() – Add a field to post relationship
- _oik_f2t_update_f2t() – Update the field to post relationship
