Skip to content

Instantly share code, notes, and snippets.

@badabingbreda
Forked from Pross/bb-global-js-reset.php
Created June 16, 2022 14:18
Show Gist options
  • Save badabingbreda/a63820c4eb8f040f59254813b93465e3 to your computer and use it in GitHub Desktop.
Save badabingbreda/a63820c4eb8f040f59254813b93465e3 to your computer and use it in GitHub Desktop.
<?php
/*
Plugin Name: Beaver Builder Global JS Reset
Description: Resets global JS and self deactivates.
Author: <Simon>
Version: 1.0
*/
class BB_Global_JS_Reset {
function __construct() {
include_once ABSPATH . '/wp-admin/includes/plugin.php';
$settings = get_option( '_fl_builder_settings' );
$settings->js = '';
update_option( '_fl_builder_settings', $settings );
deactivate_plugins( plugin_basename( __FILE__ ) );
wp_die(
'Global JS has been reset.',
'Global JS Reset',
array(
'link_text' => 'Back to dashboard',
'link_url' => admin_url(),
)
);
}
}
new BB_Global_JS_Reset;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment