Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whitelist block.json in theme bundle #289

Merged
merged 2 commits into from
Feb 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ module.exports = function ( grunt ) {
'!theme/assets/js/*.map',
'!theme/assets/js/editor*',
'!theme/assets/src/**',
'theme/assets/src/**/*.json',
'!theme/tests/**',
'!theme/wp-assets/**',
'!theme/composer*',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"description": "Material back to top button",
"editorStyle": [
"material-google-fonts-cdn",
"material-google-fonts",
"material-block-editor-css-theme"
],
"editorScript": "material-block-editor-js-theme"
Expand Down
2 changes: 1 addition & 1 deletion theme/assets/src/block-editor/blocks/card/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"supports": {},
"apiVersion": 2,
"description": "Material card for query loop block",
"editorStyle": ["material-google-fonts-cdn", "material-block-editor-css-theme"],
"editorStyle": ["material-google-fonts", "material-block-editor-css-theme"],
"editorScript": "material-block-editor-js-theme",
"usesContext": [ "postId", "postType", "queryId" ],
"textdomain": "material-design-google"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"title": "Dark Mode Switch",
"description": "Material dark mode switch",
"editorStyle": [
"material-google-fonts-cdn",
"material-google-fonts",
"material-block-editor-css-theme"
],
"editorScript": "material-block-editor-js-theme"
Expand Down
2 changes: 1 addition & 1 deletion theme/assets/src/block-editor/blocks/search/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"supports": {},
"description": "Material search bar",
"editorStyle": [
"material-google-fonts-cdn",
"material-google-fonts",
"material-block-editor-css-theme"
],
"editorScript": "material-block-editor-js-theme"
Expand Down
6 changes: 4 additions & 2 deletions theme/inc/block-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ function enqueue_block_editor_assets() {
$version,
false
);
if ( ! wp_style_is( 'material-google-fonts-cdn', 'enqueued' ) ) {

if ( ! wp_style_is( 'material-google-fonts', 'enqueued' ) ) {
// Ideally this should be injected by the plugin if not fallback to default fonts.
wp_enqueue_style(
'material-google-fonts-cdn',
'material-google-fonts',
esc_url( '//fonts.googleapis.com/css?family=Roboto|Material+Icons' ),
[],
$theme_version
Expand Down