You appear to be a bot. Output may be restricted
Description
Validate the plugin's settings and add/update if required
Usage
$bool = _oik_plugins_settings_validate( $add_plugin );
Parameters
- $add_plugin
- ( bool ) optional default: 1 –
Returns
bool validation resultSource
File name: oik/libs/oik_plugins.phpLines:
1 to 19 of 19
function _oik_plugins_settings_validate( $add_plugin=true ) { global $bw_plugin; $bw_plugin['plugin'] = sanitize_key( trim( bw_array_get( $_REQUEST, "plugin", null ) ) ); $bw_plugin['server'] = esc_url_raw( trim( bw_array_get( $_REQUEST, "server", null ) ) ); $bw_plugin['apikey'] = sanitize_key( trim( bw_array_get( $_REQUEST, "apikey", null ) ) ); $ok = oik_plugins_validate_plugin( $bw_plugin['plugin'] ); // validate the fields and add the settings IF it's OK to add // $add_plugin = bw_array_get( $_REQUEST, "_oik_plugins_add_settings", false ); if ( $ok ) { if ( $add_plugin ) { $ok = _oik_plugins_add_settings( $bw_plugin ); } else { $ok = _oik_plugins_update_settings( $bw_plugin ); } } return( $ok ); }View on GitHub View on Trac