
How to Hide the “Use Default Editor” Button in Breakdance Builder (or Oxygen 6)
Incidentally, this also works for Oxygen 6, where the “Use default editor” button can cause similar issues.
We wrote this helpful code snippet for a couple of our clients who use Breakdance Builder. One had found that their client was clicking the “Use default editor” button instead of the “Edit in Breakdance” button when working on a page, and the Breakdance-designed content was getting deleted.
The other client was clicking that button himself when he was rushing and had accidentally deleted the Breakdance-designed content for a couple of his pages.
To prevent this from happening, add the code snippet below to a snippets-type plugin, such as
WPCodeBox. If you wish to exclude some posts, you can add a comma-separated list of Post IDs on line #7.
We keep this stored in the cloud when using WPCodeBox so that it can easily be added to new sites.
<?php
add_action('admin_head', 'winusoft_conditional_remove_default_editor_button');
function winusoft_conditional_remove_default_editor_button() {
// Specify the Post IDs where the button should NOT be removed
$excluded_post_ids = []; // Replace with a comma separated list of your post IDs
// Get the current post ID
$current_post_id = isset($_GET['post']) ? intval($_GET['post']) : null;
// If the current post ID is not in the excluded list, hide the button
if (!in_array($current_post_id, $excluded_post_ids, true)) {
echo '<style>
.breakdance-launcher-link {
display: none !important;
}
</style>';
}
}
Happy building!