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

Remove Block Editor Bloating #1079

Closed
xwolfde opened this issue Feb 11, 2022 · 2 comments
Closed

Remove Block Editor Bloating #1079

xwolfde opened this issue Feb 11, 2022 · 2 comments
Labels
Code Codeoptiminierung Plugin

Comments

@xwolfde
Copy link
Member

xwolfde commented Feb 11, 2022

Sollte eigentlich Plugin-Domain sein, aber aufgrund der fortschreitenden aber auch dynamischen Entwicklung macht es keinen Sinn irgendwelchen Plugins hinterher zu rennen (zumal es bereits zwei Plugins für das disablen des Gutenbergs gibt, die hier aber nicht wirken).

In theme.json ggf folgende Ergänzen:

{
	"settings": {
		"color": {
			"defaultPalette": false,
			"defaultGradients": false
		}
	}
}

und/oder:

function remove_wp_block_library_css(){
     wp_dequeue_style( 'wp-block-library' ); 
     wp_dequeue_style( 'wp-block-library-theme' );
     wp_dequeue_style( 'global-styles' ); 
}
add_action( 'wp_enqueue_scripts', 'remove_wp_block_library_css', 100 );

Ref: WordPress/gutenberg#24684

@xwolfde xwolfde added the Code Codeoptiminierung label Feb 11, 2022
@xwolfde xwolfde changed the title Remove Block Editor Bloating if Gutenberg is disabled Remove Block Editor Bloating Feb 11, 2022
@xwolfde
Copy link
Member Author

xwolfde commented Feb 11, 2022

Wir belassen es auf

function remove_wp_block_library_css(){
     wp_dequeue_style( 'global-styles' ); 
}
add_action( 'wp_enqueue_scripts', 'remove_wp_block_library_css', 100 );

'wp-block-library-theme' muss nicht entfernt werden, da es nur geladen wird, wenn das Theme Blöcke unterstützt current_theme_supports( 'wp-block-styles' )

@xwolfde xwolfde added the Plugin label Feb 11, 2022
@xwolfde
Copy link
Member Author

xwolfde commented Feb 11, 2022

Nun doch auf unserem CMS über das Settings-Plugin umgesetzt.
https://gitlab.rrze.fau.de/rrze-webteam/rrze-settings/-/blob/master/includes/Writing/Writing.php#L61

@xwolfde xwolfde closed this as completed Feb 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Codeoptiminierung Plugin
Projects
None yet
Development

No branches or pull requests

1 participant