You appear to be a bot. Output may be restricted
Description
Perform validation and update of a DIY shortcode
Usage
$bool = _diy_oik_shortcode_validate( $add_code );
Parameters
- $add_code
- ( bool ) optional default: 1 – true when adding a shortcode
Returns
bool true if validatedSource
File name: diy-oik/admin/diy-oik.phpLines:
1 to 23 of 23
function _diy_oik_shortcode_validate( $add_code=true ) { global $diy_code; $diy_code['code'] = bw_array_get( $_REQUEST, "code", null ); $diy_code['help'] = bw_array_get( $_REQUEST, "help", null ); $diy_code['content'] = bw_array_get( $_REQUEST, "content", null ); $diy_code['inactive'] = bw_array_get( $_REQUEST, "inactive", null ); $diy_code['title'] = bw_array_get( $_REQUEST, "title", null ); $ok = oik_diy_validate_code( $diy_code['code'] ); // validate the fields and add the shortcode IF it's OK to add // $add_code = bw_array_get( $_REQUEST, "_diy_oik_add_shortcode", false ); if ( $ok ) { if ( $add_code ) { $ok = _diy_oik_add_shortcode( $diy_code ); } else { $ok = _diy_oik_update_shortcode( $diy_code ); } } return( $ok ); }