Skip to content

Commit

Permalink
Update admin.js
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbaker authored May 4, 2021
1 parent 608508c commit 62a851a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,18 @@ var fuxtAdmin = {
.prop('checked', lastChecked.checked)
}

lastChecked = this
lastChecked = this;
}
)
},
removeUnusedBlocks: function() {
// This functions removes some blocks from the Gutenberg editor.
// SEE: https://wordpress.stackexchange.com/questions/379612/how-to-remove-the-core-embed-blocks-in-wordpress-5-6

if (typeof wp.domReady == "undefined") {
return;
}

wp.domReady(function() {
let allowedEmbedBlocks = ['vimeo', 'youtube']
if (fuxtAdmin.isGutenbergActive())
Expand All @@ -77,7 +82,7 @@ var fuxtAdmin = {
})
},
isGutenbergActive: function() {
return typeof wp !== 'undefined' && typeof wp.blocks !== 'undefined'
return typeof wp !== 'undefined' && typeof wp.blocks !== 'undefined';
}
}
jQuery(document).ready(function() {
Expand Down

0 comments on commit 62a851a

Please sign in to comment.