Skip to content

Instantly share code, notes, and snippets.

@Pross
Created January 4, 2020 12:56
Show Gist options
  • Select an option

  • Save Pross/b810dede5588bb1e3fdcebac445943c0 to your computer and use it in GitHub Desktop.

Select an option

Save Pross/b810dede5588bb1e3fdcebac445943c0 to your computer and use it in GitHub Desktop.

Revisions

  1. Pross created this gist Jan 4, 2020.
    25 changes: 25 additions & 0 deletions bb-global-js-reset.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    <?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;