You appear to be a bot. Output may be restricted
Description
Check if it already exists as a post_typeIf not then add to the options using bw_update_option() then empty out the type field for the next one
Usage
_oik_cpt_add_oik_cpt( $bw_type );
Parameters
- $bw_type
- ( mixed ) required –
Returns
voidSource
File name: oik-types/admin/oik-types.phpLines:
1 to 16 of 16
function _oik_cpt_add_oik_cpt( $bw_type ) { $type = bw_array_get( $bw_type['args'], "type", null ); $type_exists = post_type_exists( $type ); if ( $type_exists ) { p( "Type $type already defined, try another type" ); $ok = false; } else { unset( $bw_type['args']['type'] ); bw_update_option( $type, $bw_type, "bw_types" ); // We don't need to add the type now! $bw_type['args']['type'] = ""; $ok = true; } return( $ok ); }View on GitHub