How To Change the Keyboard Shortcut Keys in Beaver Builder

Share on facebook
Share on twitter
Share on reddit
Share on linkedin
Share on pinterest
Share on email
QuestionsHow To Change the Keyboard Shortcut Keys in Beaver Builder
Adam @ WPCrafter Staff asked 2 years ago

With the release of Beaver Builder 2, there are keyboard shortcuts available to quickly do common tasks. Some examples are saving a page, going into preview mode, and many other actions. But how do you change these shortcut keys?

1 Answers
Adam @ WPCrafter Staff answered 2 years ago

After some digging around I have discovered that the Beaver Builder keyboard shortcuts can be customized with the following custom function.

add_filter( 'fl_builder_keyboard_shortcuts', 'get_keyboard_shortcuts_mine' );
/** 
 * Modify the Beaver Builder 2 Keyboard shortcuts
 */
function get_keyboard_shortcuts_mine( $data ) {
    
    $data['showModules']['keyCode'] = 'm';
    $data['showRows']['keyCode'] = 'r';
    $data['showTemplates']['keyCode'] = 't';
    $data['showSaved']['keyCode'] = 's';
    $data['saveTemplate']['keyCode'] = 'mod+t';    
    $data['previewLayout']['keyCode'] = 'p';
    $data['showGlobalSettings']['keyCode'] = 'command+g';
    $data['showLayoutSettings']['keyCode'] = 'command+l';
    $data['toggleUISkin']['keyCode'] = 'o';
    $data['showSearch']['keyCode'] = 'command+c';
    
    return $data;

}