Description
Validate the Taxonomy fields
Usage
_oik_tax_taxonomy_validate( $add_taxonomy );Parameters
- $add_taxonomy
- ( mixed ) optional default: 1 –
Returns
voidSource
File name: oik-types/admin/oik-taxonomies.phpLines:
1 to 26 of 26
function _oik_tax_taxonomy_validate( $add_taxonomy=true ) { global $bw_taxonomy; $bw_taxonomy['args']['taxonomy'] = bw_array_get( $_REQUEST, "taxonomy", null ); $bw_taxonomy['args']['type'] = bw_array_get( $_REQUEST, "type", null ); $bw_taxonomy['args']['label'] = bw_array_get( $_REQUEST, "label", null ); ///$bw_taxonomy['args']['required'] = bw_array_get( $_REQUEST, "required", null ); $bw_taxonomy['args']['singular_name'] = bw_array_get( $_REQUEST, "singular_name", null ); $bw_taxonomy['args']['title'] = bw_array_get( $_REQUEST, "title", '' ); $bw_taxonomy['args']['show_in_rest'] = bw_array_get( $_REQUEST, "show_in_rest", null ); bw_trace2( $bw_taxonomy, "bw_taxonomy" ); $ok = oik_diy_validate_taxonomy( $bw_taxonomy['args']['taxonomy'] ); // validate the taxonomies and add the taxonomy IF it's OK to add // $add_taxonomy = bw_array_get( $_REQUEST, "_oik_tax_add_oik_tax", false ); if ( $ok ) { if ( $add_taxonomy ) { $ok = _oik_tax_add_oik_tax( $bw_taxonomy ); } else { $ok = _oik_tax_update_taxonomy( $bw_taxonomy ); } } 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_taxonomy() – Taxonomy must not be blank
- _oik_tax_add_oik_tax() – Check if it already exists as a taxonomy
- _oik_tax_update_taxonomy() – Update an oik custom taxonomy
