You appear to be a bot. Output may be restricted
Description
Check if the code already exists as a shortcodeIf not then add to the options using bw_update_option() then empty out the code field for the next one
Usage
$bool = _diy_oik_add_shortcode( $diy_code );
Parameters
- $diy_code
- ( string ) required – the shortcode the user is trying to add
Returns
bool true if OKSource
File name: diy-oik/admin/diy-oik.phpLines:
1 to 19 of 19
function _diy_oik_add_shortcode( $diy_code ) { $code = bw_array_get( $diy_code, "code", null ); global $shortcode_tags; $code_exists = bw_array_get( $shortcode_tags, $code, false ); if ( $code_exists ) { p( "Shortcode $code already defined, try another code" ); $ok = false; } else { unset( $diy_code['code'] ); bw_update_option( $code, $diy_code, "diy_codes" ); // We don't need to add the shortcode now! $diy_code['code'] = ""; $ok = true; } return( $ok ); }