PoshWaffle
11/13/2017 - 10:31 PM

Unset Revisions from the Beaver Builder 2.0 UI and move widgets from Widgets to Standard or Advanced.

Unset Revisions from the Beaver Builder 2.0 UI and move widgets from Widgets to Standard or Advanced.

<?php

add_filter( 'fl_builder_ui_js_config', function( $config ) {

    /**
    * Remove the WordPress Widgets content panel view
    */
    unset( $config['panelData']['tabs']['modules']['views'][2] );

    /**
    * Add WordPress Widgets to the Standard modules group
    */
    if ( isset( $config['contentItems']['module'] ) ) {
        foreach( $config['contentItems']['module'] as $module ) {
            if ( $module->isWidget ) {
                $module->group = array('standard'); /* Put widgets into standard group */
            }
        }
    }

    /**
    * Remove Revisions Item from the tools menu
    */
    if ( isset( $config['mainMenu']['main']['items'] ) ) {

        /* Remove the revisions item */
        unset( $config['mainMenu']['main']['items'][35] );
    }

    /**
    * Be sure to return the $config object or all of Beaver Builder will break :)
    */
    return $config;
});