Created
January 4, 2020 12:56
-
-
Save Pross/b810dede5588bb1e3fdcebac445943c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; |
benklocek
commented
Dec 23, 2020
via email
Awesome! I did not see this in the "debug mode" docs. Yeah!
On Tue, Dec 22, 2020 at 6:09 PM Simon Prosser <[email protected]>
wrote:
… ***@***.**** commented on this gist.
------------------------------
Thanks Carlos! I actually need it on the page, not the global settings.
Anyway to get it to reset just that JS?
… <#m_-2534825926060437683_>
On Tue, Dec 22, 2020 at 4:26 PM Carlos Velasco *@*.*> wrote: @.**
commented on this gist. ------------------------------ How would I use this
to clear the JS on a particular page? It's meant to clear the JavaScript
code from the Global Settings. https://www.screencast.com/t/XiGEKlasYeB —
You are receiving this because you were mentioned. Reply to this email
directly, view it on GitHub
https://gist.github.com/b810dede5588bb1e3fdcebac445943c0#gistcomment-3570439,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AACHXRBAG45LIT3YC6S5FXDSWE2IDANCNFSM4KQSUT3Q
.
Just go to wp-admin bb settings, enable debug mode.
You can now edit global js/css and if you go to a specific page/post in
wp-admin you can edit the css/js there. This was basically added to the
core bb plugin a while ago :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://gist.github.com/b810dede5588bb1e3fdcebac445943c0#gistcomment-3570520>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACHXRH7HADS673LC2JUGETSWFGKHANCNFSM4KQSUT3Q>
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment