false,'msg'=>"Error occurred! Form has no action.");; switch ($action){ case 'insertjs' : { $is_nonce_valid = ( isset( $data['wp_js_code_insert_nonce'] ) && wp_verify_nonce( $data['wp_js_code_insert_nonce'], 'wp_js_code_' . $data['_nonce_id'] ) ) ? true : false; if(!$is_nonce_valid) return array('status'=>false,'msg'=>"Error occurred! Form not secure."); $_head_js_code = $data['_head_js_code']; if ( current_user_can('unfiltered_html') ) $_head_js_code = stripslashes($_head_js_code); else $_head_js_code = wp_filter_post_kses($_head_js_code); update_option('_adzapier_js_code',$_head_js_code); return array('status'=>1,'msg'=>"JS Code saved successfully."); break; } } return array('status'=>false,'msg'=>"Error occurred!"); } public function wp_js_code_callback(){ $response = null; if($_REQUEST['frm-action']){ /*Apply Form Action*/ $action = sanitize_text_field($_REQUEST['frm-action']); $response = $this->applyActions($action,$_REQUEST); } $_adzapier_js_code = NULL; if(get_option('_adzapier_js_code')){ $_adzapier_js_code = get_option('_adzapier_js_code'); $_adzapier_js_code = format_to_edit($_adzapier_js_code); } include_once dirname(__FILE__)."/admin.php"; } public function plugin_action_links($links){ unset( $links['edit'] ); $links['manage'] = ''.__('Settings', 'adzapier-gdpr').''; return $links; } } add_action( 'plugins_loaded', array( 'Adzapier_GDPR', 'getInstance' ) ); ?>