Last active
August 12, 2020 20:39
-
-
Save morganestes/b660d01ac8e68994e150abfbf74c933b to your computer and use it in GitHub Desktop.
Exmple of how to extend Gutenberg with JS hooks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { applyFilters, addFilter } from "@wordpress/hooks"; | |
addFilter('plugins.registerPlugin', 'bigwing/editor-sidebar', (settings, name) => { | |
console.log(settings, name); | |
if ('bigwing-editor-sidebar' !== name) { | |
return settings; | |
} | |
console.log(settings); | |
if (settings.hasOwnProperty('icon')) { | |
settings.icon = ''; | |
} | |
return settings; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment