Skip to content

Commit 576a13d

Browse files
authored
Merge pull request #310 from 10up/feature/unregister-stretchy-variations
Feature: Unregister Stretchy block variations
2 parents aba6289 + da6f3f8 commit 576a13d

File tree

9 files changed

+93
-124
lines changed

9 files changed

+93
-124
lines changed

package-lock.json

Lines changed: 55 additions & 123 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// import './block-filters';
2+
// import './block-styles';
3+
import './block-variations';
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* Entry point for block filters.
3+
*/
4+
5+
// Each block that needs filters to be applied, should have it's own file.
6+
// import './button'
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* Entry point for block styles.
3+
*/
4+
5+
// Each block that needs custom styles should have it's own file.
6+
// import './button'
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* Entry point for block variations.
3+
*/
4+
5+
// Each block that needs variations should have it's own file.
6+
// import './button'
7+
import './unregister-variations';
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import domReady from '@wordpress/dom-ready';
2+
import { unregisterBlockVariation } from '@wordpress/blocks';
3+
4+
domReady(() => {
5+
unregisterBlockVariation('core/heading', 'stretchy-heading');
6+
unregisterBlockVariation('core/paragraph', 'stretchy-paragraph');
7+
});

themes/10up-theme/assets/js/block-editor/block-editor-script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
import './block-collection';
66
// import './block-filters';
77
// import './block-styles';
8-
// import './block-variations';
8+
import './block-variations';

themes/10up-theme/assets/js/block-editor/block-variations/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44

55
// Each block that needs variations should have it's own file.
66
// import './button'
7+
import './unregister-variations';
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import domReady from '@wordpress/dom-ready';
2+
import { unregisterBlockVariation } from '@wordpress/blocks';
3+
4+
domReady(() => {
5+
unregisterBlockVariation('core/heading', 'stretchy-heading');
6+
unregisterBlockVariation('core/paragraph', 'stretchy-paragraph');
7+
});

0 commit comments

Comments
 (0)