function TS_VCSC_Delete_Plugin_Settings_Uninstall() { if (get_option('ts_vcsc_extend_settings_retain') != 2) { TS_VCSC_DeleteOptionsPrefixed('ts_vcsc_extend_settings_'); unregister_setting('ts_vcsc_extend_custom_css', 'ts_vcsc_extend_custom_css', 'TS_VCSC_CustomCSS_Validation'); unregister_setting('ts_vcsc_extend_custom_js', 'ts_vcsc_extend_custom_js', 'TS_VCSC_CustomJS_Validation'); delete_option("ts_vcsc_extend_custom_css"); delete_option("ts_vcsc_extend_custom_js"); TS_VCSC_RemoveCap(); TS_VCSC_DeleteCustomPack(); } }
function TS_VCSC_Delete_Plugin_Options() { TS_VCSC_DeleteOptionsPrefixed('ts_vcsc_extend_settings_'); unregister_setting('ts_vcsc_extend_custom_css', 'ts_vcsc_extend_custom_css', array($this, 'TS_VCSC_CustomCSS_Validation')); unregister_setting('ts_vcsc_extend_custom_js', 'ts_vcsc_extend_custom_js', array($this, 'TS_VCSC_CustomJS_Validation')); delete_option("ts_vcsc_extend_custom_css"); delete_option("ts_vcsc_extend_custom_js"); $roles = get_editable_roles(); foreach ($GLOBALS['wp_roles']->role_objects as $key => $role) { if (isset($roles[$key]) && $role->has_cap('ts_vcsc_extend')) { $role->remove_cap('ts_vcsc_extend'); } } }