-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#164 feat (blocks) : JS method to deregister embed blocks + core bloc…
…ks variations
- Loading branch information
1 parent
3ee7dfc
commit fd608ee
Showing
5 changed files
with
90 additions
and
28 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module.exports = { | ||
app: ['./src/js/index.js', './src/scss/style.scss'], | ||
editor: ['./src/js/editor.js', './src/scss/editor.scss'], | ||
editor: ['./src/js/editor-script.js', './src/scss/editor-style.scss'], | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import lazySizes from 'lazysizes' | ||
import 'lazysizes/plugins/native-loading/ls.native-loading' | ||
import 'lazysizes/plugins/object-fit/ls.object-fit' | ||
|
||
/** | ||
* LazySizes configuration | ||
* https://github.com/aFarkas/lazysizes/#js-api---options | ||
*/ | ||
lazySizes.cfg.nativeLoading = { | ||
setLoadingAttribute: false, | ||
} | ||
|
||
// Native Gutenberg | ||
if (typeof wp !== 'undefined') { | ||
wp.domReady(() => { | ||
// Disable block styles | ||
|
||
// block image | ||
// wp.blocks.unregisterBlockStyle('core/image', 'rounded') | ||
// wp.blocks.unregisterBlockStyle('core/image', 'default') | ||
|
||
// block quote | ||
// wp.blocks.unregisterBlockStyle('core/quote', 'default') | ||
// wp.blocks.unregisterBlockStyle('core/quote', 'large') | ||
|
||
// block pullquote | ||
// wp.blocks.unregisterBlockStyle('core/pullquote', 'default') | ||
// wp.blocks.unregisterBlockStyle('core/pullquote', 'solid-color') | ||
|
||
// block separator | ||
// wp.blocks.unregisterBlockStyle('core/separator', 'default') | ||
// wp.blocks.unregisterBlockStyle('core/separator', 'wide') | ||
// wp.blocks.unregisterBlockStyle('core/separator', 'dots') | ||
|
||
// block table | ||
// wp.blocks.unregisterBlockStyle('core/table', 'regular') | ||
// wp.blocks.unregisterBlockStyle('core/table', 'stripes') | ||
|
||
// Disable core embed blocks | ||
|
||
var embedVariations = [ | ||
// 'amazon-kindle', | ||
// 'animoto', | ||
// 'cloudup', | ||
// 'collegehumor', | ||
// 'crowdsignal', | ||
// 'dailymotion', | ||
// 'facebook', | ||
// 'flickr', | ||
// 'imgur', | ||
// 'instagram', | ||
// 'issuu', | ||
// 'kickstarter', | ||
// 'meetup-com', | ||
// 'mixcloud', | ||
// 'reddit', | ||
// 'reverbnation', | ||
// 'screencast', | ||
// 'scribd', | ||
// 'slideshare', | ||
// 'smugmug', | ||
// 'soundcloud', | ||
// 'speaker-deck', | ||
// 'spotify', | ||
// 'ted', | ||
// 'tiktok', | ||
// 'tumblr', | ||
// 'twitter', | ||
// 'videopress', | ||
// 'vimeo', | ||
// 'wordpress', | ||
// 'wordpress-tv', | ||
// 'youtube' | ||
] | ||
|
||
for (var i = embedVariations.length - 1; i >= 0; i--) { | ||
wp.blocks.unregisterBlockVariation('core/embed', embedVariations[i]) | ||
} | ||
}) | ||
} | ||
|
||
// ACF Blocks | ||
if (window.acf) { | ||
// Do stuff | ||
} |
This file was deleted.
Oops, something went wrong.
File renamed without changes.